Microsoft Office Tutorials and References

In Depth Information

**Chapter 9: Playing with Formulas**

Organizing formulas with parentheses

Formulas can be as simple as a single mathematical operator such as =D3*E4.

However, you can also use multiple mathematical operators, such as

=A4+A5*C7/F4+D9

There are two problems with using multiple mathematical operators. First,

they make a formula harder to read and understand. Second, Excel

calculates mathematical operators from left to right, based on precedence, which

means a formula may calculate results differently than you intended.

Precedence
tells Excel which mathematical operators to calculate first, as

listed in Table 9-2. For example, Excel calculates multiplication before it

calculates addition. If you had a formula like

=A3+A4*B4+B5

Excel first multiplies A4*B4 and then adds this result to A3 and B5.

Table 9-2

Operator Precedence in Excel

Mathematical Operator

Description

: (colon)

(single space)

, (comma)

Reference operators

–

Negation

%

Percent

^

Exponentiation

*

/

Multiplication and division

+

–

Addition and subtraction

&

Text concatenation

= < > <= >= <>

Comparison

Typing parentheses around cell references and mathematical operators not

only organizes your formulas, but also tells Excel specifically how you want to

calculate a formula. In the example =A3+A4*B4+B5, Excel multiplies A4 and B4

first. If you want Excel to first add A3 and A4, then add B4 and B5, and finally

multiply the two results together, you have to use parentheses, like this:

=(A3+A4)*(B4+B5)