Grouping lets you collapse and expand sections of your spreadsheet
Grouping in Excel hides rows or columns under a single button you can click to show or hide them. When you group, Excel adds a small minus sign (or plus sign when collapsed) to the left of your rows or above your columns. Click that button and the grouped section disappears; click again and it reappears. This is useful when your spreadsheet has natural sections — months within a year, departments within a company, or line items under a category — and you want to focus on the summary without scrolling past the detail.
Grouping is different from filtering. A filter hides rows that don't match your criteria; grouping hides rows you choose, whether or not they match anything. Grouping is also different from sorting. You group after your data is already organized the way you want it.
Key Takeaways
- Select the rows or columns you want to hide together, then go to Data > Group to create a collapsible section.
- Excel adds outline buttons (numbered 1, 2, 3) to the left of your rows, letting you collapse to any level of detail you choose.
- You can create multiple nested groups — groups within groups — as long as your data is sorted so the sections don't overlap.
- Ungroup by selecting the grouped rows or columns and choosing Data > Ungroup, or click the minus button to collapse without removing the group.
How to group rows in Excel
Start with your data already sorted so that the rows you want to group are next to each other. For example, if you're grouping sales by month, all January rows should be together, all February rows together, and so on.
Click on the row number of the first row you want to group. Hold Shift and click the row number of the last row in that group. All rows between them will highlight in blue. Then go to the Data tab at the top, find the Group button (it looks like horizontal lines with an arrow), and click it. Excel will add a small box with a minus sign to the left of your rows. Click that minus sign to collapse the group; click the plus sign that appears to expand it again.
If you have multiple groups — say, January rows, then February rows, then March rows — repeat this process for each section. Excel will stack the group buttons vertically on the left side. You'll also see numbered buttons (1, 2, 3) at the very top left. Click button 1 to collapse all groups at once; click button 2 to show only the first level of detail; click button 3 to show everything.
How to group columns in Excel
Grouping columns works the same way as grouping rows, but the buttons appear above your columns instead of to the left. Click the column letter of the first column you want to group, hold Shift, and click the last column letter. Then go to Data > Group. The collapse and expand buttons will appear above your columns.
Column grouping is useful when you have related data spread across many columns — for example, Q1 sales in columns B, C, and D; Q2 sales in columns E, F, and G. You can group each quarter separately so you can hide the detail and see only the quarterly totals.
Creating nested groups (groups within groups)
You can create a group inside another group as long as your data is organized so the sections don't overlap. For example, you might group all 2024 data together, then within that, group each month separately. Excel will show outline buttons at different levels on the left side.
To create nested groups, first group your larger sections (the whole year), then group the smaller sections inside them (each month). Excel will automatically arrange the buttons so you can collapse to any level. The numbered buttons at the top will now control how many levels of detail you see: button 1 shows only the largest groups, button 2 shows the next level down, and so on.
When grouping is better than filtering
Use grouping when you know which sections you want to hide and you want to switch between them quickly. Filtering is better when you want to show only rows that meet a specific condition — for example, only sales over $1,000, or only entries from a certain date. Grouping doesn't filter; it just hides and shows sections you've already defined.
Grouping is also better when you're building a report that other people will use. A spreadsheet with clear group buttons is easier to navigate than one where someone has to scroll through hundreds of rows to find the summary. The person using your spreadsheet can click the outline buttons to see as much or as little detail as they need.
How to remove grouping
To remove grouping entirely, select any row or column in the group, go to Data > Ungroup, and choose whether to ungroup rows or columns. The group buttons will disappear and all rows or columns will stay visible.
If you just want to collapse a group temporarily without removing it, click the minus sign next to that group. The group structure stays in place; you're just hiding the rows or columns for now. Click the plus sign to show them again.
Frequently Asked Questions
Can I group non-adjacent rows?
No. Rows must be next to each other to group them. If your rows aren't adjacent, sort your data first so the rows you want to group are together, then create the group.
What if I group the wrong rows by mistake?
Click Undo (Ctrl+Z on Windows, Command+Z on Mac) to remove the group when ready. Or select the grouped rows and go to Data > Ungroup to remove just that group without undoing other changes.
Do grouped rows print if I print the spreadsheet?
Yes. Grouping only hides rows on screen. When you print, Excel prints all rows, whether they're collapsed or expanded. If you want to print only certain rows, use filtering instead of grouping.
Can I group rows and columns at the same time?
You can have row groups and column groups in the same spreadsheet, but you create them separately. Group your rows first, then group your columns. They won't interfere with each other.