This makes IFERROR an elegant way to trap and manage errors in one step.
you’re able to use the IFERROR function to trap and handleerrorsproduced by other formulas or functions.
Example 1 - Trap #DIV/0!
error that comes up whenever the quantity field is empty or zero, and replaces it with zero.
You are free to change the zero (0) to suit your needs.
error and return an empty string, which looks like an blank cell.
error and remap it to the message “hey enter a value in B1”.
When a number is entered in B1, the formula will return the result of A1/B1.
For more details and alternatives, seeSum and ignore errors.
If no error is present, the result is returned normally.
IFERROR or IFNA?
TheIFERROR functionis useful, but it is a rather blunt instrument that will trap all kinds of errors.
For example, if a function is misspelled in a formula, Excel will return the #NAME?
error and IFERROR will catch that error too, and return an alternate result.
This can cause IFERROR to hide an important problem.
In most cases, it makes more sense to use theIFNA functionwith VLOOKUP instead of IFERROR.
Unlike IFERROR, IFNA only traps the #N/A error.
error
XLOOKUP without #N/A error
How to fix the #REF!
If no error #N/A error occurs the formula returns a normal result….