Excel IFERROR Function (Friendly Error Fallback) – Examples & Practice
Practice the Excel IFERROR function online with an interactive grid, instant feedback, and clear formula help.
Instruction
Try VLOOKUP for code "P-999" in A2:C6; if it errors, return "Not found".
Formula Syntax
=IFERROR(value, value_if_error)
- value: The expression to evaluate.
- value_if_error: What to return if value produces an error.
What it does
IFERROR returns a custom result when a formula evaluates to an error; otherwise it returns the normal result. It makes dashboards and templates friendlier.
Excel IFERROR Function Examples
Safe divide
=IFERROR(A2/B2, 0)
Returns 0 when division fails.
Lookup fallback
=IFERROR(VLOOKUP("P-999", A2:C6, 3, FALSE), "Not found")
Returns text when lookup errors.
lookup-reference-table.xlsx
| A | B | C | |
|---|---|---|---|
| 1 | Code | Name | Price |
| 2 | P-101 | Mouse | 19 |
| 3 | P-102 | Keyboard | 45 |
| 4 | P-103 | Monitor | 199 |
| 5 | P-104 | USB Hub | 29 |
| 6 | P-105 | Headset | 59 |
| 7 | Output |
Input Formula
Need Help?
Tips
- Prefer IFNA when only #N/A should be caught.
- Keep fallbacks meaningful for readers.
- Avoid hiding errors you should fix upstream.
IFERROR Function Use Cases
- Polished dashboards without #N/A
- User-facing templates
- Missing data in imports
- Safer ratios and growth calcs
- Teaching defensive spreadsheet style
Common mistakes - IFERROR function not working
- Masking errors that should be fixed
- Using IFERROR when IFNA is safer for lookups
- Returning ambiguous fallbacks like 0 for both missing and true zero
- Wrapping entire mega-formulas (hard to debug)
- Forgetting to log exceptions in regulated workflows
FAQ
IFERROR vs IFNA?
IFERROR catches any error; IFNA only catches #N/A.
Will IFERROR hide real bugs?
Yes. Use it when errors are expected (like missing lookups), not to mask modeling mistakes.
Can value_if_error be a formula?
Yes, any expression can be returned as the fallback.
Does IFERROR slow workbooks?
Usually negligible; avoid wrapping huge ranges unnecessarily.
IFERROR vs ISERROR+IF?
IFERROR is shorter and clearer for the same pattern.
Comparison
| Function | Catches |
|---|---|
| IFERROR | Any error |
| IFNA | #N/A only |
| ISERROR | Testing only (with IF) |
Example
=IFERROR(1/0, "n/a")
Advanced examples
IFERROR + LET
Name the risky sub-expression with LET so fallbacks are easier to read and maintain.