Sub topic 9
When error handling hides real problems
This chapter assumes you can enter and copy formulas, use relative and absolute references, and write a basic IF and VLOOKUP. It covers the main risk of IFERROR: it removes the warning sign along with the error.
Why masking is a risk
An error value is a signal. #REF! means a reference was deleted. #NAME? means a function name is misspelled. #DIV/0! means a divisor is empty or zero. When you wrap a formula in IFERROR, every one of these signals becomes the same replacement value. The sheet looks clean, and the cause is no longer visible.
IFERROR catches all seven error types. That is the problem. You usually expect only one of them.
=IFERROR(VLOOKUP(E2, $A$2:$B$100, 2, FALSE), 0)This formula is meant to return 0 when E2 is not in the list. But suppose someone deletes column B. The lookup now fails with #REF!, IFERROR catches it, and every row shows 0. The totals still add up, and they are wrong.
A masking example
Suppose the formula is misspelled as VLOOKP. Excel returns #NAME?. Without a handler you see the error at once and fix the typo. With IFERROR you see a column of zeros and may assume that no customer matched.
Use the narrowest handler
Match the handler to the failure you expect. For a lookup, the expected failure is a missing value, which is #N/A. IFNA handles only that case.
=IFNA(VLOOKUP(E2, $A$2:$B$100, 2, FALSE), "Not found")If the range is broken, #REF! still appears. You see the real problem, and the missing-value case is still handled.
| Situation | Handler | What stays visible |
|---|---|---|
| Lookup value may be missing | IFNA | `#REF!`, `#NAME?`, `#VALUE!` |
| Divisor may be zero | IF test on the divisor | `#VALUE!` from text, `#REF!` |
| Any failure is acceptable, such as a display-only cell | IFERROR | Nothing |
Test the condition instead
For division, check the cause directly. The formula below handles only a zero or empty divisor.
=IF(B2=0, "", A2/B2)If B2 contains text, the formula still returns #VALUE!, which is correct. Someone typed text into a numeric column, and you want to know that.
For lookups, ISNA with MATCH tests existence without catching other errors:
=IF(ISNA(MATCH(E2, $A$2:$A$100, 0)), "Missing", "Found")XLOOKUP has the same narrow behavior built in. Its fourth argument applies only when no match is found:
=XLOOKUP(E2, $A$2:$A$100, $B$2:$B$100, "Not found")Habits that reduce the risk
- Add error handling last, after the formula works on its own.
- Pick the narrowest handler that covers the failure you expect.
- Use a visible replacement, such as "Not found", where a blank or 0 could be mistaken for real data.
- Count the fallbacks. A cell such as
=COUNTIF(F2:F100, "Not found")shows how many lookups failed. A sudden jump means something changed. - Avoid IFERROR around a long formula. An error anywhere inside it is hidden, including parts you did not think about.
Exercise
A column uses =IFERROR(VLOOKUP(E2, $A$2:$B$100, 2, FALSE), 0). A colleague deletes column B, and every row now shows 0. Why did no error appear, and how would you rewrite the formula so this failure is visible while missing values still return 0?
Show answer
IFERROR catches every error type, so the #REF! from the deleted column was replaced with 0. Rewrite it with IFNA: =IFNA(VLOOKUP(E2, $A$2:$B$100, 2, FALSE), 0). Missing values (#N/A) still return 0, but #REF! now shows.
Exercise
You want =A2/B2 to return a blank only when B2 is zero or empty, but still show an error if B2 contains text. Which formula do you use, and why not IFERROR?
Show answer
Use =IF(B2=0, "", A2/B2). It tests only the zero-divisor case, so text in B2 still produces #VALUE!. IFERROR would turn that into a blank too and hide the bad data.