Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Keyboard Shortcut for Subtotal: Excel & Google Sheets

· 6 min read · Home Automation

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

The direct answer: there is no single universal keyboard shortcut that inserts a subtotal in every spreadsheet app. In Microsoft Excel, the fastest built-in route is Alt + A + T (Data > Subtotal) on Windows, or Option + A + T on Mac Excel. In Google Sheets, there is no native Subtotal command at all, so the practical shortcut is a quick formula: type =SUBTOTAL(9, and drag the range, or use Ctrl + Shift + T only if you have installed an add-on that maps it. The rest of this guide shows the exact key sequences, what to prepare before you press them, and how to fix the common failures.

What You'll Need

  • A spreadsheet with your data already entered and, ideally, sorted by the column you want to group on (for example, Region or Category).
  • Microsoft Excel for Windows or Mac, or Google Sheets in a browser. The steps below say which app each shortcut belongs to.
  • A header row with unique column labels. Excel's Subtotal command needs labels to name the groups.
  • No merged cells in the data range. Merged cells break both the Excel command and the SUBTOTAL formula.
  • For Excel: the data should be a plain range or an Excel Table. If it is a Table, the Subtotal command is greyed out, so convert it to a range first (Table Design > Convert to Range).

Menu labels can differ slightly by version, device and region, so if a name below does not match exactly, look for the closest equivalent in the same ribbon tab or menu.

Step-by-Step

Method 1: Excel on Windows (Alt + A + T)

  1. Click any single cell inside your data range. Do not select the whole sheet.
  2. Press Alt once to activate the ribbon key tips. Small letters appear over each tab.
  3. Press A to open the Data tab.
  4. Press T to open the Subtotal dialog. (If T does nothing, press S instead; on some layouts Subtotal is grouped under Sort.)
  5. In the dialog, set At each change in to the column that defines your groups, such as Region.
  6. Set Use function to Sum (or Count, Average, Max, Min as needed).
  7. Tick the column(s) under Add subtotal to that hold the numbers you want totalled.
  8. Leave Replace current subtotals ticked if you are re-running the command, and tick Summary below data so the grand total lands at the bottom.
  9. Click OK. Excel inserts an outline with a subtotal row after each group and a grand total at the end.

Method 2: Excel on Mac (Option + A + T)

  1. Select a cell inside the data.
  2. Press Option + A to reach the Data tab, then press T for Subtotal. On Mac Excel the ribbon key tips use Option rather than Alt.
  3. Complete the same dialog settings as above and click OK.

Method 3: The SUBTOTAL formula shortcut (works in Excel and Google Sheets)

  1. Click the cell where the subtotal should appear, usually directly below a block of rows.
  2. Type =SUBTOTAL(9, — the 9 means SUM and tells the function to ignore other subtotal rows, which prevents double counting.
  3. Select the range with the mouse or type it, for example B2:B20.
  4. Close the bracket and press Enter.
  5. Copy the formula down or across with Ctrl + D (Windows) or Command + D (Mac) after selecting the destination cells.
  6. To total only visible rows after filtering, keep function number 9. To count instead, use 3; for average, use 1.

Method 4: Google Sheets

  1. Google Sheets has no Subtotal menu command, so use the formula route above. Type =SUBTOTAL(9,B2:B20) in the target cell.
  2. If you want group headers and collapsible sections, select the rows for a group, then use Data > Group rows (or right-click the row numbers and choose Group rows). Repeat per group.
  3. Add a SUBTOTAL formula under each group. Because SUBTOTAL ignores nested SUBTOTAL results, your grand total stays correct.
  4. If you have a third-party add-on that maps a shortcut such as Ctrl + Shift + T, check its own documentation; Google does not provide that mapping natively.

Common Mistakes

  • Pressing Alt + A + T with a whole column selected. Excel then subtotals thousands of blank rows and the file slows down. Select one cell inside the used range instead.
  • Forgetting to sort first. The Subtotal command groups consecutive identical values only. Unsorted data produces repeated subtotal blocks for the same category.
  • Using SUM instead of SUBTOTAL for group totals. Plain SUM adds the subtotal rows themselves, so the grand total doubles. Always use SUBTOTAL(9, …) inside grouped sheets.
  • Running the command on an Excel Table. The button is disabled. Convert the Table to a normal range first.
  • Leaving merged cells in the group column. Subtotals appear in the wrong place or not at all.
  • Expecting Ctrl + Shift + T to work in Google Sheets. It does not insert a subtotal by default.

Tips

  • Use the outline buttons (1, 2, 3) at the left of the sheet to collapse groups and show only totals.
  • To remove subtotals, reopen the dialog with Alt + A + T and click Remove All.
  • For repeatable reports, build a PivotTable instead: Insert > PivotTable, put the category in Rows and the number in Values. It updates without re-running the command.
  • Function numbers worth memorising: 1 AVERAGE, 2 COUNT, 3 COUNTA, 4 MAX, 5 MIN, 9 SUM.
  • Keep a blank row between your data and anything below it, so the grand total does not get pulled into later formulas.

Troubleshooting

If Alt + A + T does nothing, first click inside the data range and try again; ribbon shortcuts are ignored when focus is in a dialog or the formula bar. If the Subtotal button is greyed out, check for an Excel Table or a protected sheet (Review > Unprotect Sheet). If subtotals appear but the numbers are wrong, confirm the Add subtotal to boxes match numeric columns, not text columns. If the grand total is double the expected figure, replace any SUM formulas in the total row with SUBTOTAL(9, …). If groups are split, sort the data by the group column and re-run the command with Replace current subtotals ticked.

If that did not work, save a copy of the file, then try the formula method on a small test range to confirm the data is numeric. Text-formatted numbers (left-aligned by default) return zero; convert them with Data > Text to Columns or by multiplying by 1 in an empty cell and pasting values back.

Frequently Asked Questions

Is there a single keyboard shortcut for subtotal in Excel?

No single key does it. The shortest built-in sequence is Alt + A + T on Windows and Option + A + T on Mac Excel, which opens the Subtotal dialog.

Why is my Subtotal option greyed out?

Usually because the data is formatted as an Excel Table or the sheet is protected. Convert the Table to a range or unprotect the sheet, then retry.

Does Google Sheets have a subtotal shortcut?

Not natively. Use the SUBTOTAL formula and Data > Group rows for collapsible groups. Any shortcut beyond that comes from a third-party add-on.

What does the 9 mean in SUBTOTAL(9, range)?

It selects the SUM function. SUBTOTAL ignores rows hidden by filters and ignores other SUBTOTAL results, which prevents double counting.

Can I subtotal without sorting my data?

The Excel Subtotal command needs sorted data because it groups consecutive matching values. Without sorting, use a PivotTable or SUMIF instead.

How do I remove subtotals I added?

Select a cell in the range, press Alt + A + T, and click Remove All. The outline and subtotal rows are deleted, leaving your original data.