Logiceasy
IFERROR()
Returns the first argument if it isn't an error; otherwise returns the second.
Syntax
fx
=IFERROR(value, [value_if_error])
Arguments
Example
fx
=IFERROR(A1/B1, 0)
Paste this into Google Sheets to run it. The live playground on this site covers 24 of the 61 functions, and IFERROR isn't one of them yet.
Common pitfalls
- Catches every error type indiscriminately. To handle only
#N/A, preferIFNAso you don't mask real bugs. - Omitting the second argument returns an empty string on error, which can hide silent failures during debugging.
- Don't pre-emptively wrap every formula: it makes errors invisible and harder to track down.
Related formulas
Used by
IF()
Returns one value if a condition is TRUE, another if FALSE.
IFNA()
Returns the first argument unless it is the #N/A error, in which case returns the second.
ISBLANK()
Returns TRUE if a cell is empty.
ISNUMBER()
Returns TRUE if a value is a number; useful for guarding numeric expressions.
ISTEXT()
Returns TRUE if a value is a text string.