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.

Introducing Formulas and Functions 11<br />

FIGURE 11.19<br />

Use the Apply Names dialog box to replace cell or range references with defined names.<br />

Tips for Working with Formulas<br />

In this section, I offer a few additional tips and pointers relevant to formulas.<br />

Don’t hard-code values<br />

When you create a formula, think twice before you use any specific value in the formula. For example, if<br />

your formula calculates sales tax (which is 6.5 percent), you may be tempted to enter a formula, such as the<br />

following:<br />

+A1*.065<br />

A better approach is to insert the sales tax rate in a cell — and use the cell reference. Or you can define the<br />

tax rate as a named constant, using the technique presented earlier in this chapter. Doing so makes modifying<br />

and maintaining your worksheet easier. For example, if the sales tax rate changed to 6.75 percent, you<br />

would have to modify every formula that used the old value. If you store the tax rate in a cell, however, you<br />

simply change that one cell — and Excel updates all the formulas.<br />

Using the Formula bar as a calculator<br />

If you simply need to perform a calculation, you can use the Formula bar as a calculator. For example, enter<br />

the following formula — but don’t press Enter:<br />

=(145*1.05)/12<br />

If you press Enter, Excel enters the formula into the cell. But because this formula always returns the same<br />

result, you may prefer to store the formula’s result rather than the formula itself. To do so, press F9 — and<br />

watch the result appear in the Formula bar. Press Enter to store the result in the active cell. (This technique<br />

also works if the formula uses cell references or worksheet functions.)<br />

203

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

Saved successfully!

Ooh no, something went wrong!