Runs a formula and returns your own value instead if it produces an error.
IFERROR wraps a formula and catches whatever goes wrong with it. If the formula works, you get its result; if it produces any error at all, you get the fallback you specified instead. It exists because a spreadsheet full of #DIV/0! and #N/A is unreadable, and because those errors spread — one #N/A in a column makes the SUM at the bottom of it an #N/A too.
The classic uses are division where the denominator might be zero, and lookups where the value might genuinely be missing. Both are situations where the error is expected and meaningless to the reader, and replacing it with a blank or a short label makes the sheet usable.
The danger is that IFERROR catches everything, including mistakes you would rather know about. A typo in a range name produces #NAME?, and IFERROR will quietly replace it with "Not found" as though it were a legitimate miss. When you specifically expect a lookup to fail, IFNA is the safer choice — it catches only #N/A and lets real errors through.
=IFERROR(value, value_if_error)valuevalue_if_errorHeaders in row 1, data in A2:C5.
| A | B | C | |
|---|---|---|---|
| 1 | Rep | Sales | Target |
| 2 | Alice | 1240 | 1000 |
| 3 | Bruno | 385 | 1000 |
| 4 | Chen | 2100 | 1500 |
| 5 | Dana | 940 | 0 |
=B5/C5Result: #DIV/0!
Dana's target is 0, so this division fails. Left alone, it will poison any total built on the column.
=IFERROR(B5/C5, "No target")Result: No target
The same division, with the error replaced by something a reader understands.
=IFERROR(B2/C2, "No target")Result: 1.24
When the formula works, IFERROR is invisible — it returns the result unchanged.
=IFERROR(VLOOKUP("Eve", A2:C5, 2, FALSE), 0)Result: 0
A missing lookup returning 0 rather than #N/A, so the column can still be summed.
Reading about a formula is not the same as writing one. Open this function's exercise and type it into a real grid — you get instant feedback on exactly which cell is wrong and why.
Why it happens: IFERROR catches every error type, so a broken range reference or a misspelled function name is silently replaced by your fallback.
How to fix it: Use IFNA when you only mean to catch a failed lookup. Remove the IFERROR temporarily when a formula gives an unexpected result — the underlying error is usually the explanation.
Why it happens: The fallback is text ("Not found") sitting in a numeric column, so SUM ignores those rows.
How to fix it: Return 0 rather than text when the column feeds arithmetic, and use text only in columns meant for reading.
Why it happens: The Excel version predates IFERROR, which arrived in Excel 2007.
How to fix it: Use the older =IF(ISERROR(formula), fallback, formula) pattern, which evaluates the formula twice but works everywhere.
IFERROR catches every error — #N/A, #DIV/0!, #VALUE!, #REF!, #NAME?, #NUM! and #NULL!. IFNA catches only #N/A. For lookups, IFNA is usually correct: a missing value is expected, but a #REF! means your formula is broken and you want to see it.
Barely. Unlike the old IF(ISERROR(...)) pattern, which evaluates the formula twice, IFERROR evaluates it once. On very large models the difference is measurable in the other direction — IFERROR is the faster of the two.
No. Wrapping everything hides the errors that tell you something is genuinely wrong, and an error that appears months later in a report nobody checked is much more expensive than one that appears immediately. Wrap only where failure is expected and harmless.
Longer reads where this function does real work in a real sheet.