IFERROR function
IFERROR returns the value that you specify if the expression is an error. Otherwise, returns the result of the expression.
Syntax
IFERROR(value,value_if_error)
- value is the argument that is checked for an error.
- value_if_error is the value to return if the expression evaluates to an error. The following error types are evaluated: #N/A, #VALUE!, #REF!, #DIV/0!, #NUM!, #NAME?, or #NULL!.
Note:
-
If value or value_if_error is an empty cell, IFERROR treats it as an empty string value ("").
- If value is an array formula, IFERROR returns an array of results for each cell in the range.
Example
- =IFERROR(A1/B1,"Calculation Error")
IFERROR checks for an error in the expression (divide A1 by B1). If no error, returns the results of the expression. Otherwise, display Calculation Error.
- =IFERROR({#N/A,3}, "error")
Checks for an error in the array formula{#N/A, 3}. It returns error in the cell.