Excel IFERROR: Replace Formula Errors Safely
By Szabó Gergő · Updated
IFERROR returns a fallback when an expression produces any Excel error. It is useful at expected failure points, but broad error handling should not replace fixing incorrect source data or formulas.
Syntax and arguments
=IFERROR(value, value_if_error)- value
- The formula or expression Excel should evaluate.
- value_if_error
- The fallback returned for any error type.
IFERROR examples
Revenue is B2 and units are C2.
=IFERROR(B2/C2,0)If units are zero or invalid, the formula returns numeric zero.
A VLOOKUP may not find the ID in E2.
=IFERROR(VLOOKUP(E2,$A$2:$C$100,3,FALSE),"Not found")Users see a clear message instead of #N/A.
Dates or numeric inputs may not yet be present.
=IFERROR(DATEDIF(A2,B2,"m"),"")The result stays visually empty until valid dates are available.
Common mistakes
Wrapping an entire complex model
Apply IFERROR only around the operation expected to fail so unrelated errors remain visible.
Returning text where later formulas expect numbers
Use 0 or a blank deliberately, based on how downstream calculations should behave.
Using IFERROR only for missing lookups
IFNA is narrower and may be safer when you want other lookup errors to remain visible.
IFERROR FAQ
Which errors does IFERROR catch?
It catches #N/A, #VALUE!, #REF!, #DIV/0!, #NUM!, #NAME?, and #NULL!.
What is the difference between IFERROR and IFNA?
IFNA catches only #N/A. IFERROR catches every standard Excel error.
Can IFERROR return a blank?
Yes. Use two quotation marks as the fallback: =IFERROR(formula,"").