Excel has no built-in single keystroke that inserts subtotal rows. The fastest reliable route is the Subtotal feature on the Data tab: select your data, press Alt+A, then B (or Alt, A, B pressed in sequence) on Windows to open Data > Subtotal, then press Enter to confirm the defaults. On Excel for Mac, use the ribbon: Data > Subtotals. If you want the shortcut to calculate a subtotal in a single cell rather than insert grouped subtotal rows, type =SUBTOTAL(9,range) and press Enter, or use Alt+= (AutoSum) with the range selected. Anyone with a normal data table and a header row can do this in under a minute.

One caveat before you start: ribbon labels and menu positions can shift slightly between Excel versions, platforms and regions, so if a name below does not match what you see, look for the closest equivalent on the Data tab.

What You'll Need

  • Excel for Windows or Mac (Microsoft 365, Excel 2019 or later). The keyboard path below is for Windows; Mac has no matching Alt key sequence, so use the ribbon.
  • A worksheet with a single header row and no blank rows or blank columns inside the data range.
  • At least one column you want to group by, such as Region, Category or Salesperson.
  • At least one numeric column to total, such as Sales, Qty or Cost.

Step-by-Step

  1. Clean the data first. Delete completely blank rows and columns inside your table, and make sure every column has a heading in row 1. Subtotal detects a range automatically, and gaps break it into pieces, which produces partial or missing subtotals.
  2. Click any single cell inside your data. You do not need to select the whole table. Excel expands the selection to the surrounding block.
  3. Sort before you group. If you want one subtotal per region or category, the rows for each group must sit together. Select the full table, then use Data > Sort and pick your grouping column. If you skip this, you get a subtotal after every change in value instead of one per group — a legitimate setting, but usually not what people want.
  4. Open the Subtotal dialog with the keyboard. On Windows, press Alt, then A, then B, tapping each key in turn rather than holding them. Alt opens the ribbon key tips, A selects the Data tab, and B opens Subtotal. Pressing Alt+A together then B quickly also works on most layouts.
  5. Set the grouping column. In the At each change in dropdown, choose the column you sorted by, for example Region.
  6. Choose the function. In Use function, pick Sum for totals, or Count, Average, Max, Min, Product and so on if you need something else.
  7. Tick the numeric columns. In Add subtotal to, check each numeric column you want totalled. Untick anything that is an ID, a date or text, since summing those is meaningless.
  8. Optionally replace existing subtotals. If the sheet already has subtotals, tick Replace current subtotals so you do not nest a second layer on top of the first.
  9. Press Enter or click OK. Excel inserts an outline, adds a subtotal row after each group, and appends a grand total row at the bottom.
  10. Collapse or expand with the outline buttons. Use the 1, 2 and 3 buttons at the top-left of the sheet to show only grand totals (1), group subtotals (2) or everything (3). The small plus and minus signs in the left margin collapse individual groups.
  11. For a single-cell subtotal instead, select the numeric range and press Alt+=. This inserts =SUBTOTAL(9,range) rather than a plain SUM, so it ignores rows hidden by filters. You can also type it directly, changing the 9 to other function numbers: 1 for AVERAGE, 2 for COUNT, 3 for COUNTA, 4 for MAX, 5 for MIN.

Common Mistakes

  • Subtotalling an unsorted table. Groups must be contiguous. Unsorted data gives you a subtotal row every time a value changes, sometimes dozens of them.
  • Leaving blank rows in the data. Excel's automatic range detection stops at the gap, so the lower half of the table is silently left out.
  • Checking a text or ID column in the Add subtotal to list. Summing identifiers gives meaningless numbers; only tick true numeric measures.
  • Using SUM instead of SUBTOTAL when filtering. A SUM adds hidden filtered rows too, so the total disagrees with what is on screen. SUBTOTAL skips them.
  • Running the feature twice. Without Replace current subtotals ticked, you stack a second outline layer and the grand total doubles up.
  • Assuming the Mac has the same Alt sequence. It does not; use Data > Subtotals on the ribbon, or apply AutoSum with the range selected.
  • Expecting the subtotal rows to survive a pivot table. Subtotal rows are tied to the original range. In a PivotTable, use the built-in subtotals under Design instead.

Tips

  • Format your data as an Excel Table (Ctrl+T) afterwards if you want filtering to keep working cleanly with subtotals.
  • Use SUBTOTAL(109, range) instead of 9 if the rows themselves might be manually hidden, not just filtered — 109 excludes hidden rows too.
  • Do a quick sanity check: the grand total row should equal a plain SUM of the whole column. If it does not, a blank row or duplicated run is hiding in the data.
  • Remove the whole outline in one go with Data > Subtotal > Remove All, which deletes the subtotal rows and outline levels together.
  • Keep the grouping column to the left of the numeric columns for easier reading; the subtotal row labels then line up with the group name.
  • Paste values over a finished subtotal sheet before sending it out, so recipients cannot accidentally expand the outline and edit group totals.

Troubleshooting

No subtotals appear at all. The range is probably not being detected. Click a cell well inside the data, confirm row 1 has headings, remove blank rows, then retry. If the sheet is protected, unprotect it first — protected sheets block structural changes.

Subtotal rows appear after every single row. You grouped by a column with all unique values, or the data was never sorted by the grouping column. Sort first, then rerun with Replace current subtotals ticked.

The shortcut does nothing. Alt key tips only work when the ribbon is active and no dialog is open. Press Esc once, click a cell, and try Alt, A, B again as separate presses. On laptops with a Fn-locked function row or a custom keyboard layout, ribbon key tips can be remapped; in that case use the mouse path Data > Subtotal.

Grand total looks wrong or doubled. Existing subtotal rows are being included in the new calculation. Tick Replace current subtotals, or remove all subtotals first and rerun.

Filtered rows still show in the total. You have a SUM or a hard-coded range, not SUBTOTAL. Replace it with =SUBTOTAL(9,range).

SUBTOTAL returns an error or zero. Check the range has actual numbers, not numbers stored as text. Select the column and use Data > Text to Columns, or multiply by 1 to convert, then recalculate.

Frequently Asked Questions

Is there a single shortcut key for subtotals in Excel?

No. The closest is the ribbon key sequence Alt, A, B on Windows, which opens the Subtotal dialog. Alt+= inserts a SUBTOTAL formula into one cell rather than creating grouped subtotal rows.

Why does Alt+= give me SUBTOTAL instead of SUM?

That is intentional. SUBTOTAL ignores rows hidden by filters, so the total always matches the visible data. To get a plain SUM, type =SUM(range) manually.

Can I subtotal more than one column at once?

Yes. In the Subtotal dialog, tick multiple numeric columns under Add subtotal to. Each gets its own subtotal value on the same summary row.

How do I remove subtotals I added?

Go to Data > Subtotal and click Remove All. That deletes the subtotal rows and clears the outline levels in one step.

Does the shortcut work on Excel for Mac?

Not as the same keystroke. Use the ribbon path Data > Subtotals, or select the range and use AutoSum from the Formulas tab.

Can I subtotal by two levels, such as country then region?

Yes. Sort by the first column, then the second, and run Subtotal twice — first on the outer column, then on the inner one without ticking Replace current subtotals. Excel builds a two-level outline you can collapse independently.