18.11.2014 Views

Microsoft Office

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Part IV<br />

Using Advanced Excel Features<br />

Formulas returning an error<br />

A formula may return any of the following error values:<br />

n #DIV/0!<br />

n #N/A<br />

n #NAME?<br />

n #NULL!<br />

n #NUM!<br />

n #REF!<br />

n #VALUE!<br />

The following sections summarize possible problems that may cause these errors.<br />

TIP<br />

Excel allows you to choose how error values are printed. To access this feature, display the<br />

Page Setup dialog box and click the Sheet tab. You can choose to print error values as displayed<br />

(the default), or as blank cells, dashes, or #N/A. To display the Page Setup dialog box, click the dialog<br />

box launcher on the Page Layout ➪ Page Setup group.<br />

#DIV/0! errors<br />

Division by zero is not a valid operation. If you create a formula that attempts to divide by zero, Excel displays<br />

its familiar #DIV/0! error value.<br />

Because Excel considers a blank cell to be zero, you also get this error if your formula divides by a missing<br />

value. This problem is common when you create formulas for data that you haven’t entered yet, as shown in<br />

Figure 32.1. The formula in cell D2, which was copied to the cells below it, is<br />

=(C2-B2)/C2<br />

This formula calculates the percent change between the values in columns B and C. Data isn’t available for<br />

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 calculated<br />

value.<br />

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

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

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

Tracing Error Values<br />

O<br />

ften, an error in one cell is the result of an error in a precedent cell. For help in identifying the cell that<br />

is causing an error value to appear, activate the cell that contains the error and then use Formulas ➪<br />

Formula Auditing ➪ Error Checking ➪ Trace Error. Excel draws arrows to indicate which cell is the source of<br />

the error. When you’ve identified the error, use Formulas ➪ Formula Auditing ➪ Error Checking ➪ Remove<br />

Errors to get rid of the arrow display.<br />

554

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

Saved successfully!

Ooh no, something went wrong!