Grouping lets you collapse and expand sections of your spreadsheet without deleting anything
Grouping in Excel hides rows or columns temporarily so you can focus on the data you need right now. When you group, Excel adds a small minus sign (called a collapse button) next to the grouped rows or columns. Click it to hide them, click the plus sign to show them again. The data stays in your spreadsheet — you are just folding it out of view.
This is different from sorting or filtering. Grouping is useful when you have a spreadsheet with many rows or columns that belong together logically — like monthly data within a year, or detailed line items under category totals — and you want to switch between seeing the big picture and the details.
Key Takeaways
- Select the rows or columns you want to group, then use the Data menu to create the group, and Excel adds collapse buttons you can click to hide or show them.
- You can create nested groups (groups within groups) by selecting and grouping different ranges, and Excel numbers the levels so you can jump between detail and summary views.
- Grouping works best when your data has a clear structure, like subtotals at the end of each category or monthly columns within a year.
- To remove a group, select it and use the Data menu to ungroup, which restores the full view without changing any data.
How to group rows in Excel
Start by selecting the rows you want to group. Click the row number on the left side of the first row you want to include, then hold Shift and click the row number of the last row. All rows in between will highlight in blue.
Once the rows are selected, go to the Data menu at the top of the screen. Click it, then look for the word Group (in newer versions of Excel, it may say "Group" with a small arrow next to it). Click Group, then select Group Rows from the dropdown menu if one appears. Excel will add a small box with a minus sign to the left of your selected rows, usually in a new column at the far left of the spreadsheet.
Click the minus sign to hide those rows. The minus sign becomes a plus sign. Click the plus sign to show them again. You can create as many separate groups as you need in the same spreadsheet.
How to group columns in Excel
Grouping columns works the same way as grouping rows, but you select columns instead. Click the column letter at the top (like "A" or "B") for the first column you want to group. Hold Shift and click the letter of the last column in your group. All columns in between will highlight.
Go to the Data menu, click Group, then select Group Columns if a dropdown appears. Excel adds a collapse button above your selected columns. Click the minus sign to hide them, click the plus sign to show them again.
This is especially useful if you have months or quarters across the top of your spreadsheet and want to hide some months while you look at others, or if you have detailed expense categories that you want to collapse under a summary column.
Creating nested groups (groups within groups)
You can group your groups. This creates levels that let you jump between a full detailed view and a high-level summary view with a single click.
Start by creating your first group as described above. Then select a larger range that includes your first group plus additional rows or columns, and group that range too. Excel will add a second set of collapse buttons, usually numbered 1, 2, 3, etc., on the left or top edge of your spreadsheet.
Click the number buttons to jump between levels. Clicking "1" shows only the outermost summary. Clicking "2" shows the first level of detail. Clicking "3" shows everything. This is helpful in a budget spreadsheet where you have individual line items grouped by department, and those departments grouped by division — you can click "2" to see departments without all the line items, or click "3" to see everything.
When grouping works best
Grouping is most useful when your spreadsheet has a natural hierarchy. If you have subtotals or category totals already in place, grouping the detail rows above or below them makes sense. If your columns represent time periods (months, quarters, years), grouping them lets you hide the detail and focus on the summary.
Grouping is less useful if your data is flat — all rows are equally important and not organized into categories. In that case, filtering (which shows only rows that meet certain conditions) or sorting (which rearranges rows) may be more helpful.
How to remove a group
Select any row or column in the group you want to remove. Go to the Data menu, click Group, then select Ungroup. The collapse buttons disappear, and all rows or columns become visible again. Your data is unchanged — you are just removing the fold.
If you have nested groups and want to remove only one level, select the rows or columns in that specific group before you ungroup. If you select a range that includes multiple groups, Excel will ask which group you want to remove.
Grouping in different versions of Excel
The steps above work in Excel for Windows (versions 2016 and newer) and Excel for Mac (versions 2016 and newer). In older versions, the Group option may be in a different location or labeled slightly differently, but the concept is the same.
If you are using Excel Online (the free version in your web browser), grouping is not available. You can sort and filter, but you cannot create collapse buttons. If grouping is important for your work, you will need to read the desktop version of Excel or use a similar program like Google Sheets (which has a similar grouping feature called "Group rows" or "Group columns" in the Data menu).
Frequently Asked Questions
Can I group non-consecutive rows or columns?
No. You can only group rows or columns that are next to each other. If you need to hide rows 5 through 8 and rows 15 through 20, you create two separate groups. You cannot select row 5, skip rows 9 through 14, and select row 15 in a single group.
What happens to my groups when I save the file?
Your groups are saved with the file. When you open the spreadsheet again, the groups are still there in the same state — if you had hidden them, they stay hidden. If they were expanded, they stay expanded.
Can I print only the visible (ungrouped) rows?
Yes. When you hide rows or columns using groups, Excel prints only what is visible on screen. If you have collapsed a group, the hidden rows will not print. This is useful if you want to print a summary view without all the detail.
Is grouping the same as freezing panes?
No. Freezing panes keeps certain rows or columns visible while you scroll through the rest of the spreadsheet. Grouping hides rows or columns entirely behind a collapse button. They serve different purposes — use freezing if you want to keep headers visible while scrolling, and grouping if you want to hide detail temporarily.