The Excel IFERROR function is used to handle errors in a formula. IFERROR will perform a specified action if the formula evaluates to an error, and display the formula result if not.
The IFERROR function is only available from Excel 2007.
The syntax for the IFERROR function is:
=IFERROR(value, value_if_error)
Argument | Purpose |
---|---|
value | The formula you are checking for an error |
value_if_error | The action to take if the formula evaluates to an error |
The example below shows the IFERROR function being used to return the text Product not found if the VLOOKUP function evaluates to an error message.
The VLOOKUP function is looking for C137, a product that does not exist. This would evaluate to a #N/A, but the IFERROR function detects the error and displays the required text instead.