Skip to content

Control the order of a calculation

Operators and percentages8 min

Builds on Your first formula.

A gift shop in Vermont sets its prices from cost, and the margin column shows what share of each price is profit. The formula has only three cell references in it, and one missing pair of parentheses turns a 37.5% margin into 4737.5%.

How it works

Excel works out a formula in a fixed order, the one from school math. Multiplication and division come before addition and subtraction, so =10-4/2 returns 8. Operators of the same rank go from left to right, so =12/3*2 divides first and also returns 8.

Parentheses come before everything else: Excel works out what's inside them first, so =(10-4)/2 returns 3. While you type, Excel gives each pair its own color, which makes it easier to check that every opening parenthesis has a closing one.

RowABC
1OrderOperatorExample
21( ) parentheses=(A5+B5)*C5
32- as a sign=-B2
43% percent=B2*15%
54^ to the power of=B2^2
65* and /=B2*C2/D2
76+ and -=B2+C2-D2
87& join text=A2&" "&B2
98=, <>, >, <, >=, <= compare=B2>=C2

Example

A desk organizer sells for $48.00, in B4, and costs the shop $30.00, in B5. The margin is the profit divided by the price.

=(B4-B5)/B4
Subtracts the cost in B5 from the price in B4, then divides the result by the price.

It returns 0.375, which the Percentage format shows as 37.5%.

Step=B4-B5/B4=(B4-B5)/B4
1B5/B4 is 0.625B4-B5 is 18
2B4-0.625 is 47.37518/B4 is 0.375
Shows4737.5%37.5%
Without parentheses, Excel divides before it subtracts. With them, it subtracts first, and the margin comes out at 37.5%.

Common mistakes

  • =B4-B5/B4 divides first and shows 4737.5%. Put the subtraction in parentheses.
  • =E2+F2/2, meant as the average of two cells, halves only F2. Add first, =(E2+F2)/2, or use =AVERAGE(E2:F2).
  • =H2/H3*8, meant to divide by H3 times 8, divides by H3 and then multiplies by 8. Write =H2/(H3*8).

In short

  • Excel works out parentheses first, then * and /, then + and -.
  • Operators of the same rank go from left to right, so =12/3*2 divides before it multiplies.
  • Put parentheses around every part that has to be worked out first.

Practice

4 exercises · free, no account needed

Start practicing
  1. Not started

    1. Read a formula without parentheses

    Quiz · easy

  2. Not started

    2. Budget halfway between two quotes

    Formula · easy

  3. Not started

    3. Mileage claims from the odometer

    Formula · medium

  4. Not started

    4. Utilization for the month

    Formula · medium