戰地連結︰ Home My Flickr NBA.com About

2008年10月6日星期一

Eliminate error messages with "IFERROR" in Excel 2007

Overview

In making dynamic Excel spreadsheet, sometimes we may have a function with result "#REF" or "#DIV/0". Some of these error messages are avoidable, but some of them aren't. In this case we have to conceal (hide) the error message. In Excel 2003 or before, we were using the "IF" function to check whether the function results in an error. However, this workaround is cumbersome and not efficient, because we have to put the function twice inside the "IF" statement.

Now in Excel 2007, we have a new function "IFERROR" designed to due with this particular situation. Let's see how we can benefit from it.

Reference

Eliminate those unfriendly error messages with Excel 2007’s IFERROR function

Step

The step is very simple, just replace your old "IF" function:

=IF(SOME_FUNCTION(),”Error Message”, SOME_FUNCTION())

with this one

=IFERROR(SOME_FUNCTION(),”Error Message”)

and you are good to go~

沒有留言: