How to group and ungroup rows in Excel
In Excel for Microsoft 365 / Excel 2021–2024 (verified 2026-10-24), select the rows you want to nest, then Data > Group > Group. Excel adds outline symbols (1 / 2 and +/−) so you can collapse detail while keeping summary rows visible.
Use Data > Ungroup to reverse a level, or Data > Clear Outline to remove all grouping on the sheet.
Applies to Excel for Microsoft 365, Excel 2021/2024, Excel for Mac and Excel for the web (outline controls may look simpler on the web). Works best when summary rows sit above or below consistent detail blocks.
Group and collapse rows
Group a block of rows
- Select the detail rows (not the summary row if you want it to stay visible).
- Data > Group > Group (choose Rows if prompted).
- Click the − outline button to collapse; + to expand.
Group columns the same way
- Select columns to hide as a unit.
- Data > Group > Group → Columns.
- Use the column outline buttons above the sheet.
Ungroup or clear
- Select the grouped rows → Data > Ungroup.
- To remove every level: Data > Clear Outline.
- Avoid merging cells inside grouped blocks — outlines get confusing.
Our take: group for reports, filter for analysis
Use grouping when you ship a printable P&L-style sheet with expandable detail. Use AutoFilter or PivotTables when you need ad-hoc slicing.
If it fails
- Group greyed out: sheet may be protected, or you selected a whole sheet oddly — select a contiguous block.
- Wrong rows collapse: include only detail rows; keep totals outside the group.
- Numbers 1/2 missing: enable outline symbols under Data options, or zoom/unhide.
- Need automatic subtotals: Data > Subtotal (sorted data) instead of manual Group.
Frequently asked questions
How do I group rows in Excel?
Select the rows, then Data > Group > Group. Use the outline +/− controls to collapse.
What is Clear Outline?
It removes all row/column grouping levels from the worksheet at once.
Can I group columns too?
Yes — select columns and Group → Columns.
Group vs hide rows?
Hiding is manual and easy to miss; grouping adds visible outline controls for expand/collapse.
Does grouping work in Excel for the web?
Basic group/ungroup works; complex multi-level outlines are clearer in desktop Excel.