Order of operations
8 minutes · 5 steps · free, no sign-up
Sheets does not always work left to right. Multiplication happens before addition, just as in school maths, and getting this wrong is the most common reason a correct-looking formula gives a wrong answer. You will learn the rule, use brackets to override it and fix a few classic traps.
- Know which operations Sheets does first
- Use brackets to change the order
- Use ^ for powers
- Avoid the average and percentage traps
Click a cell and start typing. Enter edits, Tab moves right, arrows move, Delete clears.
Quick referenceThe order
1. brackets ( )
2. powers ^
3. multiply/divide * /
4. add/subtract + -
=2+3*4 gives 14
=(2+3)*4 gives 20
The key ideasSummary: Order of operations
Sheets works through a formula in a fixed order: brackets, then powers, then multiplication and division, then addition and subtraction. Operations of the same rank go left to right. So =2+3*4 is 2+12, which is 14.
When you are not sure, add brackets. They cost nothing, make the formula easier to read and guarantee the order you meant. The two traps to watch for are averages (=B11+C11+D11/3 only divides the last number) and percentages (take the percentage of the price, then subtract it).
Watch out forCommon mistakes
- Averaging without brackets.
=A1+A2+A3/3divides only A3 by three. You need=(A1+A2+A3)/3, or simply=AVERAGE(A1:A3). - Forgetting the discount is a share of the price. A 25% discount on 80 is
80-80*25%, not80-25%. - Assuming it reads left to right. Only operations of the same rank go left to right. A later multiplication still wins over an earlier addition.
- Unbalanced brackets. Every
(needs a matching). Sheets will often try to close it for you, but not always where you meant.
Next stepTry it in the real Google Sheets
In Google Sheets, when you click inside a formula, matching pairs of brackets are shown in the same colour. Use this to check you closed each one in the right place. If a formula looks right but gives a strange number, add brackets around each part you want done first.