Logical

IFERROR Formula

IFERROR catches any error in a formula and returns an alternative value instead. It wraps around formulas that might produce #N/A, #VALUE!, #DIV/0!, #REF!, or other errors, letting you show a friendly message, a default value, or a blank cell. It is most commonly used around VLOOKUP, division, and INDEX-MATCH formulas.

Syntax

IFERROR(value, value_if_error)
ParameterDescription
value Parameter of the IFERROR function.
value_if_error Parameter of the IFERROR function.
Try IFERROR in Viztab — free, no signup

Examples

Handle VLOOKUP not found

Formula
=IFERROR(VLOOKUP(A2, D:E, 2, FALSE), "Not Found")
Returns: the lookup result, or "Not Found" if the value does not exist in the lookup table

Prevent division by zero

Formula
=IFERROR(B2/C2, 0)
Returns: the result of the division, or 0 if C2 is zero (avoiding #DIV/0! error)

Return blank on error

Formula
=IFERROR(INDEX(B:B, MATCH(A2, C:C, 0)), "")
Returns: the matched value, or an empty string if no match is found

Common Errors

Hides real errors

IFERROR catches ALL errors, including ones that indicate real problems. Be specific with IFNA when you only want to catch #N/A.

Tips

Use IFNA for lookups

If you only want to handle "not found" errors, use IFNA instead. IFERROR can mask genuine formula errors you should fix.

Nested IFERROR for fallbacks

=IFERROR(VLOOKUP(A1,Table1,...), IFERROR(VLOOKUP(A1,Table2,...), "Not in either table")) tries a backup lookup.

Do not hide bugs

Avoid wrapping everything in IFERROR. Only use it where errors are expected, like lookups that legitimately might not find a match.

Try IFERROR in Viztab

Import your data and use IFERROR with 370+ other formulas. No signup required.

Open Viztab

Related Formulas