Order of operations in Excel: how it works
Excel first works out what is in brackets, then powers, then multiplication and division, and only then addition and subtraction. With brackets you set the order yourself.
Start practising hereIn the lesson Order of operations and brackets, free
How does Excel calculate?
Excel follows the same order you learnt at school. First it works out what's in brackets, then powers with ^, then multiplication and division, and only at the end addition and subtraction.
If operations of the same kind are next to each other, such as division and multiplication, Excel calculates from left to right. With brackets, you decide yourself what happens first.
When do you need brackets?
- You add a percentage to an amount: =A2*(1+B2) gives the amount plus tax.
- You subtract a discount: =A2*(1-B2) gives the price after the discount.
- You make an average without a function: =(B2+C2+D2)/3.
- You divide a total that you first have to add up: =(A2+B2)/C2.
Step by step
D1 contains =A2*(1+B2). Excel first works out 1 + 20% and then multiplies by the price. Change the numbers or the formula and see what happens.
This is how to go about it:
- First think about the order you'd calculate in yourself: first 1 plus the tax rate, and then times the price.
- Click D1, type an equals sign, the cell with the price and the multiplication sign.
=A2* - Put what has to happen first in brackets: 1 plus the rate in B2.
=A2*(1+B2 - Close the bracket and press Enter. Excel first works out 1 + 0.2 = 1.2 and then multiplies: 120.
=A2*(1+B2)
More examples
Without brackets
D1 contains =A2*1+B2. Without brackets, Excel first multiplies A2 by 1, and only then adds 20%, or 0.2: 100.2. That shows the difference brackets make.
An average without a function
E1 contains =(A2+B2+C2)/3. First the total in brackets, 42, and then divide by 3.
A price per item
E1 contains =(A2+B2)/C2. First the total cost, 96, and then divide by 4 items: 24 per item. Without brackets, Excel only divides the shipping by 4.
The order
First brackets, then powers with ^, then multiplication * and division /, and finally addition + and subtraction -. If operations of the same kind sit side by side, Excel works from left to right.
An average without a function
=(B2+C2+D2)/3 divides the total by 3. Without brackets, =B2+C2+D2/3, Excel only divides D2 by 3.
Where it often goes wrong
- Every bracket you open, you also have to close. Excel colours the pairs, so you can find them easily.
- A percentage is also a division: 20% is 0.2.
Practise this in the lesson Order of operations and brackets. It's free.
Frequently asked questions
How do I write a power?
With the caret: =2^3 gives 8. The POWER function does the same: =POWER(2,3).
Read next
Creating a formulaFilling and copying formulasAbsolute references ($)Calculating percentagesWorking with multiple sheets