Sub topic 3
How Replacement Values Affect Totals and Other Formulas
Assume you can enter formulas, use cell references, and apply IF with VLOOKUP or another lookup function. An error handler changes the value that downstream formulas receive, so the replacement choice affects both results and meaning.
Replacement values and downstream formulas
Suppose B2 contains a quantity and C2 contains a price:
=IFERROR(B2*C2, 0)A replacement of 0 allows SUM to calculate normally. It also treats a failed calculation as zero, which may understate totals.
=IFERROR(B2*C2, "")An empty string looks blank, but it is text returned by a formula. SUM generally ignores it, while some functions or comparisons may treat it differently from a truly empty cell.
=IFERROR(B2*C2, "Check row")A message is useful for review, but arithmetic formulas may return another error when they encounter that text.
When error handling hides real problems
IFERROR catches every Excel error, including #REF!, #VALUE!, and #NAME?. A misspelled range or damaged reference can therefore look like valid zero data. Use a narrower handler when you know the expected failure.
=IF(B2=0, "", A2/B2)This handles only a zero divisor. Other errors remain visible.
Preventing errors with explicit checks
Use ISNA to test specifically for #N/A, or ISERROR to test for any error:
=IF(ISNA(MATCH(E2, $A$2:$A$100, 0)), "Missing", "Found")The check makes the intended condition clear before you replace a result.
Chaining fallback lookups
IFNA can search a second sheet only when the first lookup has no match:
=IFNA(VLOOKUP(E2, Sheet1!$A$2:$B$100, 2, FALSE),
IFNA(VLOOKUP(E2, Sheet2!$A$2:$B$100, 2, FALSE), "Not found"))This preserves other errors, such as an invalid range reference.
Built-in handling with XLOOKUP
XLOOKUP has an if_not_found argument, so a separate error function is unnecessary:
=XLOOKUP(E2, $A$2:$A$100, $B$2:$B$100, "Not found")This handles a missing match while leaving unrelated formula errors visible.
Exercise
Which replacement is safest when a missing lookup should be reviewed rather than counted as zero?
Show answer
Use a message such as "Not found", or use a blank if the surrounding workflow explicitly treats blanks as missing.