Sub topic 2
Calculating with Cell References in Excel
Prerequisites: You should know how to open a workbook, select a cell, enter a value, and press Enter. You should also know basic arithmetic and order of operations.
Calculating with Cell References Instead of Typed Numbers
A cell reference is a cell address, such as B2 or C2. A formula can use references instead of fixed numbers. This lets the result update when the input values change.
Suppose B2 contains a unit price and C2 contains a quantity. Select D2 and enter:
=B2*C2Excel multiplies the value in B2 by the value in C2. If the price or quantity changes, Excel recalculates D2.
References can also combine with numbers. If B2 contains a price and F1 contains a tax rate, enter:
=B2*(1+$F$1)The dollar signs make F1 an absolute reference. When you copy the formula down, Excel keeps using F1. Without dollar signs, a copied formula would change F1 to F2, F3, and so on.
The Order Excel Calculates In
Excel follows operator precedence, which is the order used to evaluate parts of a formula:
- Parentheses
- Exponents with ^
- Multiplication and division
- Addition and subtraction
Operators at the same level are calculated from left to right. For example:
=2+3*4Excel multiplies 3 by 4 first, then adds 2, so the result is 14. Excel does not calculate strictly from left to right.
Changing the Order with Parentheses
Parentheses tell Excel to calculate an expression first:
=(2+3)*4Excel adds 2 and 3, then multiplies the result by 4. The result is 20.
Use parentheses when the business rule requires a different order. They also make a formula easier to review. For example, B2*(1+$F$1) clearly shows that tax is added to 1 before multiplying by the price.
> The operator you intend to apply first should usually appear inside parentheses. Check a formula by calculating each parenthesized part separately.
Exercise
If B2 is 10 and C2 is 3, what results do =B2+C22 and =(B2+C2)2 produce?
Show answer
The first formula produces 16 because multiplication happens first. The second produces 26 because the parentheses make Excel add first.