Monday, July 1, 2013

Excel: IFERROR(logical_statement, value_if_error)

=IFERROR(1/0, "N/A")

What I like about this function is that I do not need to repeat the formula for logical_statement again. This has not been a problem before because I was always ok with see #DIV/0! errors in my metrics. This usually meant that there was no data involved for that set.

Unfortunately, management liked the metrics that I produced and expanded on it. Eventually it got around and certain people didn't like seeing #DIV/0! error. I like to be efficient with my formulas, and I hated the idea of having to do an IF which required me to calculate the denominator if 0 then recalculate the denominator again to display the value.

This was quite a nuisance with large equations that depended on multiple cells and other formulas. I also wanted to avoid creating yet another column just for display purposes. Then I stumbled upon this excel function that simplified my life.

Basically, this function will display whatever value that I had originally intended but yet still allow me to default a different value if there is an error thus avoiding having to calculate twice.

No comments:

Post a Comment