It is not uncommon to complete a spreadsheet model for expected values only to find that some user inputs  are not what you expected result in errors. Depending upon the details, you simply what to stop that error behaviour cropping up in your reporting – @JulianExcelTips.

To avoid complete re-modelling your spreadsheet, “IFERROR” can be used effectively to trap errors so they do not disrupt your entire model. With the formula “=IFERROR(F,G)”,  F is the computation you wanted to do and G is what you do if F gives an error.

G might a polite error message or value that avoids the annoyance of an error propagating through your model.

iferror examples

Watch this small illustration with a divide operation. You can see that when the first argument F is an error, the value from the second argument is used. If there is no error in the first argument, the second argument is ignored.

Of course if it just so happens that G gives an error it only shows when F is one too.

 

Share This