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

Using Advanced Naming Techniques<br />

Using range names can make your formulas easier to understand, easier to modify, and even help prevent<br />

errors. It’s much easier to deal with a meaningful name such as AnnualSales than with a range reference<br />

such as AB12:AB68.<br />

CROSS-REF<br />

See Chapter 5 for basic information regarding working with names.<br />

Excel offers a number of advanced techniques that make using names even more useful. I discuss these<br />

techniques in the sections that follow.<br />

Using names for constants<br />

Many Excel users don’t realize that you can give a name to an item that doesn’t appear in a cell. For example,<br />

if formulas in your worksheet use a sales-tax rate, you would probably insert the tax-rate value into a<br />

cell and use this cell reference in your formulas. To make things easier, you would probably also name this<br />

cell something similar to SalesTax.<br />

Here’s how to provide a name for a value that doesn’t appear in a cell:<br />

1. Choose Formulas ➪ Defined Names ➪ Define Name. Excel displays the New Name dialog<br />

box.<br />

2. Enter the name (in this case, SalesTax) into the field labeled Name.<br />

3. Select a scope in which the name will be valid (either the entire workbook or a specific<br />

worksheet).<br />

4. Click the Refers To box, delete its contents, and replace the old contents with a value (such<br />

as .075).<br />

5. Use the Comment box to provide a comment about the name (optional).<br />

6. Click OK to close the New Name dialog box and create the name.<br />

You just created a name that refers to a constant rather than a cell or range. Now if you type =SalesTax into<br />

a cell that’s within the scope of the name, this simple formula returns 0.075 — the constant that you<br />

defined. You also can use this constant in a formula, such as =A1*SalesTax.<br />

TIP<br />

A constant also can be text. For example, you can define a constant for your company’s name.<br />

Named constants don’t appear in the Name box or in the Go To dialog box. This makes sense<br />

because these constants don’t reside anywhere tangible. They do appear in the drop-down list<br />

that’s displayed when you enter a formula — which is handy because you use these names in formulas.<br />

NOTE<br />

Using names for formulas<br />

Just as you can create a named constant, you can also create named formulas. As with named constants,<br />

named formulas don’t appear in the worksheet.<br />

You create named formulas the same way you create named constants — by using the New Name dialog<br />

box. For example, you might create a named formula that calculates the monthly interest rate from an<br />

annual rate; Figure 11.16 shows an example. In this case, the name MonthlyRate refers to the following<br />

formula:<br />

=Sheet1!$B$1/12<br />

199

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

Saved successfully!

Ooh no, something went wrong!