IFERROR Function
Shows a friendly value instead of an error like #DIV/0! or #N/A.
Category
Logical
Available in
All versions, Microsoft 365
Returns
The formula's result, or your fallback if it errors
Overview
IFERROR wraps around a formula. If the formula works, you see its result. If it produces any error, you see the fallback you chose instead.
It keeps reports clean — but because it hides every error type, use it deliberately. For lookups, IFNA is often the safer choice.
Syntax
Arguments
| Argument | Required? | What it does |
|---|---|---|
| value | Yes | The formula or value to check. |
| value_if_error | Yes | What to return if value is an error — a number, text, "" for blank, or another formula. |
Examples
Example 1 — Avoiding #DIV/0!
Revenue per unit fails when nothing sold. Show 0 instead.
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Product | Revenue | Units | Per unit |
| 2 | Widget | 1200 | 40 | 30 |
| 3 | Gadget | 0 | 0 | 0 |
| 4 | Gizmo | 900 | 45 | 20 |
| 5 | Sprocket | 500 | 0 | 0 |
Example 2 — A clean lookup message
Show "Not found" when a code isn't in the price list.
Common mistakes
- Hiding real problems. A #REF! from a deleted column or a #NAME? from a typo is silently replaced. Build and test the formula first, then add IFERROR.
- Zeros skewing averages. Returning 0 for errors pulls AVERAGE down. Return "" instead so the cell is ignored.
Notes
- Catches #N/A, #VALUE!, #REF!, #DIV/0!, #NUM!, #NAME?, #NULL!, #SPILL! and #CALC!.
- Related functions: IFNA, ISERROR, XLOOKUP, AGGREGATE.

Author
Kyle Stott
Certified Microsoft Excel Expert
Kyle has worked professionally with Microsoft Excel for over a decade and has consulted on and taught Excel best practices to over 400 companies across 30+ countries.