Using IFERROR in Excel to Suppress Errors
I've been using Excel for years but I never knew about this one little formula that can save so much work. My predecessor has been using the ISERROR() function nested inside an IF() function to fill cells that return an error code as blank. This means if you have two columns of data that may not necessarily be filled, you can have a blank cell instead of #DIV/0, etc. A little tweak like this can improve readability quickly so you can quickly spot empty cells or not have to wade through errors if the cell isn't meant to have any data in it.
The code for a nested ISERROR() is as follows:
=IF(ISERROR(Evaluation), ValueTrue, ValueFalse)
This checks if the evaluation returns an error and reports the presence of an error as a True/False response. If the response is True, the cell is filled with ValueTrue otherwise it is filled with ValueFalse. This is fairly simple until you start putting another function in place of ValueFalse because you want to show the functions's output in the cell. For example, =A1/A2
=IF(ISERROR(A1/A2),"",A1/A2)
This will check if you can divide cell A1 by cell A2. If you can't and it returns as True due to an error such as #DIV/0 (Divide by Zero) then it will display nothing (represented as two quotation marks together "" in the ValueFalse argument ). Otherwise it will calculate A1 by A2 a second time and put the results into the cell. This can become a headache if you have a complex and mammoth sized formula instead of a simple statement, such as VLOOKUP.
Cue IFERROR() which will condense the size and complexity of the formula significantly.
=IFERROR(Evaluation, ValueErr)
This will check the evaluation and, if it spots an error, places the contents of ValueErr into the cell. Otherwise it shows the result of the evaluation. So if we apply this to our earlier example:
=IFERROR(A1/A2,"")
If an error is discovered, nothing will be placed into the cell as ValueTrue contains "". Otherwise the value of A1 divided by A2 is placed into the cell. This cuts down on having to repeat a complex formula twice in one cell to reduce the risk of error and save Excel a bit of legwork on an especially large sheet.
Note that this formula doesn't work in older format Excel sheets, hence my predecessor's creative use of ISERROR() as IFERROR() wasn't around at the time.
Edited by CAM

0 Comments
Recommended Comments
There are no comments to display.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now