Page 326 - Excel 2013 All-in-One For Dummies
P. 326
308 Formulas 101
Suppose that you enter the following formula in cell A4:
=B4+C4/D4
Because multiplication has a higher level of precedence than addition (4 versus 5), Excel evaluates the division between cells C4 and D4 and then adds that result to the value in cell B4. If, for example, cell B4 contains 2, C4 contains 9, and D4 contains 3, Excel would essentially be evaluating this equation in cell A4:
=2+9/3
In this example, the calculated result displayed in cell A4 is 5 because the program first performs the division (9/3) that returns the result 3 and then adds it to the 2 to get the final result of 5.
If you had wanted Excel to evaluate this formula in a strictly left-to-right manner, you could get it to do so by enclosing the leftmost operation (the addition between B4 and C4) in a closed pair of parentheses. Parentheses alter the natural order of precedence so that any operation enclosed within a pair is performed before the other operations in the formula, regardless of level in the order. (After that, the natural order is once again used.)
To have Excel perform the addition between the first two terms (B4 and C4) and then divide the result by the third term (cell D4), you modify the original formula by enclosing the addition operation in parentheses as follows:
=(B4+C4)/D4
Assuming that cells B4, C4, and D4 still contain the same numbers (2, 9, and 3, respectively), the formula now calculates the result as 3.666667 and returns it to cell A4 (2+9=11 and 11/3=3.66667).
If necessary, you can nest parentheses in your formulas by putting one set of parentheses within another (within another, within another, and so on). When you nest parentheses, Excel performs the calculation in the innermost pair of parentheses first before anything else and then starts performing the operations in the outer parentheses.
Consider the following sample formula:
=B5+(C5–D5)/E5
In this formula, the parentheses around the subtraction (C5–D5) ensure that it is the first operation performed. After that, however, the natural order of precedence takes over. So the result of the subtraction is then divided by the value in E5, and that result is then added to the value in B5. If you want