What is the IFERROR function?
=IFERROR(value, value_if_error)IFERROR calculates a formula and, if the result is any error (#DIV/0!, #N/A, #VALUE! and so on), returns a value you choose instead. If there is no error, the original result is returned unchanged.
It is commonly wrapped around divisions and lookups so that reports show a blank, 0 or a message instead of error codes.
Arguments
- value
- The formula to check, such as B2/C2 or a VLOOKUP.
- value_if_error
- What to return if value is an error. Use "" to show a blank.
IFERROR examples
Example 1. Avoid #DIV/0!
=IFERROR(B3/C3, 0)C3 is 0, so B3/C3 is #DIV/0!. IFERROR returns 0 instead.
Example 2. Message for a missing lookup
=IFERROR(VLOOKUP(F2, A2:D9, 3, FALSE), "Not found")If the code in F2 is not in the table, the cell shows "Not found" instead of #N/A.
Common mistakes
Hiding real problems
IFERROR hides every error, including typos in the formula. Build and check the formula first, then add IFERROR.
Returning text in a number column
A text fallback such as "Check" in a column you add up is skipped by SUM. Use 0 if the column is used in calculations.
FAQ
- What is the difference between IFERROR and IFNA?
- IFNA only catches #N/A. IFERROR catches every error type.