JMWINCDevelopers

Tutorials & Guides

IFERROR: hide errors without hiding problems

A single #N/A or #DIV/0! makes a finished report look broken. IFERROR catches those and shows a blank or a plain-English message instead — as long as you use it carefully.

The formula

=IFERROR(your_formula, "")

If your_formula returns an error, you get the second argument (here, an empty string); otherwise you get the normal result. Use a message when a blank would be confusing:

=IFERROR(XLOOKUP(A2, IDs, Names), "Not found")

The trap: don't hide real problems

IFERROR swallows every error, including ones that mean something is genuinely wrong — a broken reference, a bad range, a typo in a function name. If you wrap a whole complex formula in IFERROR and blank the result, you can hide a bug that's quietly producing wrong numbers elsewhere. Two habits keep you safe:

IFERROR vs IFNA

If the only error you want to catch is "no match," use IFNA instead — it traps #N/A only and lets other errors show through, which is usually what you actually want around a lookup.

Clean lookups start with clean data — see TRIM/CLEAN and XLOOKUP.