Sub topic 12
When IFERROR Hides Real Problems
Assume you can enter formulas, use cell references and ranges, compare values with operators such as >=, and write basic IF formulas. This chapter focuses on diagnosing errors before deciding whether to hide them.
The risk of a broad fallback
IFERROR evaluates a formula and returns a fallback value if that formula produces any error:
=IFERROR(C2/D2,0)If D2 is zero, the division produces #DIV/0!, so the formula returns 0. That is useful when zero is a meaningful result. However, the same formula also returns 0 if the formula contains a broken reference, an invalid value, or an unknown function.
For example:
=IFERROR(VLOOKUP(A2,Prices!A:B,2,FALSE),0)This formula returns 0 when the item is missing. It also returns 0 if the Prices sheet was renamed, the lookup range was damaged, or the column index is invalid. Those problems need different fixes, but the fallback makes them look identical.
| Error | Common meaning | Should it always be hidden? |
|---|---|---|
| `#N/A` | No matching value was found | Usually no, unless “not found” is expected |
| `#DIV/0!` | A formula divided by zero or a blank | Only when that case is expected |
| `#VALUE!` | A value has the wrong type | Usually no |
| `#REF!` | A reference no longer exists | No |
| `#NAME?` | A function or name is not recognized | No |
| `#NUM!` | A number is invalid or outside a function’s limits | Usually no |
Trace the error before hiding it
Use this decision path when a formula fails:
First inspect the underlying formula without IFERROR. Check the referenced cells, sheet names, ranges, and function arguments. Test the formula with a known valid input. If the error comes from a data-entry condition that your design expects, then a fallback is appropriate.
A clear fallback is usually better than a misleading number:
=IFERROR(C2/D2,"No denominator")Returning text can affect later calculations, so use it when the result is meant for display. If the result must remain numeric, consider correcting the input or handling the expected zero case explicitly:
=IF(D2=0,"",C2/D2)This formula handles the known zero case while allowing other errors to remain visible.
Prefer IFNA for missing matches
IFNA catches only the #N/A error. This makes it safer for lookup formulas:
=IFNA(VLOOKUP(A2,Prices!A:B,2,FALSE),"Not found")A missing item displays Not found. A broken range still displays #REF!, so the spreadsheet reveals a structural problem instead of silently producing a normal-looking result.
Use IFNA when “no match” is an expected outcome. Use IFERROR only when several error types are expected and the same fallback is correct for all of them.
> callout warning > Do not use IFERROR(formula,"") as a general cleanup step. A blank cell can hide a broken reference, invalid input, or misspelled function for a long time.
Combine branching with controlled handling
You can combine IFS with IFERROR, but keep the error boundary as narrow as possible:
=IFERROR(
IFS(
B2>=90,"A",
B2>=80,"B",
B2>=70,"C",
TRUE,"F"
),
"Check score"
)This is useful when a score might be blank or non-numeric. The TRUE branch handles valid scores below 70. The outer IFERROR handles unexpected input errors and gives the user a clear message.
You can use the same idea with SWITCH:
=IFERROR(
SWITCH(A2,"NY","New York","CA","California","TX","Texas","Unknown"),
"Check code"
)Here, "Unknown" handles a valid code that is not listed. "Check code" handles a formula error, such as a problem evaluating A2. Keeping those two cases separate helps you diagnose data quality.
Practical rule
Use a fallback only when you can name the condition it represents. Choose IFNA for an expected missing match. Choose IFERROR for several expected error types. Otherwise, leave the error visible until you fix its cause.
Exercise
A lookup should display "Not found" when there is no match, but should still reveal a broken range. Which function should you use?
Show answer
Use IFNA, such as =IFNA(VLOOKUP(A2,Prices!A:B,2,FALSE),"Not found"), because it catches only #N/A.