←Module 4
Lesson · 12 min

Complex Formulas & Order of Operations

Use PEMDAS and parentheses to control calculation order when building multi-step formulas such as subtotals and tax.

By the end of this lesson you can

  • Predict the result of a formula using the order of operations
  • Use parentheses to make evaluation order explicit
  • Break a long formula into intermediate steps for auditability
  • Use Evaluate Formula to see how Excel works through a calculation

Video

Watch the lesson video, then complete the reading and challenge.

Lesson Notes

Read through the key concepts before you try the challenge.

Excel follows precedence, not reading order

On the job

You calculate supply costs with tax at Lakeside Medical Associates.

You write =C2+D2*0.08 intending to add the item cost to the tax. Excel multiplies first, so it adds 8% of the shipping to the item price instead. Every line is wrong by a small amount, which is exactly the kind of error nobody notices for months.

Your task: Know the order Excel evaluates in, and use parentheses so intent is never ambiguous.

Excel evaluates in a fixed order regardless of how the formula reads left to right: parentheses first, then exponents, then multiplication and division, then addition and subtraction. Operators at the same level evaluate left to right. So =2+3*4 is 14, not 20 — the multiplication happens first.

OrderOperatorsExample
1Parentheses ( )=(2+3)*4 gives 20
2Exponents ^=2^3*4 gives 32
3Multiplication and division * /=2+3*4 gives 14
4Addition and subtraction + -=2+3-1 gives 4
5Comparison = < > <= >= <>=A1>B1 gives TRUE or FALSE
Order of operations
Add parentheses even where precedence already gives the right answer. =(C2*D2)+(E2*F2) and =C2*D2+E2*F2 produce the same number, but the first states its intent, and the next person to edit it — quite possibly you — will not have to work out whether the omission was deliberate.
For a formula you cannot reason about, select the cell and use Formulas > Evaluate Formula. It steps through the calculation one operation at a time, showing intermediate results. It is the fastest way to find where a long formula diverges from what you intended.

Order of Operations (PEMDAS)

When a formula includes multiple operators, Excel follows an order of operations. PEMDAS stands for Parentheses, Exponents, Multiplication, Division, Addition, and Subtraction.

If a result looks incorrect, it is often because Excel evaluated a part of the formula in a different order than you expected.

Using the order of operations (PEMDAS) graphic
Excel evaluates formulas in this order unless parentheses change it.

Excel evaluates expressions inside parentheses first before moving on to other operations.

Parentheses step highlighted
Exponents step highlighted

After parentheses, Excel evaluates exponents if present.

Multiplication and division step highlighted
Division step result

Multiplication and division are evaluated next, working from left to right.

Addition and subtraction step highlighted
Final simplification step

Finally, Excel performs addition and subtraction from left to right.

Final answer shown

Building a Subtotal Formula

A subtotal often involves adding multiple calculations together. In this example, we multiply Unit Price by Quantity for each item, then add the results.

Click the subtotal cell first, then type an equals sign (=) to begin entering your formula.

Subtotal cell selected
Subtotal formula entered
Subtotal formula improved with parentheses

By adding parentheses, Excel performs the multiplication steps first before summing the results. If your subtotal seems too large or too small, check whether parentheses are controlling the order properly.

Subtotal result displayed

Calculating Tax Correctly

To calculate tax, you typically add totals first, then multiply by the tax rate. Parentheses ensure Excel performs the addition before multiplying.

Correct tax formula using parentheses
Incorrect tax formula without parentheses
Without parentheses, Excel multiplies before adding, which changes the result.

If your tax calculation is incorrect, check whether Excel multiplied something before completing the addition.

Correct tax result displayed

Key Takeaways

  • Excel follows PEMDAS automatically.
  • Use parentheses to control the order of calculations.
  • Multiplication and division happen before addition and subtraction.
  • If totals look wrong, check parentheses first.

Understanding Excel's Order of Operations (PEMDAS)

Excel calculates complex formulas using a specific hierarchy known as the Order of Operations. If you do not understand this hierarchy, your formulas may return unexpected results.

Excel follows PEMDAS: Parentheses, Exponents, Multiplication, Division, Addition, and Subtraction.

Excel Order of Operations PEMDAS infographic
Excel calculates formulas using PEMDAS. Multiplication and division are solved left-to-right, as are addition and subtraction.

When operators share the same priority level—such as multiplication and division—Excel evaluates them from left to right.

Knowledge Check

Check your understanding

In the formula =2+3*4, what is the result?

Practice File

Download this file and follow along with the lesson.

Challenge

Apply what you've learned in this lesson.

Complete the following tasks using the practice workbook:

  1. Download the practice file above.
  2. Click the Challenge worksheet tab in the bottom-left of the workbook.

Click cell D7 first. Type an equals sign (=) to begin your formula.

In cell D7, create a formula that calculates the tax for the invoice. Use a sales tax rate of 7.5%. (You can enter 7.5% directly, or use 0.075.)

In cell D8, calculate the total for the order. Use SUM to add cells D3:D7.

In cell D9, calculate the total after a 10% discount. A 10% discount means you pay 90% of the total.

If your totals look too high or too low, double-check your parentheses and percent formatting.

When you are finished, your spreadsheet should look like this:

Final expected results for complex formulas challenge

Finished this lesson?

Progress is saved in this browser only. It is not a grade — official progress lives in Brightspace.