11.08.2013 Views

Excel's Formula - sisman

Excel's Formula - sisman

Excel's Formula - sisman

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 21: Tools and Methods for Debugging <strong>Formula</strong>s 579<br />

Figure 21-2: #DIV/0! errors occur when the data in column C is missing.<br />

This formula calculates the percent change between the values in columns B and C. Data is not<br />

available for months beyond May, so the formula returns a #DIV/0! error.<br />

To avoid the error display, you can use an IF function to check for a blank cell in column C:<br />

=IF(C2=0,””,(C2–B2)/C2)<br />

This formula displays an empty string if cell C2 is blank or contains 0; otherwise, it displays the<br />

calculated value.<br />

Another approach is to use the IFERROR function to check for any error condition. The following<br />

formula, for example, displays an empty string if the formula results in any type of error:<br />

=IFERROR((C2–B2)/C2,””)<br />

IFERROR was introduced in Excel 2007. For compatibility with previous versions, use this formula:<br />

=IF(ISERROR((C2–B2)/C2),””,(C2–B2)/C2)<br />

#N/A errors<br />

The #N/A error occurs if any cell referenced by a formula displays #N/A.<br />

Some users like to enter =NA() or #N/A explicitly for missing data (that is, Not<br />

Available). This method makes it perfectly clear that the data is not available and hasn’t<br />

been deleted accidentally.<br />

The #N/A error also occurs when a lookup function (HLOOKUP, LOOKUP, MATCH, or VLOOKUP)<br />

can’t find a match.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!