Smart Systems for Home

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

Subtotal Shortcut Key: How to Insert Subtotal in Excel

· 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 subtotal shortcut key in Excel is Alt + = (press and hold Alt, then press the equals key). This inserts the SUBTOTAL function, which sums a column while ignoring rows already calculated by other subtotals, so it works correctly even when you have several groups in the same column. It is not a full "create all subtotals" button: it inserts the formula into the active cell. To add subtotals to every group at once, use Data > Subtotal. If you are on a Mac, the shortcut is Command + Shift + T in Excel for Mac.

What You'll Need

  • A computer with Microsoft Excel installed (Windows or Mac). The shortcut is built into Excel, not into Google Sheets or the web version in the same form.
  • A worksheet with data organised in columns, ideally with a header row and no completely blank rows inside the data range.
  • Your data sorted by the group you want to subtotal (for example, by Region or Category) if you plan to use Data > Subtotal.

Step-by-Step

  1. Open your workbook and click the cell where you want the subtotal to appear. Usually this is the first empty cell below the numbers you want to add, in the same column.
  2. Press Alt + = on Windows (hold Alt, tap the equals key once). On a Mac, press Command + Shift + T. Excel inserts =SUBTOTAL(9, and waits for you to confirm the range.
  3. Check the range Excel highlights. Excel normally guesses the contiguous block of numbers above the active cell. If the highlight is correct, press Enter. If not, drag over the correct cells with the mouse, or type the range such as B2:B20, then close the bracket and press Enter.
  4. Confirm the function number. The 9 in SUBTOTAL(9, range) means SUM. If you want a different calculation, replace 9 with 1 for AVERAGE, 2 for COUNT, 3 for COUNTA, 4 for MAX, or 5 for MIN. Keep the comma and the range unchanged.
  5. Copy the formula to other subtotal rows if you have more than one group. Select the cell, copy it (Ctrl + C on Windows, Command + C on Mac), select the target cells, and paste. Because SUBTOTAL ignores other SUBTOTAL results, the grand total at the bottom will not double-count the group totals.
  6. For automatic subtotals on every group, select any cell inside your data, go to the Data tab, click Subtotal, choose the column to group by (for example Region), choose the function (Sum), tick the column to subtotal, and click OK. Excel inserts SUBTOTAL formulas and outline buttons automatically.
  7. Remove or adjust the outline using the small 1, 2 and 3 buttons at the left edge of the sheet. Button 1 shows grand totals only, 2 shows subtotals, and 3 shows all rows. To remove the subtotals entirely, go back to Data > Subtotal and click Remove All.

Menu labels can differ slightly by Excel version, device and region, so if you do not see Subtotal exactly where described, look on the Data tab under the Outline group.

Common Mistakes

  • Using SUM instead of SUBTOTAL. A plain SUM at the bottom adds the group subtotals again, so the grand total is wrong. SUBTOTAL with function number 9 avoids this.
  • Leaving blank rows inside the data. Excel treats a blank row as the end of the range, so the highlighted range may stop short. Delete blank rows or select the full range manually.
  • Pressing Alt + = in a cell that already contains text. Excel may insert the formula over the content or refuse; clear the cell first.
  • Forgetting to sort before Data > Subtotal. If the group column is not sorted, Excel creates one subtotal per change in value rather than one per group, producing many small subtotals.
  • Expecting the shortcut to work in Google Sheets. Google Sheets uses different shortcuts and does not have the same SUBTOTAL insertion behaviour; use the Functions menu there instead.

Tips

  • Use function number 109 instead of 9 if you want the subtotal to ignore manually hidden rows as well as filtered rows.
  • Keep the header row outside the selected range so the SUBTOTAL does not try to add text labels.
  • If you only need a quick total of filtered data, the status bar at the bottom of the Excel window shows Sum, Average and Count for the visible cells without inserting any formula.
  • Name your ranges (Formulas > Define Name) if you subtotal the same block often; you can then type the name instead of dragging.
  • On a laptop without a numeric keypad, Alt + = still works because it uses the main equals key, not the keypad.

Troubleshooting

  • The shortcut does nothing. Click directly on a cell first; shortcuts apply to the active cell. If Excel is in cell edit mode (cursor blinking inside the formula bar), press Esc, then try again.
  • Alt + = opens a different menu. Some keyboard layouts and regional settings map Alt combinations differently. Try the ribbon instead: Formulas tab > AutoSum drop-down > Sum, which inserts the same SUBTOTAL when subtotals already exist in the column.
  • The result is 0 or wrong. Check that the range contains numbers, not text that looks like numbers. Select the range and look at the status bar; if Sum shows 0, the cells are stored as text. Convert them with Data > Text to Columns or by retyping.
  • The grand total double-counts. Replace any SUM formulas in the total row with SUBTOTAL(9, range) so nested subtotals are ignored.
  • Subtotal formulas disappear after filtering or refreshing. Data > Subtotal formulas are static; if your source data changes, reapply the command or convert the range to a Table and use the Table's Total Row instead.
  • Mac shortcut not working. Confirm you are in Excel for Mac, not Excel for the web, and that the keyboard has a Command key. In Excel for the web, use the Formulas tab > AutoSum button.

Frequently Asked Questions

What is the shortcut key for subtotal in Excel?

Alt + = on Windows inserts the SUBTOTAL function into the active cell. On Mac, use Command + Shift + T. Both insert the formula; neither automatically creates subtotals for every group.

Does Alt + = work in Google Sheets?

No. Google Sheets has its own shortcut set and does not insert SUBTOTAL with Alt + =. Use Insert > Function > Math > SUBTOTAL, or type the formula manually.

What is the difference between SUM and SUBTOTAL?

SUM adds every cell in the range, including other subtotal rows. SUBTOTAL with function number 9 adds only the detail rows and ignores nested SUBTOTAL results, which prevents double-counting in grand totals.

Can I subtotal more than one column at once?

Yes. In the Data > Subtotal dialog, tick each column you want subtotalled before clicking OK. Excel inserts a SUBTOTAL formula for each selected column.

Why does my subtotal include hidden rows?

Function number 9 includes manually hidden rows but ignores filtered-out rows. Use 109 if you want both filtered and manually hidden rows excluded.

How do I remove subtotals I added?

Select a cell in the data, go to Data > Subtotal, and click Remove All. This removes the subtotal rows and outline levels but leaves your original data intact.