Chapter 9: Introducing Formulas and Functions
9
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 follows:
=(B2*C2+B3*C3+B4*C4)*B6
Most would agree that using the extra parentheses makes the calculation much clearer.
Note that operators at the same level of precedence, such as multiplication and division, are
evaluated from left to right (unless parentheses would indicate a different order).
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 it won’t let
you enter the formula.
In some cases, if your formula contains mismatched parentheses, Excel may propose a correction to your formula.
Figure 9.1 shows an example of a proposed correction. You may be tempted simply to accept Excel’s suggestion, 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.
FIGURE 9.1
Excel sometimes suggests a syntactically correct formula, but not the formula you had in
mind.
When you’re editing a formula, Excel lends a hand in helping you match parentheses by displaying matching paren-
theses in the same color.
Using functions in your formulas
Many formulas that you create use worksheet functions. These functions enable you to
greatly enhance the power of your formulas and perform calculations that are difficult (or