[ c ]Cellstronaut
BlogTutorial

How to add subtotal rows in Google Sheets, grouped by any column

Google Sheets has no one-click subtotal feature like Excel. Here is how to insert grouped SUBTOTAL rows by hand — and how to add them to any table in one click with Table Total.

AK
Anna Kowalska·Jul 5, 2026·7 min read

To add subtotal rows in Google Sheets, sort your data by the column you want to group on, then insert a =SUBTOTAL(9, …) formula after each group. Google Sheets has no one-click button for it — Excel's Data ▸ Subtotal never made it across — so the manual version is a bit of a chore. Below is the by-hand method, and the one-click way with Table Total.

Does Google Sheets have a Subtotal feature?

No. Excel has a dedicated Data ▸ Subtotal command that sorts your table, drops a total row after each group, and adds a grand total at the bottom — all at once. Google Sheets ships nothing like it. You get the SUBTOTAL function, but not the feature that inserts the rows for you.

So "subtotals" in Sheets means one of three things: write the formulas yourself, build a pivot table, or add the rows with an add-on.

Adding subtotal rows by hand

Say you have sales rows with a Region column and an Amount column, and you want a total after each region.

  1. Sort by the grouping column. Select the range, then Data ▸ Sort range, and sort by Region. Subtotals only make sense once each group's rows sit together.
  2. Insert a row after the first group. Right-click the row number below the last "North" row and choose Insert row above.
  3. Add the SUBTOTAL formula. In the new row's Amount cell, enter =SUBTOTAL(9, C2:C8) — where C2:C8 is just that group's block.
  4. Repeat for every group. Insert a row, write the formula, adjust the range. Ten regions means doing this ten times.
  5. Add a grand total. At the very bottom, =SUBTOTAL(9, C2:C60) over the whole data range. Because SUBTOTAL ignores other SUBTOTAL cells, the grand total will not double-count the per-group rows.

Picking the function

The first argument is a function code that chooses the operation: 9 sums, 1 averages, 2 counts numbers, 4 is max, 5 is min. Swap it to change what the row reports. The important part is that SUBTOTAL skips other SUBTOTAL cells — that is what lets per-group totals and a grand total live in the same column without double-counting.

The catch: this is fragile. Re-sort the data and your hand-placed rows scatter. Add records to a group and the ranges are wrong. On a real report with a dozen groups, it is ten minutes of careful, error-prone work every time the data changes.

Pivot table vs subtotal rows

A pivot table (Insert ▸ Pivot table) will summarize by group without any of that fuss — but it moves the summary to a separate range. Your original table stays as-is; the totals live somewhere else. That is perfect for analysis, and wrong when you actually want the totals sitting inside the table, in the original layout, ready to print or share.

That "totals in place, original layout preserved" job is exactly where subtotal rows beat a pivot table — and exactly where doing it by hand hurts.

Adding subtotal rows in one click

  1. Install Table Total from the Google Workspace Marketplace.
  2. Click any cell inside the table you want to total.
  3. Open Extensions → Table Total and choose the column to group by — Region, Category, Department, anything.
  4. Pick a function (SUM, AVERAGE, COUNT, MIN, MAX, and more) and click Add.

The rows it inserts are native Google Sheets SUBTOTAL formulas, so they keep working even if you uninstall the add-on. You can total several value columns in the same run, and to nest by a second key column you just run it again on top of the already-grouped table — it adds an inner subtotal level. The how-to guide and the full function list cover the details.

Where this saves time

Monthly reports are the obvious case: totals by region, by category, by rep, refreshed every time the numbers change — do it by hand once and you will not want to do it again. Shared sheets are another, since the totals stay inside the table where a reader expects them, not off in a pivot. And because the formulas are native, the file behaves normally for anyone you send it to, add-on or not.

FAQ

Does Google Sheets have a Subtotal feature like Excel? No. Excel's Data ▸ Subtotal button has no equivalent. You reproduce it by sorting and writing SUBTOTAL formulas by hand, with a pivot table, or in one click with Table Total.

How do I add subtotal rows grouped by a column? Sort by the grouping column, then insert a =SUBTOTAL(9, range) row after each group. Table Total does the sort and the insertion for you.

Can I nest subtotals by more than one column? Yes, but not in one pass. Pick one key column per run; to nest, run Table Total again on the already-grouped table and it adds an inner level. You can total several value columns in a single run.

Do the formulas keep working without the add-on? Yes. They are native SUBTOTAL formulas and keep calculating after you uninstall or once the trial ends. See the pricing page for current limits.