IFERROR in Google Sheets
IFERROR runs your formula and, if it errors, returns a fallback you choose instead of the red error text.
=IFERROR(A2/B2, 0)
Returns A2/B2 normally, but 0 if it would be a #DIV/0! (or any) error.
How it works
IFERROR takes two things: the value/formula to try, and the fallback to return if that value is any error (#N/A, #DIV/0!, #VALUE!, #REF!, and so on). If the formula works, you get its normal result; the fallback only appears on error.
Variations
Show blank instead of an error
=IFERROR(VLOOKUP(E2,A2:B100,2,0), "")
Empty quotes leave the cell looking blank.
Show custom text
=IFERROR(A2/B2, "Check divisor")
Catch only #N/A (not other errors)
=IFNA(VLOOKUP(E2,A2:B100,2,0), "Not found")
IFNA ignores only #N/A and lets real errors surface.
Examples
| Scenario | Formula |
|---|---|
| Blank a failed lookup | =IFERROR(XLOOKUP(E2,A:A,B:B), "") |
| Zero instead of divide-by-zero | =IFERROR(C2/D2, 0) |
FAQ
Does IFERROR hide real bugs?
It can — it masks every error type. If you only expect a missing lookup, IFNA is safer because it still shows genuine #VALUE!/#REF! problems.
What can the fallback be?
Any value: a number, text in quotes, a cell reference, or another formula.