I was going through several old posts and realized that I use the IFERROR functions frequently in Excel, but had never done a post about it. So here goes!
You can download the file here and follow along. If you get a preview, look for the download arrow in the upper right hand corner.
To see IFERROR in action, you can check out several previous blog posts where I used or referenced that function:
Here I have a simple data range and am using the INDEX/MATCH functions to pull out the sales for a particular salesperson and month:
If I enter a person’s name that does not exist on the list, or mis-type an entry, I will get an error:
Wrapping that formula in the IFERROR function is simple to do and eliminates those unsightly error messages. The syntax for IFERROR is:
Basically, it will generate the result of the formula if there is no error, and you can define what you want it to generate if there is an error. Often we just will insert double quotes (“”) for the value_if_error portion which results in a blank, like this:
Alternatively, you can insert a message to instruct the user if an erroneous entry is made:
And it’s that simple. This will allow you to keep your worksheets or dashboards looking cleaner, or can be used to instruct your user what to do if an error is entered.