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

Taught hands-on in Level 3: Intermediate Lookups & Data Summaries - Errors & Error Handling module

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

=IFERROR(value, value_if_error) Explain

Arguments

ArgumentRequired?What it does
valueYesThe formula or value to check.
value_if_errorYesWhat 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.

D2fx=IFERROR(B2/C2, 0)
ABCD
1ProductRevenueUnitsPer unit
2Widget12004030
3Gadget000
4Gizmo9004520
5Sprocket50000
=IFERROR(B2/C2, 0) Explain

Example 2 — A clean lookup message

Show "Not found" when a code isn't in the price list.

=IFERROR(VLOOKUP(E2, A2:B50, 2, FALSE), "Not found") Explain
This also hides a typo in the range or a deleted column. =IFNA(…) only catches the “not found” case, so real mistakes still show.

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

Kyle Stott

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.