To group rows in Excel, select the rows you want to group (for example, rows 2 to 4), go to the Data tab, and click Group in the Outline section. Or press Shift + Alt + Right Arrow. Click the minus (−) button in the left margin to collapse the group and plus (+) to expand it. A long sheet then turns into a tidy summary you can expand when needed. Grouping is built into Excel for Microsoft 365 on Windows, Mac, and the web.

Group Rows Manually
- Select the detail rows by clicking and dragging over their row numbers. Don’t include the summary row (such as a total) you want to keep visible.
- Go to Data > Outline > Group. If you selected cells rather than whole rows, choose Rows in the dialog and click OK.
- A bracket and a − button appear to the left of the row numbers. Click − to collapse and + to expand.
- Repeat for each section you want to group.
Keyboard Shortcuts
| Action | Windows | Mac |
|---|---|---|
| Group selected rows | Shift + Alt + Right Arrow | Cmd + Shift + K |
| Ungroup selected rows | Shift + Alt + Left Arrow | Cmd + Shift + J |
| Show or hide outline symbols | Ctrl + 8 | Ctrl + 8 |
Create Nested Groups (Multiple Levels)
You can group up to eight levels deep. Group the larger block first (for example, an entire quarter), then select smaller blocks inside it (each month) and group again. Numbered buttons (1, 2, 3…) appear above the outline bar. Click 1 to show only the top-level summary, or the highest number to show every row.
Group Rows Automatically
Auto Outline
If your data has summary rows with formulas such as =SUM(C2:C4) directly below or above the detail rows, click any cell in the data, then choose Data > Group > Auto Outline. Excel builds the groups from your formulas.
Subtotal
- Sort your data by the column you want to group by (for example, Region).
- Select the data and click Data > Subtotal.
- Choose At each change in (Region), the function (Sum), and the column to total (Sales). Click OK.
Excel inserts subtotal rows and groups each section; for totals you can rearrange without changing the sheet, create a pivot table instead. To undo it, open Subtotal again and click Remove All.
Ungroup or Clear Groups
- Ungroup one section: select its rows and click Data > Ungroup (or Shift + Alt + Left Arrow).
- Remove all groups: click Data > Ungroup > Clear Outline. Collapsed rows stay hidden, so select the rows around them and choose Home > Format > Hide & Unhide > Unhide Rows if needed.
Put the Summary Row Above the Details
By default, Excel assumes totals sit below their detail rows, so the +/− button appears at the bottom of each group. If your headings are above the details, click the small dialog launcher arrow in the corner of the Outline group and uncheck Summary rows below detail.
Group Rows in Excel for the Web
Excel for the web supports grouping too: select the rows, then choose Data > Group > Group. Collapse and expand work the same way, though some options like Auto Outline may be limited.
If Grouping Doesn’t Work
- Group button is grayed out: the sheet may be protected, you may be editing a cell (press Esc), or your data may be formatted as a Table. Convert it with Table Design > Convert to Range first.
- Outline symbols disappeared: press Ctrl + 8, or check File > Options > Advanced > Show outline symbols if an outline is applied.
- Two groups merged into one: adjacent groups combine. Leave a summary row or blank row between sections.
- Auto Outline says it can’t create an outline: your summary rows need formulas that reference the detail rows.
Grouping vs. Hiding and Other Questions
What’s the difference between grouping and hiding rows?
Hiding removes rows from view with no visual cue beyond the missing row numbers. Grouping adds clear +/− controls so anyone can expand and collapse sections with one click.
Can I group columns the same way?
Yes. Select columns instead of rows and use Data > Group; the controls appear above the column letters.
Does grouping affect formulas or printing?
Formulas still include collapsed rows. When printing, only the rows currently expanded are printed.

Kermit Matthews runs Live2Tech from just outside Philadelphia. He is an IT specialist with over 20 years of experience, from a university help desk to small-business IT, IT management and his own consulting practice, and has written tech guides full time since 2020. Steps are checked against the current software on a real device or the maker’s official documentation. More about Kermit.