Excel 2010 Bible

(National Geographic (Little) Kids) #1

Part II: Working with Formulas and Functions


198


TABLE 10.2

Operator Precedence in Excel Formulas


Symbol Operator Precedence

^ Exponentiation 1
* Multiplication 2
/ Division 2
+ Addition^3


  • Subtraction^3
    & Concatenation 4
    = Equal to 5
    < Less than 5

    Greater than 5





You can use parentheses to override the Excel’s built-in order of precedence. Expressions within
parentheses are always evaluated first. For example, the following formula uses parentheses to con-
trol the order in which the calculations occur. In this case, cell B3 is subtracted from cell B2, and
the result is multiplied by cell B4:

=(B2-B3)*B4

If you enter the formula without the parentheses, Excel computes a different answer. Because mul-
tiplication has a higher precedence, cell B3 is multiplied by cell B4. Then this result is subtracted
from cell B2, which isn’t what was intended.

The formula without parentheses looks like this:

=B2-B3*B4

It’s a good idea to use parentheses even when they aren’t strictly necessary. Doing so helps to clar-
ify what the formula is intended to do. For example, the following formula makes it perfectly clear
that B3 should be multiplied by B4, and the result subtracted from cell B2. Without the parenthe-
ses, you would need to remember Excel’s order of precedence.

=B2-(B3*B4)

You can also nest parentheses within formulas — that is, put them inside other parentheses. If you
do so, Excel evaluates the most deeply nested expressions first — and then works its way out.
Here’s an example of a formula that uses nested parentheses:

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