Excel 2019 Bible

(singke) #1

Part II: Working with Formulas and Functions


FIGURE 14.6
A cleaner report

=IFERROR(VLOOKUP(C3,$F$3:$G$11,2,FALSE),"")

The IFERROR function accepts a value or formula for its first argument and an alternate
return value for its second argument. When the first argument returns an error, the second
argument is returned. When the first argument is not an error, the results of the first argu-
ment are returned.

In this example, we’ve made our alternate return value an empty string (two double quotes
with nothing between them). That keeps the report nice and clean. But you could return
anything you want, such as “No info” or zero.

The IFERROR function checks for every error that Excel can return, including #N/A, #DIV/0!, and #VALUE. Note
that you can’t restrict which errors IFERROR catches.
Excel provides three other error trapping functions:

■ (^) ISERROR returns TRUE if its argument returns any error.
■ (^) ISERR returns TRUE if its argument returns any error except #N/A.
■ (^) ISNA returns TRUE if its argument returns #N/A and returns FALSE for anything else, including
other errors.
All of these error-trapping functions return TRUE or FALSE and are most commonly used with an IF function.

Free download pdf