Grouping rows creates a collapsible outline beside the row numbers. It lets you fold detail rows out of view without deleting or permanently hiding them.
Does this affect you?
Use this for Excel for Microsoft 365, Excel 2021, and Excel 2019 on Windows or Mac when a sheet has long detail sections that should collapse under summary rows.
Group rows manually
Use this when you want to decide exactly which rows belong together.
- Select the row numbers for the detail rows.
- Open the Data tab.
- Click Group in the Outline section, or use Shift+Alt+Right Arrow on Windows.
- A bracket and minus button appear beside the selected rows.
- Click the minus button to collapse the group.
- Click the plus button to expand it again.
Group rows automatically from summary formulas
Auto Outline works when the sheet already has subtotal or total formulas.
- Make sure summary rows contain formulas such as SUM that reference nearby detail rows.
- Click inside the data range.
- Open Data > Group and use the dropdown under Group.
- Choose Auto Outline.
- Review the groups Excel created.
More control
Create nested groups
Select a smaller set of rows inside an existing group and run Group again. Excel creates another outline level for subsections, such as days inside weeks.
Use outline level buttons
The numbered buttons at the top-left of the outline margin collapse or expand levels at once. Click 1 for top-level summary; click the highest number to show all detail.
Group columns too
Select column letters and use Data > Group to collapse groups of columns, such as months inside quarters.
Remove grouping
Select grouped rows and use Data > Ungroup to remove one level, or use Clear Outline to remove all grouping from the sheet.
Sources
- Microsoft Support – Group or ungroup rows or columns in a worksheet (2025)
- Microsoft Support – Create an outline of your worksheet data (2025)
- Microsoft Support – Subtotal function (2024)
