Excel's Subtotal feature groups your rows by a column and inserts a summary row after each group, plus a grand total at the bottom. To use it, sort your list by the column you want to group on (Data > Sort), select any cell in the range, then go to Data > Subtotal, choose the column to group by and the function to apply, and tick the columns you want summarized. Click OK and Excel adds the outline groups. The catch is that a cell range and a formatted Excel Table (Insert > Table) behave differently here, and that difference is where most confusion starts. Menu labels can differ slightly by Excel version and by desktop versus web.

What You'll Need

  • A list of data with a single header row and no blank rows or columns inside it. Blank rows make Excel stop the selection early.
  • Clean, consistent values in the column you want to group by. "North " with a trailing space will not group with "North".
  • Numbers stored as numbers, not text. Left-aligned figures in a right-aligned column are usually text.
  • A backup copy, or at least a version history you can roll back to. Subtotal writes rows into your sheet, and undoing it later is fiddlier than you might expect.

Step-by-Step

  1. Decide whether you really want the Subtotal tool. Data > Subtotal works best on a plain range. If your data is a real formatted Table, the tool still runs but it inserts rows inside the Table, which can break structured references and filters later. For a Table, a PivotTable or the Table's built-in Total Row is usually the cleaner answer.
  2. Convert the Table back to a range if needed. Click any cell in the Table, then go to Table Design (called just Design in some versions) and click Convert to Table. This removes the Table formatting object but keeps your data and cell formatting. If you want to keep the Table, skip to step 9.
  3. Make sure there are no blank rows or columns. Select the whole block manually with the mouse, or press Ctrl+A while inside the data. If Excel warns about a partially selected range, check for gaps.
  4. Add filter buttons if you want them. Select the data and use Data > Filter. This is optional, but you will want it if you plan to hide groups.
  5. Sort by the grouping column first. Click a cell in that column, then Data > Sort A to Z or Z to A. Subtotal creates a group whenever the value changes, so unsorted data produces a shower of tiny one-row groups instead of clean blocks. This is the single most important step.
  6. Open the tool. With a cell still selected in the data, go to Data > Subtotal. The dialog opens with three boxes: At each change in, Use function and Add subtotal to.
  7. Set the three boxes. In At each change in, pick your grouping column, such as Region or Category. In Use function, pick Sum, Count, Average, Max, Min, Product or similar. In Add subtotal to, tick each numeric column you want summarized, such as Sales or Units. Ticking a text column only makes sense with Count.
  8. Leave Replace current subtotals ticked on a first run. It prevents duplicate pages of subtotals if you are redoing the command. Tick Summary below data so totals appear under each group rather than above it. Tick Page break between groups only if you intend to print each group on its own page. Click OK.
  9. If you kept a formatted Table, apply the same logic a different way. Click any cell, go to Table Design, tick Total Row, then pick the function from the dropdown in the total cell. This gives one grand total, not a row per group. For subtotals per group in a Table, use Insert > PivotTable with the grouping column in Rows and the value in Values, or use Data > Outline > Subtotal after converting to a range.
  10. Read the outline. Excel draws group lines down the left edge with numbered buttons 1, 2 and 3 and plus/minus signs. Button 2 collapses to subtotal rows only, which is exactly what you want for a printed summary.
  11. Check the grand total. Scroll to the bottom and confirm the Grand Total row matches an independent sum, for example one you compute in an empty cell with SUM over the whole column. If they differ, you likely have hidden rows or leftover subtotal rows inside the range.
  12. Remove subtotals cleanly when you are done. Select a cell in the data, open Data > Subtotal and click Remove All. Deleting the rows by hand leaves the outline intact and can leave small total rows behind.

Common Mistakes

Forgetting to sort. The tool only starts a new group when a value in the grouping column changes. Alphabetically scattered data gives you dozens of near-empty groups. Always sort first.

Running Subtotal twice with Replace unticked. Excel then adds a second layer of subtotals, nesting totals inside totals and doubling your grand total. Pick Remove All and start again rather than trying to unpick it.

Grouping a Tabulating number that is stored as text. If a column shows a green triangle warning, or the totals come out as zero, the values are text. Convert with Data > Text to Columns and click Finish, or multiply the column by 1 in a helper column.

Ticking every column in Add subtotal to. Summarizing a name or a product code with Sum is meaningless. Only tick columns where an arithmetic total makes sense, and use Count if you want to know how many rows are in a group.

Applying it to a formatted Excel Table and then wondering why the filters break. Inserted total rows inside a Table become Table rows, which changes what filters and structured references see. Convert to a range first, or use a PivotTable.

Leaving old manual totals in the data. A hand-typed total row inside the range gets summed along with everything else. Delete existing totals first.

Tips

Use the numbered outline buttons rather than hiding rows manually, so the sheet stays consistent when data changes. Name the grouping column something obvious before you start, because "At each change in" lists raw header text.

If you need several levels of grouping, for example Region then Product, run Subtotal once on Region, then run it again on Product with Replace current subtotals unticked. Excel nests the groups.

When you need to refresh the numbers after editing, Remove All and re-run the command. Subtotal rows are static values, not formulas that update by themselves, unlike the Total Row of a Table or a PivotTable.

For reporting that you will refresh monthly, build a PivotTable once and refresh it thereafter. It handles new rows, needs no sorting, and keeps the raw data untouched.

Troubleshooting

Subtotal is greyed out. Usually the active cell sits outside a contiguous block, or the sheet is protected. Click inside the data, then check Review > Unprotect Sheet.

Groups appear one row at a time. The column is not sorted, or it contains values that look identical but differ by case or spacing. Sort again and use Find & Replace to strip stray spaces.

Totals show zero. The data is text. Confirm with the alignment, then convert it as described above.

The grand total is double what it should be. Old subtotal rows are inside the range. Remove All, delete any orphan total rows, then run it once more.

You cannot undo the removal. Excel's undo does not always restore removed subtotal rows. Use Ctrl+Z immediately, and if it fails, recover from version history or your backup.

Nothing appears under the data. Check whether the Summary below data box was unticked, and whether your selection stopped before the last rows.

Frequently Asked Questions

Can I insert subtotals in a formatted Excel Table?

Data > Subtotal will run inside a Table and insert rows, but those rows become part of the Table, which can disrupt filters and structured references. Convert the Table to a range first, or use a PivotTable for a repeatable summary.

Why does Excel only show one group?

Almost always because the grouping column is not sorted. Sort it first, then run Data > Subtotal again.

Does the subtotal update if I change a number?

No. Subtotal rows are static values. Remove All and re-run the command, or use a Table's Total Row or a PivotTable, both of which recalculate.

How do I remove subtotals without deleting my data?

Click a cell in the data, open Data > Subtotal, and click Remove All. This deletes the total rows and clears the outline groups.

Can I have subtotals at two levels?

Yes. Run the command on the outer column first, then run it again on the inner column with Replace current subtotals unticked.

Should I use Subtotal or a PivotTable?

Use Subtotal for a quick one-off pass on a static list. Use a PivotTable when the data will change or you need to refresh the summary regularly.