Introduced since Excel 2007, IFERROR() formula checks a formula (or expression) and returns the value of formula if there is no error, otherwise a custom formula.
Syntax:
=IFERROR (value, value_if_error)
The IFERROR function syntax has the following arguments:
- Value Required. The argument that is checked for an error.
- Value_if_error Required. The value to return if the formula evaluates to an error. The following error types are evaluated: #N/A, #VALUE!, #REF!, #DIV/0!, #NUM!, #NAME?, or #NULL!.
For eg:
=IFERROR(1/0,"Try splitting an atom instead!")
will give the message Try splitting an atom instead! because the expression 1/0 returns an error (DIV/0 error)
Where as,
=IFERROR(0/1,"Try splitting an atom instead!")
will give the value 0 since 0 divided by 1 is 0.
Please note that IFERROR is oblivious to the type of error. That means, no matter what the error is (DIV/0, #NAME, #N/A, #REF… etc.), IFERROR treats all of them equally and shows the same value. In other words, IFERROR is like “Catch all” in programming world.
Notes:
No comments:
Post a Comment