IFERROR Function
The Excel IFERROR function returns a fallback when a formula produces an error and otherwise preserves the formula's normal result.
| Excel IFERROR Function | ||||||||
| IFERROR replaces an error with a clear fallback while preserving valid results. | ||||||||
| Source cases, editable | IFERROR examples | |||||||
| Scenario | Numerator | Denominator | Fallback | Data note | Example | Formula syntax | Result | |
| Valid division | 10 | 2 | Check denominator | Returns a number | Valid division | =IFERROR(B12/C12,D12) | 5.0 | |
| Zero denominator | 10 | 0 | Check denominator | Handles #DIV/0! | Zero denominator | =IFERROR(B13/C13,D13) | Check denominator | |
| Negative value | -15 | 3 | Check denominator | Valid negative result | Negative value | =IFERROR(B14/C14,D14) | -5.0 | |
| Zero numerator | 0 | 4 | Check denominator | Valid zero result | Zero numerator | =IFERROR(B15/C15,D15) | 0.0 | |
| Decimal result | 7 | 2 | Check denominator | Returns 3.5 | Decimal result | =IFERROR(B16/C16,D16) | 3.5 | |
| How IFERROR behaves | ||||||||
| IFERROR evaluates the first argument and returns it unchanged when no error occurs. | ||||||||
| The fallback is used for any Excel error, so apply it around the narrow expression you expect may fail. | ||||||||
| A valid zero or negative result is not an error and remains numeric. | ||||||||
| Reliability checks | ||||||||
| Valid division remains numeric and equals 5 | OK | |||||||
| Zero denominator returns the visible fallback text | OK | |||||||
Overview
The Excel IFERROR function evaluates an expression and replaces any resulting error with a controlled fallback. If the expression is valid—even when its result is zero, negative, or blank—IFERROR returns that result unchanged.
Quick reference
Syntax: =IFERROR(value, value_if_error)
Returns: The original result when valid, or value_if_error when an error occurs. (any)
Arguments:
value(required) — The value, reference, or formula to evaluate.value_if_error(required) — The value, text, blank string, reference, or formula returned when value produces an error.
Both arguments are required. The first is evaluated normally; the second is returned when that expression produces an Excel error.
Common uses
- Replace division errors with a message, blank, or defined numeric fallback.
- Handle expected missing lookup results.
- Prevent one source error from breaking a presentation output.
- Supply a controlled fallback for imported or incomplete data.
Calculations
IFERROR evaluates value first. A normal result passes through unchanged. If evaluation produces #N/A, #VALUE!, #REF!, #DIV/0!, #NUM!, #NAME?, or #NULL!, Excel returns value_if_error.
The fallback can be text, zero, an empty string, a cell reference, or another formula. Because IFERROR catches many error types, it can also hide defects such as misspelled functions or broken references. Keep its scope narrow and use IFNA when only a not-found lookup should be handled.
Function behavior
Situation | Behavior |
|---|---|
Valid number, including zero or negative | Returned unchanged. |
Valid text or blank result | Returned unchanged. |
Any standard Excel error | Replaced with |
Empty-string fallback | Appears blank but remains text. |
Array result | Applies element by element in array-aware Excel. |
Broadly wrapped formula | Can hide unrelated defects as well as expected errors. |
Common errors
Wrapping too much of a formula
What happens:
Broken references, misspelled names, and unrelated calculation defects are hidden behind the same fallback.
Better approach:
Wrap only the narrow expression expected to fail.
Replacing every error with zero
What happens:
Missing or invalid data becomes indistinguishable from a genuine zero.
Better approach:
Choose a fallback that preserves the business meaning and remains auditable.
Using IFERROR for a not-found lookup only
What happens:
Errors other than #N/A are also suppressed.
Better approach:
Use IFNA when only a missing key is an expected condition.
Example
Example 1 — Preserve a Valid Division
=IFERROR(B12/C12,D12)
With 10 divided by 2, the workbook returns the valid numeric result 5.
Example 2 — Replace Division by Zero
=IFERROR(B13/C13,D13)
When the denominator is zero, the division returns #DIV/0! and IFERROR displays Check denominator.
Example 3 — Display a Blank
=IFERROR(A1/B1,"")
An error is replaced by an empty string, which appears blank but is still a text result.
Example workbook
The workbook contains an IFERROR Example sheet with five editable numerator, denominator, and fallback cases. Live formulas demonstrate valid, zero-denominator, zero-numerator, and negative results, while two checks confirm valid division and fallback behavior. A Notes sheet summarizes error scope and alternatives.
Key takeaway
Use IFERROR for an expected failure with an intentional fallback, and keep its scope narrow enough that genuine formula defects remain visible.