Page 222 - Excel 2007 Bible
P. 222
16_044039 ch11.qxp 11/21/06 11:04 AM Page 179
Introducing Formulas and Functions
FIGURE 11.1
Excel’s Formula AutoCorrect feature often suggests a correction to an erroneous formula.
Excel lends a hand in helping you match parentheses. When the insertion point moves over a
TIP
TIP
parenthesis while you’re editing a cell, Excel momentarily bolds it — and does the same with
its matching parenthesis.
Using functions in your formulas
Most formulas you create use worksheet functions. These functions enable you to greatly enhance the
power of your formulas and perform calculations that are difficult (or even impossible) if you use only the
operators discussed previously. For example, you can use the TAN function to calculate the tangent of an
angle. You can’t do this calculation by using only the mathematical operators. 11
Examples of formulas that use functions
A worksheet function can simplify a formula significantly. To calculate the average of the values in 10 cells
(A1:A10) without using a function, you’d have to construct a formula like this:
=(A1+A2+A3+A4+A5+A6+A7+A8+A9+A10)/10
Not very pretty, is it? Even worse, you would need to edit this formula if you added another cell to the
range. Fortunately, you can replace this formula with a much simpler one that uses one of Excel’s built-in
worksheet functions:
=AVERAGE(A1:A10)
The following formula demonstrates how using a function can enable you to perform calculations that
would not be possible otherwise. If (for example) you need to determine the largest value in a range, a for-
mula can’t tell you the answer without using a function. Here’s a simple formula that returns the largest
value in the range A1:D100:
=MAX(A1:D100)
Functions also can sometimes eliminate manual editing. Assume that you have a worksheet that contains
1,000 names in cells A1:A1000, and all names appear in all-capital letters. Your boss sees the listing and
informs you that the names will be mail-merged with a form letter — so all uppercase is not acceptable; for
example, JOHN F. SMITH must appear as John F. Smith. You could spend the next several hours re-
entering the list — or you could use a formula such as the following, which uses a function to convert the
text in cell A1 to the proper case:
=PROPER(A1)
Enter this formula once in cell B1 and then copy it down to the next 999 rows. Then select B1:B1000 and
use Home ➪ Clipboard ➪ Copy to copy the range. Next, with B1:B1000 still selected, use Home ➪
Clipboard ➪ Paste Values to convert the formulas to values. Delete the original column, and you’ve just
accomplished several hours of work in less than a minute.
179