The IFERROR function evaluates a formula and returns a specified value if the formula generates an error. Otherwise, the function returns the result of the formula. In this guide, we’re going to show you how to use the IFERROR function and also go over some tips and error handling methods.
Supported Excel versions
- (Windows) Excel 2007 and above
- (Mac) Excel for Mac 2011 and above
- Web and mobile versions
Syntax
IFERROR(value, value_if_error)
Arguments
value |
The formula or the reference which is evaluated for an error. |
value_if_error |
The return value that if the formula evaluates to an error. |
Examples
In this example we’ve used named ranges to make the formulas easier to read. This is not required.
Example 1
=IFERROR(VLOOKUP(Search_Value,Table,2,0),”Not found”)
Example 2
=IFERROR(VLOOKUP(Search_Value_2,Table,2,0),”Not found”)
Example 3
=IFERROR(SUM(Total)/Divisor,IF(Divisor=0,”Divisor should not be 0″,”Please check the values in Total column”))
Tips
- The IFERROR checks for the following errors: #N/A, #VALUE!, #REF!, #DIV/0!, #NUM!, #NAME?, or #NULL!.
- If a reference cell is empty, the IFFERROR function treats it as an empty string (“”).
- You can also use the IFNA function to handle #N/A errors.
- You can use the ISERROR and the ISERR functions to detect errors without replacing them.