Order of Operations
Part of the Fundamentals section of Coddy's Excel journey — lesson 15 of 42.
Quick: what does =2+3*4 show? If you said 20, Excel disagrees, it shows 14. Just like in math class, Excel multiplies and divides before it adds and subtracts. So it computes 3*4 first (12), then adds 2.
Want the addition to happen first? Wrap it in parentheses, whatever sits inside them is calculated before anything outside:
=2+3*4 shows 14
=(2+3)*4 shows 20The full pecking order: parentheses first, then powers (^), then * and /, and finally + and -. That's why =2*3^2 is 18 (the power runs first), and =10-4/2 is 8, not 3.
When in doubt, add parentheses. Extra ones that don't change the order are harmless, =(3*4)+2 works exactly like =3*4+2, and they make your formulas easier to read.
Challenge
EasyThree numbers live in A1, A2 and A3 (call them a, b and c). Column B describes two calculations that look alike but aren't:
- In
C1(next to the a+b*c label): a plus b times c, no parentheses - In
C2(next to the (a+b)*c label): the same formula, but with parentheses forcing the addition first
Use cell references, the numbers will change during testing. Watch how different the two results are!
Try it yourself
| A | B | C | D | E | F | G | |
|---|---|---|---|---|---|---|---|
| 1 | 2 | a+b*c | |||||
| 2 | 3 | (a+b)*c | |||||
| 3 | 4 | ||||||
| 4 | |||||||
| 5 | |||||||
| 6 | |||||||
| 7 | |||||||
| 8 | |||||||
| 9 | |||||||
| 10 | |||||||
| 11 | |||||||
| 12 | |||||||
| 13 | |||||||
| 14 |
This lesson includes a short quiz. Start the lesson to answer it and track your progress.
All lessons in Fundamentals
1Meet the Spreadsheet
What Is a Spreadsheet?Cells and ReferencesYour First CellsRows, Columns and the GridRecap: Meet the Grid2Entering Data
Text and NumbersBuilding a Small TableEditing and Clearing CellsNumbers That Mean SomethingRecap: Entering Data3Your First Formula
What Is a Formula?Writing a FormulaFormulas with CellsArithmetic OperatorsOrder of OperationsRecap: First Formulas