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.

Making Your Worksheets Error-Free 32<br />

Pay Attention to the Colors<br />

When you edit a cell that contains a formula, Excel color-codes the cell and range references in the formula.<br />

Excel also outlines the cells and ranges used in the formula by using corresponding colors.<br />

Therefore, you can see at a glance the cells that are used in the formula.<br />

You also can manipulate the colored outline to change the cell or range reference. To change the references<br />

that are used in a formula, drag the outline’s border or fill handle (at the lower-right corner of the outline). This<br />

technique is often easier than editing the formula.<br />

A common problem is using a relative reference when you should use an absolute reference. As shown in<br />

Figure 32.2, cell C1 contains a tax rate, which is used in the formulas in column C. The formula in cell C4 is<br />

=B4+(B4*$C$1)<br />

FIGURE 32.2<br />

Formulas in the range C4:C6 use an absolute reference to cell C1.<br />

Notice that the reference to cell C1 is an absolute reference. When the formula is copied to other cells in<br />

column C, the formula continues to refer to cell C1. If the reference to cell C1 were a relative reference, the<br />

copied formulas would return an incorrect result.<br />

Operator precedence problems<br />

Excel has some straightforward rules about the order in which mathematical operations are performed (see<br />

Chapter 11). When in doubt (or when you simply need to clarify your intentions), you should use parentheses<br />

to ensure that operations are performed in the correct order. For example, the following formula<br />

multiplies A1 by A2 and then adds 1 to the result. The multiplication is performed first because it has a<br />

higher order of precedence.<br />

= 1+A1*A2<br />

The following is a clearer version of this formula. The parentheses aren’t necessary, but in this case, the<br />

order of operations is perfectly obvious.<br />

=1+(A1*A2)<br />

557

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

Saved successfully!

Ooh no, something went wrong!