
Errors such as #N/A, #VALUE! or #DIV/0! in formulas spoil a report's appearance. IFERROR and IFNA show a result you choose when an error occurs. Used wrongly, though, they hide real problems. This guide explains both with examples. To understand error types see our Excel errors guide.
Syntax
| Function | Syntax | What it does |
|---|---|---|
| IFERROR | IFERROR(value, value_if_error) | Catches every kind of error |
| IFNA | IFNA(value, value_if_na) | Catches only #N/A |
Example: if VLOOKUP finds no value it gives #N/A; with IFNA you can show "Not found" (see our VLOOKUP guide).
Examples
- Division by zero: when calculating unit price, use IFERROR to show blank if the divisor is zero.
- Lookup results: show "No record" for records not found.
- Summary reports: show 0 or blank instead of the error to keep totals from breaking.
- 1
Find the cause of the error (data, reference, type)
- 2
Fix the cause if you can
- 3
If it is an expected case use IFNA
- 4
If you need a general safety net use IFERROR
- 5
Check the results
Which to choose?
| Situation | Suggestion |
|---|---|
| Lookup not found (expected) | IFNA |
| Chance of division by zero | IFERROR or check first with IF |
| Unknown error types | Investigate the error first |
Risks
- Hiding real errors: a wrong reference or typo becomes invisible.
- Misleading totals: putting 0 in place of an error affects totals.
- Performance: needless nesting in big tables can slow things down.
For debugging also see our formula not working guide.
Common mistakes
- Wrapping every formula in IFERROR.
- Not investigating the cause of the error.
- Writing 0 for an error and distorting totals.
- Using IFERROR instead of IFNA and hiding unexpected errors.
Frequently asked questions
How does IFERROR differ from IF? IF tests a condition; IFERROR checks whether there is an error.
What do I write to show blank? Put two double quotes in the second argument.
Summary
IFERROR and IFNA keep your reports tidy; but fix the cause of the error first and use the functions deliberately.
Serkan Akyürek is the founder and author of toolrota; he writes step-by-step guides on Excel, AI, the cloud, personal finance and digital security.