Excel Function: IFERROR

The Excel IFERROR function checks if the input value is an error, it then returns this same value if there is no error or another defined value in case of error.

Usage:

=IFERROR(value, value_if_error)


Practical case

Let's take the example of the VLOOKUP function which displays the number of points based on the entered case number:

excel vlookup function iferror

The problem in this case is that an error will be displayed if no result is found:

excel vlookup function error iferror

Without the IFERROR function, you would need to use the IF function as well as another function to test if the VLOOKUP function returns an error and return the result of the VLOOKUP function if everything is fine or another value in case of error:

=IF(ISERROR(VLOOKUP(E2,A2:C11,3,FALSE)),"-",VLOOKUP(E2,A2:C11,3,FALSE))

The formula is therefore unnecessarily long and the VLOOKUP function is present twice...

The IFERROR function simplifies all this by testing a value and directly returning this same value if there is no error (or another in case of error):

=IFERROR(VLOOKUP(E2,A2:C11,3,FALSE),"-")

excel vlookup iferror

If needed, you can download the Excel file used here: iferror.xlsx