toolrota

Excel IFERROR and IFNA: how to handle and hide error values the right way

#N/A and #DIV/0! errors spoil reports. We explain how to handle errors with IFERROR and IFNA and what to watch out for.

Serkan Akyürek··3 min read
Excel IFERROR and IFNA: how to handle and hide error values the right way – Excel

Errors such as #N/A, #VALUE! or #DIV/0! in formulas spoil a report's appearance. IFERROR and IFNA show a result you choose when an error occurs. Used wrongly, though, they hide real problems. This guide explains both with examples. To understand error types see our Excel errors guide.

Syntax

FunctionSyntaxWhat it does
IFERRORIFERROR(value, value_if_error)Catches every kind of error
IFNAIFNA(value, value_if_na)Catches only #N/A

Example: if VLOOKUP finds no value it gives #N/A; with IFNA you can show "Not found" (see our VLOOKUP guide).

Examples

  • Division by zero: when calculating unit price, use IFERROR to show blank if the divisor is zero.
  • Lookup results: show "No record" for records not found.
  • Summary reports: show 0 or blank instead of the error to keep totals from breaking.
The right order for error handling
  1. 1

    Find the cause of the error (data, reference, type)

  2. 2

    Fix the cause if you can

  3. 3

    If it is an expected case use IFNA

  4. 4

    If you need a general safety net use IFERROR

  5. 5

    Check the results

Which to choose?

SituationSuggestion
Lookup not found (expected)IFNA
Chance of division by zeroIFERROR or check first with IF
Unknown error typesInvestigate the error first

Risks

  • Hiding real errors: a wrong reference or typo becomes invisible.
  • Misleading totals: putting 0 in place of an error affects totals.
  • Performance: needless nesting in big tables can slow things down.

For debugging also see our formula not working guide.

Common mistakes

  1. Wrapping every formula in IFERROR.
  2. Not investigating the cause of the error.
  3. Writing 0 for an error and distorting totals.
  4. Using IFERROR instead of IFNA and hiding unexpected errors.

Frequently asked questions

How does IFERROR differ from IF? IF tests a condition; IFERROR checks whether there is an error.

What do I write to show blank? Put two double quotes in the second argument.

Summary

IFERROR and IFNA keep your reports tidy; but fix the cause of the error first and use the functions deliberately.

Share
Published:
Author
Serkan Akyürek

Serkan Akyürek is the founder and author of toolrota; he writes step-by-step guides on Excel, AI, the cloud, personal finance and digital security.