Maintenance Notification: We are upgrading our servers today so you may experience intermediate outages. Thank you for your patience.
Format and validate data
MO-211

Calculate data by inserting subtotals and totals

  1. 1Sort the data by the column to group on: Shop.
  2. 2Select a cell in the data. Data › Subtotal.
  3. 3At each change in: Shop. Use function: Sum. Add subtotal to: Sales. OK.
  4. 4Use the outline level buttons 1, 2 and 3 to show more or less detail.

Subtotal inserts a total row under each group and a grand total at the end, and outlines the sheet so the detail folds away.

What the MO-211 task asks

One of our ten MO-211 practice exams has it, as a pair of tasks: “This sheet is already sorted by Route. Use Data > Subtotal to insert a SUM of Takings at each change in Route,” then “Collapse the subtotal outline to level 2 so only the route totals and the grand total show.”

Our grader counts the subtotal rows, one for each route, and then checks that the detail rows are hidden. Collapsing to the wrong level fails the second task.

“Totals” also covers a table's Total Row (Table Design › Total Row), which works the same way: its total ignores rows a filter hides.

Worked examples

Set up the grid below to follow along. Each example starts from it as shown; every result is what Excel showed.

Sales (sorted by Shop)
ABC
1ShopItemSales
2EastTea40
3EastJam25
4NorthTea30
5NorthOats15
6NorthJam20
7WestTea35
A sum at each change in Shop
Do this
  1. 1Select A2. Data › Subtotal: At each change in Shop, Use function Sum, Add subtotal to Sales. OK.
Excel showsEast Total 65 · North Total 65 · West Total 35 · Grand Total 165

The sheet grows from 7 rows to 11. Each total is a SUBTOTAL formula with function number 9, the sum, over the rows above it.

Outline level 2
Do this
  1. 1Select the outline level button 2.
Excel showsRows 1, 4, 8, 10 and 11: the heading, the three shop totals and the grand total

Level 1 shows only the heading and the grand total; level 3 shows everything again.

A second calculation
Do this
  1. 1Data › Subtotal again: Use function Average, untick Replace current subtotals. OK.
Excel showsEast Average 32.5 above East Total 65, and the same for each shop

With Replace current subtotals ticked, the averages would replace the sums instead.

Unsorted data
Do this
  1. 1Run the same Subtotal on East, North, East, North, West.
Excel showsEast Total and North Total each appear twice

Subtotal starts a new group every time the value changes, so sort first.

Remove the subtotals
Do this
  1. 1Data › Subtotal › Remove All.
Excel showsThe six data rows, as they were

The total rows and the outline are removed together.

In the video
Do this
  1. 1Data › Subtotal: Shop, Sum, Sales. OK.
  2. 2Outline level button 2.
Excel showsThe three shop totals and the grand total, details hidden

The first two examples, done in Excel on the same sheet.

Watch it done in Excel

The last example above, recorded in real Excel on the same grid.

Exam traps

Not sorting first

On unsorted data, Subtotal makes a new group every time the value changes, so East gets two totals. Sort by the grouping column, then subtotal.

Data in a table

Subtotal is greyed out while the selection is in an Excel table. Convert the table to a range (Table Design › Convert to Range), or use the table's Total Row if the task asks for a total.

Replace current subtotals

With it ticked, a second Subtotal removes the first set of totals. To keep the sums and add averages, untick it.

Collapsing to the wrong level

Level 1 hides the group totals as well as the detail. “Only the totals and the grand total” is level 2.

FAQ

What formula does Subtotal insert?

A SUBTOTAL formula in each total row: function number 9 for Sum, 1 for Average. The grand total uses the same function over all the detail rows, so it does not count the group totals twice.

What does a table's Total Row insert?

A SUBTOTAL formula with function number 109. Made into a table, the Sales grid's Total Row shows 165; filter the table to East and it shows 65.

How do I get rid of subtotals?

Data › Subtotal › Remove All. It removes the total rows and the outline together.

Try it under exam conditions

Take a full, timed MO-211 practice exam, upload the workbook you built, and get a score out of 1000 with a per-task breakdown of where the points went. Your first one is free.

No credit card needed.