IFERROR

Check a formula for errors. Return a fallback value when one occurs, or the formula result when it does not.

Logical
|
Excel 2007+
|
Google Sheets Supported

Spreadsheet editor

Syntax

=IFERROR(value, value_if_error) Returns: Varies

Arguments

Argument Required Description
value Yes The value or formula that you want to evaluate for potential errors.
value_if_error Yes The value to return if the first argument is an error.

About

IFERROR takes two arguments: a formula (or value) to evaluate and a fallback to return if that formula produces an error. It catches all standard Excel errors: #N/A, #VALUE!, #REF!, #DIV/0!, #NUM!, #NAME?, and #NULL!. When the formula returns a valid result, IFERROR passes it through unchanged.

The most common use is wrapping lookup formulas. A VLOOKUP that can't find its target returns #N/A, which then breaks any formula referencing that cell. Wrapping it in IFERROR lets you return a blank, a zero, or a label like "Not found" instead. The same applies to MATCH, division formulas, and any calculation that may fail on incomplete data.

If you only need to catch #N/A errors (like lookup misses), use IFNA instead. It leaves other errors visible, which helps catch real formula bugs. To identify which specific error type a cell contains, use ERROR.TYPE.

Examples

VLOOKUP without and with IFERROR

See what happens when a lookup finds no match. Try changing the search term in B6 to a product that isn't in the table. Without IFERROR you get #N/A. With IFERROR you get "Not found".

Spreadsheet editor

How the fallback value affects AVERAGE

Watch how returning 0 versus "" changes the team average. Beta's budget is 0, causing a #DIV/0! error. Notice that the 0 fallback in column D pulls the average down, while the "" fallback in column E skips the row entirely.

Spreadsheet editor

Clean imported data with IFERROR and VALUE

See how IFERROR handles a messy import where some cells contain text instead of numbers. Edit the values in column A and watch the cleaned column react. Non-numeric entries become blank so SUM still works.

Spreadsheet editor

Watch out for

Masking real formula errors

Wrapping every formula in IFERROR can hide errors caused by wrong references, typos in function names, or broken logic. Problems may go unnoticed until the results are clearly wrong.

Only use IFERROR where errors are expected, such as lookups that may find no match. Leave other formulas uncovered during development so errors are easy to spot.

Catching more errors than intended

IFERROR catches all error types. If your formula has a typo in a range reference, the resulting #REF! error is silently swallowed along with the #N/A misses you expected.

When you only expect #N/A errors (like lookup misses), use IFNA instead. It leaves other error types visible so formula mistakes don't go unnoticed.

Returning zero when you want blank

Using 0 as the fallback value includes those cells in SUM, AVERAGE, and COUNT calculations, which can distort totals when errors represent missing data rather than actual zeros.

Use "" (empty string) when you want a blank cell that doesn't affect calculations. Use 0 only when zero is the correct value for the error case.

Tips & notes

IFERROR works inside array formulas. When the value argument is a range or array formula, IFERROR evaluates each element individually and returns the fallback for any element that errors, passing through valid results for the rest.

Common questions

Does IFERROR catch all error types?

Yes. IFERROR handles #N/A, #VALUE!, #REF!, #DIV/0!, #NUM!, #NAME?, and #NULL!. If you only want to catch #N/A, use IFNA instead.

Can I return a blank cell with IFERROR?

Yes. Use "" as the value_if_error argument. The cell appears empty and is excluded from numeric calculations automatically.

What is the difference between IFERROR and IF with ISERROR?

Both produce the same result, but IFERROR is shorter and easier to read. The older approach =IF(ISERROR(formula), fallback, formula) requires writing the formula twice. IFERROR handles it in one step.

Does IFERROR work in Google Sheets?

Yes. The syntax and behavior are the same in Google Sheets.