
What is IFERROR in Excel?
IFERROR replaces an Excel formula error with a message or alternative value while keeping successful results unchanged.
IFERROR syntax
=IFERROR(value,value_if_error)
Practice dataset
Enter the following sample values in cells A1 onward. Keep text and numerical data types consistent.
| Numerator | Denominator | Formula result |
|---|---|---|
| 10 | 2 | 5 |
| 10 | 0 | #DIV/0! |
| 8 | 4 | 2 |
Example 1: Replace divide-by-zero errors
=IFERROR(A2/B2,"Not available")
Expected result: 5. With 10 in A2 and 2 in B2, division succeeds.
Example 2: Handle division by zero
=IFERROR(A3/B3,"Not available")
Expected result: Not available. B3 is 0, so the formula substitutes a message.
Example 3: Return zero instead of an error
=IFERROR(A3/B3,0)
Expected result: 0. Useful when a numerical fallback is appropriate.
Example 4: Handle a missing lookup
=IFERROR(VLOOKUP(E2,A2:C4,3,FALSE),"ID not found")
Expected result: ID not found when absent. Use only when you intend to mask any error in that lookup.
Common IFERROR mistakes
- IFERROR can hide real formula mistakes; investigate unexpected errors first.
- Use quotation marks around replacement text.
- IFERROR handles all common Excel errors; IFNA is narrower and handles #N/A only.
Practice exercises
Recreate the table in Excel, enter the formulas above and change one criterion or input cell. Check which rows qualify and confirm the result manually. Then intentionally enter a missing value to test error handling.
Frequently asked questions
Does IFERROR change a valid result?
No, it returns the original result whenever the expression does not produce an error.
What is the difference between IFERROR and IFNA?
IFNA catches only #N/A; IFERROR catches multiple error types.
Continue learning
Visit the Excel Functions module and our XLOOKUP tutorial for related guides.
External reference: Microsoft Support — IFERROR documentation.
