IFERROR shows a value you choose when a formula returns an error, and otherwise shows the formula’s normal result. It’s useful in reports and templates, but it can also hide real problems. This guide covers how to use it, when hiding errors helps, and when it works against you.
How IFERROR works
=IFERROR(value, value_if_error) returns the first value when the formula works. If the formula returns any error, it returns the second value instead. IFERROR was added in Excel 2007.
For example, =IFERROR(B2/C2,"") shows a blank when C2 is zero or empty.
Use IFNA when you only mean #N/A
IFNA works like IFERROR but only catches #N/A. It was added in Excel 2013. Here’s an example:
=IFNA(VLOOKUP(A2,Prices!A:B,2,FALSE),"Not in list")
If the formula has a different problem, such as #REF! from a deleted column, the error still shows. That’s usually what you want from a lookup, because only a missing match gets the friendly message.
When hiding an error helps
- A blank is the correct answer. If an empty input is normal, such as an unused row in a template, a blank output is the honest result.
- A lookup can legitimately miss. If some items shouldn’t be in a list, a label such as “Not in list” is clearer than an error code.
- You’re presenting results. A summary meant for others can be easier to read without error codes, once you’ve confirmed the formulas are correct.
When hiding an error causes trouble
- Typos get hidden. If the name in
=IFERROR(SUM(Sales),0)is misspelled, the formula returns 0 and nothing looks wrong. This is the main risk. - Totals look complete. A zero for a missing value can make a total look finished when data is actually missing.
- Blanks break later formulas. A
""result is text. Arithmetic on it returns#VALUE!. - Nested wrappers hide the cause. Several IFERRORs in a row make it hard to find the real problem.
Tools for checking without hiding
- ISERROR returns TRUE for any error. ISNA returns TRUE only for
#N/A. ISERR returns TRUE for any error except#N/A. - Conditional formatting. To highlight errors without hiding them, use a formula rule such as
=ISERROR(A2). How to use conditional formatting with formula in excel covers the setup. - Evaluate Formula shows the step that fails, which is often quicker than wrapping the formula.
Choosing what to show
""looks blank but is text. It’s fine for display, but it can break later calculations.0is a number. It works for totals, but it can look like real data.- A short message such as “Not in list” tells the reader why. It works best for lookups.
Pick the one that matches what a blank means in your sheet.
Google Sheets
Google Sheets has IFERROR and IFNA with the same syntax, so these patterns work there too.