Formula Guide

The Excel IFERROR Function
explained simply

IFERROR catches formula errors and replaces them with a message you choose. Here is everything you need — syntax, 6 real examples, common mistakes and FAQ.

ExcelPro · 6 min read · Updated June 2026
Contents
  1. What does IFERROR do?
  2. Syntax
  3. Excel error types
  4. 6 real examples
  5. IFERROR vs IFNA
  6. Common mistakes
  7. FAQ

What does IFERROR do?

IFERROR catches formula errors and replaces them with a message or value you choose. Without it, errors like #N/A, #VALUE!, or #DIV/0! appear raw in your spreadsheet — confusing to anyone reading it. IFERROR makes your spreadsheets look professional and prevents errors from breaking downstream calculations.

It is one of the most commonly used wrapper formulas — you will find it around VLOOKUP, XLOOKUP, INDEX MATCH, and division formulas in virtually every professional spreadsheet.

Syntax

=IFERROR(value, value_if_error)
ArgumentDescription
value requiredThe formula to evaluate. IFERROR runs this first and checks whether it returns an error.
value_if_error requiredWhat to return if value produces any error. Can be text, a number, blank (""), or another formula.

Excel error types IFERROR catches

ErrorMeaningCommon cause
#N/AValue not foundVLOOKUP, XLOOKUP, MATCH can't find a match
#VALUE!Wrong data typeText where a number is expected
#DIV/0!Division by zeroDividing by an empty or zero cell
#REF!Invalid referenceDeleted cells that were referenced
#NAME?Formula name not recognisedTypo in a formula name
#NUM!Invalid numeric valueDATEDIF start > end, SQRT of negative
#NULL!Invalid intersectionIncorrect range operator
💡 IFERROR catches all of them

IFERROR handles every error type in one formula. If you only want to catch #N/A specifically (and let other errors show), use IFNA instead.

6 real examples

Example 1
Clean up VLOOKUP errors

The most common use — show a message instead of #N/A when a lookup fails.

=IFERROR(VLOOKUP(A2, PriceList!$A:$B, 2, 0), "Not found")
Example 2
Return blank instead of an error

Use "" to return an empty cell rather than any text — keeps the spreadsheet clean.

=IFERROR(VLOOKUP(A2, $C:$D, 2, 0), "")
Example 3
Prevent division by zero
=IFERROR(A2/B2, 0)

If B2 is zero or empty, return 0 instead of #DIV/0!. Useful for percentage calculations where the denominator might be missing.

Example 4
Wrap INDEX MATCH
=IFERROR(INDEX(B:B, MATCH(E2, A:A, 0)), "Not in list")
Example 5
Return a fallback calculation

The value_if_error can itself be a formula — try one calculation, fall back to another.

=IFERROR(A2/B2, AVERAGE(A:A))

If division fails, return the column average instead.

Example 6
Nested IFERROR for multiple fallbacks

Try XLOOKUP first, fall back to VLOOKUP, then to "Not found".

=IFERROR( XLOOKUP(A2, Sheet1!A:A, Sheet1!B:B), IFERROR(VLOOKUP(A2, Sheet2!A:B, 2, 0), "Not found") )

IFERROR vs IFNA — which to use?

FormulaCatchesUse when
IFERRORAll error typesYou want any error silenced
IFNA#N/A onlyYou want lookup failures silenced but other errors visible
💡 Best practice

For lookups, prefer IFNA over IFERROR. IFERROR hides all errors including genuine formula mistakes like wrong column numbers. IFNA only hides "not found" — so if you make a mistake in the formula itself, you'll still see the error.

Common mistakes

⚠️ IFERROR hiding real formula mistakes

If you have a typo in your VLOOKUP column number, IFERROR hides the #VALUE! error and you never find out. Build and test your inner formula first, then wrap with IFERROR once you're sure it's correct.

⚠️ Using IFERROR instead of fixing the data

IFERROR treats the symptom, not the cause. If your data has duplicates, extra spaces, or inconsistent formatting causing lookup failures, fix the data. Use IFERROR as a safety net, not a permanent solution.

FAQ

Does IFERROR slow down Excel?
Minimally. IFERROR evaluates the inner formula once and checks for an error — it does not double-calculate. On very large datasets the performance impact is negligible.
Can IFERROR return a number?
Yes. =IFERROR(A2/B2, 0) returns 0 (a number) when there is an error. The result is a real number that can be used in further calculations.
What is the difference between IFERROR and IF(ISERROR())?
They do the same thing but IFERROR is cleaner and faster. Before Excel 2007, IFERROR didn't exist and people used =IF(ISERROR(formula), value_if_error, formula). IFERROR is the modern replacement.
Can IFERROR return nothing (blank cell)?
Yes — use "" as the value_if_error: =IFERROR(VLOOKUP(A2,B:C,2,0),""). The cell will appear empty. Note: it contains a text string, so it will not be ignored by COUNT but will be ignored by SUM.

Practise IFERROR with real lookups

ExcelPro exercises use IFERROR alongside VLOOKUP, XLOOKUP and INDEX MATCH across all tracks. Free to start.

Try lookup exercises →

Related formulas

VLOOKUP XLOOKUP INDEX MATCH IF SUMIF IFS