IFERROR catches an error produced by a calculation and returns a replacement value; ISERROR checks whether a value or calculation produces an error and returns TRUE or FALSE. Use IFERROR when you want to handle an error in the result, and ISERROR when you need to detect an error or make a decision based on whether one occurred.
The essential difference
The names are similar, but the functions do different jobs. IFERROR is an error-handling function: it evaluates an expression and, if that expression results in an error, substitutes the fallback you specify. ISERROR is a test: it reports whether its argument is an error value, without replacing that value or fixing its cause.
For example, dividing by zero produces the Excel error #DIV/0!. IFERROR can display a message instead of that error. ISERROR can tell you whether the division failed, returning TRUE for an error and FALSE for a normal result. In short, IFERROR changes what a formula returns; ISERROR returns a logical answer about an expression.
| Function | What it returns | Typical purpose |
|---|---|---|
| IFERROR(value, value_if_error) | The value if it is not an error; otherwise the specified fallback | Show a usable result or message when a calculation fails |
| ISERROR(value) | TRUE if the argument is an error; otherwise FALSE | Test for errors, or use the test in a larger logical formula |
How IFERROR works
IFERROR has two arguments: the expression to evaluate and the value to return if that expression produces an error. If the expression succeeds, Excel returns its result as usual. The fallback can be text, a number, a blank text string, or another calculation. Because the fallback is part of the formula, the result can be easier for a report or reader to understand than a raw Excel error.
With the denominator in A2 and the numerator in B2, and with A2 set to 0 and B2 set to 24, this formula returns the text “No result” instead of #DIV/0!:
=IFERROR(B2/A2,"No result")
When A2 contains 6 and B2 contains 24, the same formula returns 4, because the division succeeds. IFERROR does not replace valid values; it uses its second argument only when the first argument evaluates to an error.
That convenience is useful, but it also means the function can cover up more than the error you had in mind. IFERROR handles any error returned by its first argument, not just division by zero. For a formula with several possible failure causes, a single generic fallback may hide important differences between them.
How ISERROR works
ISERROR takes one argument and returns a logical value. It returns TRUE when that argument evaluates to an Excel error, and FALSE when it evaluates to an ordinary value, including text, numbers, or a blank cell. It does not display a replacement message on its own. To show different results depending on the test, combine it with IF.
Using the same layout—B2 is the numerator, A2 is the denominator, and A2 is 0—the test below returns TRUE because the division produces #DIV/0!:
=ISERROR(B2/A2)
If A2 is 6 and B2 is 24, that formula returns FALSE. If A2 itself contains an error, the division also produces an error and ISERROR returns TRUE. By contrast, if A2 contains text that cannot be used in the division, the resulting #VALUE! error also makes the test TRUE.
To turn the test into a message, with the same A2 and B2 layout, use:
=IF(ISERROR(B2/A2),"Check inputs",B2/A2)
When A2 is 0 and B2 is 24, it returns “Check inputs”; when A2 is 6 and B2 is 24, it returns 4. This works, but it writes the division twice. For a straightforward replacement, IFERROR is usually simpler and easier to maintain.
Which errors do they detect or handle?
ISERROR returns TRUE for an error value, and IFERROR uses its fallback for an error from its first argument. This includes familiar errors such as #DIV/0!, #N/A, #NAME?, #NULL!, #NUM!, #REF!, and #VALUE!. Microsoft 365 can also produce newer errors, such as #SPILL! or #CALC!, and these functions can handle or test errors produced by supported formulas.
Neither function diagnoses the underlying problem. If a formula points to a deleted cell, uses an invalid function name, or attempts an impossible calculation, ISERROR can flag the resulting error and IFERROR can replace it, but neither repairs the reference, spelling, or calculation. A clean-looking fallback is not proof that the calculation is correct.
Be especially careful with lookup formulas. A lookup returning #N/A may mean that a key was not found, but a different error could point to a broken reference or another issue. IFERROR will treat both as errors. If your intended fallback is specifically for a missing lookup match, a narrower function such as IFNA may communicate your intention more accurately.
Practical examples: calculations and lookups
Suppose A2 contains a quantity and B2 contains a total amount. To calculate a unit amount, divide B2 by A2. With the total in B2 and the quantity in A2, and with A2 equal to zero, this formula returns “Check quantity”:
=IFERROR(B2/A2,"Check quantity")
This can be appropriate when a zero quantity is an expected condition in the worksheet and the message gives the reader a useful next step. If zero should never occur, however, consider correcting the input or showing a clearly visible warning rather than making the issue disappear behind a generic blank.
For a lookup example, assume the lookup key is in E2, the keys are in A2:A100, and the return values are in C2:C100. This VLOOKUP searches the first column of A2:C100 and returns the third column; if E2 is absent, it returns “Not found”:
=IFERROR(VLOOKUP(E2,$A$2:$C$100,3,FALSE),"Not found")
That formula also substitutes “Not found” for other errors in the lookup expression, not only a missing key. If you want to replace only #N/A, with the same cell layout, use:
=IFNA(VLOOKUP(E2,$A$2:$C$100,3,FALSE),"Not found")
For example, if E2 contains a key that is not in A2:A100, the IFNA formula returns “Not found.” If the formula instead has a different error, IFNA leaves that error visible, making it easier to investigate. In Microsoft 365, XLOOKUP also has an optional argument for a value to return when no match is found, which can avoid wrapping the lookup in an error handler.
Choosing the right function
Choose based on what you want the formula to do, not simply on which function name seems more familiar. These are useful decision points:
- Use IFERROR when a formula’s error should be replaced with a deliberate result, such as a readable message or an agreed display value.
- Use ISERROR when you need a TRUE/FALSE test, such as deciding whether to show a warning, take a different calculation path, or flag a cell.
- Use IFNA when the intended fallback applies specifically to #N/A, often because a lookup has no match, and other errors should remain visible.
- Leave the error visible when it signals a problem that should be fixed rather than hidden. Errors can be useful clues while building or auditing a workbook.
With IFERROR, write a fallback that is meaningful to the people using the sheet. Returning 0 is not automatically safe: it may make a failed calculation look like a real zero and affect totals, averages, or decisions. Returning an empty text string can make a report look tidy, but it can also conceal missing data. A message such as “Check quantity” or “No match” often gives better context.
Common mistakes and troubleshooting
A frequent misconception is that ISERROR suppresses an error. It does not: ISERROR returns TRUE or FALSE as the result of its own test. To show a replacement, combine it with IF, or use IFERROR directly when a replacement is all you need.
Another common problem is wrapping an entire formula in IFERROR too early. If the formula contains a misspelled function, an incorrect cell reference, or a lookup that should have returned a match, a broad fallback can make the workbook appear to work while concealing the defect. During development, inspect the original error and check its cause before deciding whether it deserves a fallback.
Also distinguish between a blank cell and an error. ISERROR returns FALSE for an ordinary blank, and IFERROR does not treat a blank as an error. If your logic needs to identify blanks, use a blank test such as ISBLANK or a comparison with an empty string, depending on what the cells contain. Those tests answer a different question from “is this an error?”
Finally, remember that a formula can return text that looks like an error without returning an actual Excel error. For instance, a cell containing the typed text “#N/A” is text, not necessarily the #N/A error value. ISERROR tests the value’s type and result, not whether the visible characters resemble an error label.
Using ISERROR to flag cells
ISERROR can help identify error-containing cells rather than changing their displayed values. In Microsoft 365 for Windows, select the cells to check, then choose Home > Conditional Formatting > New Rule > Use a formula to determine which cells to format. With A2 as the top-left cell of the selected range, enter this rule formula:
=ISERROR(A2)
Choose a format, such as a fill color, and confirm the rule. The relative reference A2 lets Excel evaluate the corresponding cell across the selected range. This highlights errors while leaving their original values and formulas intact, which is often preferable during checking. On Mac, the Conditional Formatting options are also available from the Home tab, though the dialog presentation can differ by Excel version.
Frequently Asked Questions
Is IFERROR the same as ISERROR?
No. IFERROR returns the original result when it succeeds and a fallback when it errors. ISERROR returns TRUE or FALSE to report whether its argument is an error.
Does ISERROR fix or hide an Excel error?
No. It tests for an error and returns a logical value; it does not repair the formula or replace the original result. Use IFERROR for a replacement, or investigate and correct the cause.
Does IFERROR catch #N/A?
Yes. #N/A is an error, so IFERROR uses its fallback when its first argument returns #N/A. If you want to handle #N/A but leave other errors visible, use IFNA instead.
Should I use IFERROR or IFNA for a lookup?
Use IFNA when the fallback is meant only for a missing match. Use IFERROR if you deliberately want the same fallback for any error from the lookup expression, while recognizing that this can mask other problems.
Can ISERROR check a cell without changing it?
Yes. A formula such as ISERROR(A2) returns TRUE if A2 contains an error and FALSE otherwise. You can use the test in another formula or as a conditional-formatting rule to flag errors without replacing their contents.
Related
- Microsoft Excel Goal Seek: How It Works and How to Use It
- Microsoft Excel Group Rows: How It Works and When to Use It
- Microsoft Excel Corrupt File? How to Repair It
Try it: the Formula Explainer: paste any formula and see each function and reference in plain English.
More in Formulas & functions
- Excel Data Table Cheat Sheet: What-If Analysis GuideAn Excel Data Table is a What-If Analysis tool that recalculates a formula for different values in one…
- SUMIF Formula Criteria Examples for Excel: Rules and TipsUse Excel’s SUMIF function to add values that match one condition, such as a product name, a minimum…
- Excel Time Difference in Minutes: Formulas and TipsTo calculate the minutes between a start time in A2 and an end time in B2, enter =(B2-A2)*1440…
- Microsoft 365 XLOOKUP Examples for Everyday Excel TasksIn Microsoft 365, XLOOKUP finds a value in one range and returns the corresponding value from another: use…
- Nested IF Statements in Excel: Examples, Limits, and TipsNested IF statements in Excel put one IF function inside another, letting a formula choose among several outcomes.…
- Filter Excel by Highlighted CellsYes. In Excel for Microsoft 365 on Windows, open the filter arrow in the column containing the highlighted…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.