Beginner Logical Function

IFERROR Function in Google Sheets

Learn how to use the IFERROR function in Google Sheets to catch errors and return a fallback value instead of displaying error messages.

Syntax
IFERROR(value, [value_if_error])

The IFERROR function in Google Sheets evaluates an expression and returns its result when there is no error. When the expression produces any error (#N/A, #DIV/0!, #REF!, #VALUE!, or others), IFERROR returns a fallback value instead.

You wrap formulas in IFERROR when errors are expected and acceptable. VLOOKUP that might not find a match, division where the denominator could be zero, IMPORTRANGE pulling from a sheet that might be disconnected — IFERROR keeps your sheet clean in all of these cases.

Syntax

=IFERROR(value, [value_if_error])

Parameters

ParameterRequiredDescription
valueYesThe expression to evaluate. This is typically a formula that might produce an error.
value_if_errorNoThe value returned if the expression produces an error. If omitted, IFERROR returns an empty string.

IFERROR catches every error type. It does not distinguish between #N/A and #DIV/0!. If you need to handle specific error types differently, use ERROR.TYPE inside an IF formula instead.

Examples

Wrap VLOOKUP to handle #N/A

Look up a product name in A2 and return “Not found” when there is no match:

=IFERROR(VLOOKUP(A2, Products!A:C, 3, FALSE), "Not found")

If A2 contains “SKU-999” and that value does not exist in the Products sheet, this returns “Not found” instead of #N/A.

Wrap division to handle #DIV/0!

Calculate revenue per employee where the employee count in B2 could be zero:

=IFERROR(A2/B2, 0)

If B2 is 0, this returns 0 instead of #DIV/0!. If B2 is 5 and A2 is 50000, it returns 10000 as expected.

Return a blank cell on error

When you want the cell to appear empty rather than show an error or a message:

=IFERROR(INDEX(A2:A100, MATCH(D2, B2:B100, 0)))

With no second argument, IFERROR returns an empty string when the MATCH formula does not find D2 in the range. The cell appears blank.

Common Errors

Masking real errors IFERROR catches every error type without distinction. If your formula has a typo that produces #REF! or a broken range reference that produces #VALUE!, IFERROR hides it behind your fallback value. You will not know something is wrong.

Use IFERROR only when you expect a specific error and have a valid reason to suppress it. Wrapping every formula in IFERROR as a habit makes debugging harder, because legitimate problems become invisible.

Returning an error inside IFERROR If your fallback value itself produces an error, IFERROR does not catch it. The fallback expression is only evaluated when the first argument errors, and any error in the fallback passes through to the cell.

Tips

When wrapping VLOOKUP, consider whether #N/A is truly an error or a signal that your data is incomplete. A missing lookup value might mean you need to add it to your source table rather than hide the error.

If you need different handling for different error types (for instance, “Not found” for #N/A but “Check formula” for #VALUE!), combine IF with ERROR.TYPE instead of using IFERROR:

=IF(ISERROR(A2/B2), IF(ERROR.TYPE(A2/B2)=2, "Division by zero", "Other error"), A2/B2)

This gives you fine-grained control that IFERROR alone cannot provide.

Want to go deeper?

Check out our full tutorials for step-by-step examples and real-world use cases.

Published February 19, 2026