Excel 2010 Bible

(National Geographic (Little) Kids) #1

Chapter 10: Introducing Formulas and Functions


199


This formula has four sets of parentheses — three sets are nested inside the fourth set. Excel evalu-
ates each nested set of parentheses and then sums the three results. This result is then multiplied
by the value in cell B6.

Although the preceding formula uses four sets of parentheses, only the outer set is really necessary.
If you understand operator precedence, it should be clear that you can rewrite this formula as:

=(B2*C2+B3*C3+B4*C4)*B6

But most would agree that using the extra parentheses makes the calculation much clearer.

Every left parenthesis, of course, must have a matching right parenthesis. If you have many levels
of nested parentheses, keeping them straight can sometimes be difficult. If the parentheses don’t
match, Excel displays a message explaining the problem — and won’t let you enter the formula.

Caution
In some cases, if your formula contains mismatched parentheses, Excel may propose a correction to your for-
mula. Figure 10.1 shows an example of the Formula AutoCorrect feature. You may be tempted simply to
accept the proposed correction, but be careful — in many cases, the proposed formula, although syntactically
correct, isn’t the formula you intended, and it will produce an incorrect result. n


FIGURE 10.1

The Excel Formula AutoCorrect feature sometimes suggests a syntactically correct formula, but not the
formula you had in mind.


Tip
Excel lends a hand in helping you match parentheses. When the insertion point moves over a parenthesis while
you’re editing a cell, Excel momentarily makes the parenthesis character bold and displays it in a different
color — and does the same with its matching parenthesis. n


Using functions in your formulas

Many 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 calcu-
late the tangent of an angle. You can’t do this complicated calculation by using the mathematical
operators alone.
Free download pdf