Grouping rows and columns hides the details you don't need right now
Grouping in Excel lets you collapse and expand sections of your spreadsheet without deleting anything. When you group rows or columns, Excel adds a small minus sign (−) next to them. Click that sign to hide the group; click the plus sign (+) that appears to show it again. This is useful when you have a large spreadsheet with subtotals, monthly breakdowns, or nested categories — you can focus on the summary while keeping the detail available if you need it.
Grouping is different from filtering or sorting. Those tools rearrange or hide data based on what you search for. Grouping creates a permanent structure that stays the same every time you open the file. It's built into the spreadsheet itself, not a temporary view.
Key Takeaways
- Select the rows or columns you want to group, then use the Data menu to create the group — Excel adds collapse and expand buttons automatically.
- You can nest groups inside other groups, and Excel will number the outline levels so you can jump between detail and summary with one click.
- Grouping works best when your data has a clear hierarchy, like months within quarters, or product lines within regions.
- Grouped data stays grouped when you save and reopen the file, so you can set up the structure once and use it every time.
How to group rows in Excel
Select the rows you want to group. Click on the row number of the first row, then hold Shift and click the row number of the last row. All rows in between will highlight in blue. If the rows are not next to each other, hold Ctrl and click each row number individually.
Go to the Data menu at the top of the screen. Click Group, then select Group again from the dropdown. Excel will add a bracket on the left side of your rows with a minus sign (−) at the top. Click the minus sign to collapse the group and hide those rows. Click the plus sign (+) that appears to expand them again.
If you have multiple groups, you can nest them. Select a group of rows that includes an existing group, then repeat the process. Excel will create a second level of grouping. You'll see numbers (1, 2, 3) on the left margin — click those numbers to jump between outline levels. Clicking 1 shows only the outermost summary; clicking 2 shows one level of detail; clicking 3 shows everything.
How to group columns in Excel
The process for columns is identical to rows. Click on the column letter of the first column you want to group, then hold Shift and click the last column letter. Go to Data > Group > Group. Excel adds a bracket above the columns with collapse and expand buttons.
Grouping columns is useful when you have data spread across many months or quarters. For example, if columns B, C, and D contain January, February, and March sales, you can group those three columns under "Q1". Then columns E, F, and G become "Q2", and so on. Click the minus sign above Q1 to hide those three months and see only the quarterly totals in column A.
Setting up data so grouping works well
Grouping works best when your spreadsheet has a clear structure. If you're grouping rows, put your summary row (the total or average) either at the top or bottom of each group. Excel doesn't care which, but being consistent makes the spreadsheet easier to read. For example, if you're grouping by region, put the regional total at the bottom of all that region's rows.
If you're grouping columns, make sure related columns are next to each other. Don't scatter January data across columns B, E, and H — put all three months together. This way, when you group them, the grouping makes visual sense and matches how someone reading the spreadsheet would expect to see the data organized.
You can also use subtotals to create groups automatically. If your data is sorted by category, go to Data > Subtotals. Excel will add subtotal rows and create groups for you. This is faster than grouping by hand if you have many categories, but it only works if your data is sorted first.
Removing or adjusting groups
To remove a group, select any row or column in that group, go to Data > Group > Ungroup. The group disappears, but your data stays. If you have nested groups, you can ungroup just one level at a time or ungroup everything at once.
You cannot move or resize groups the way you move rows or columns. If you need to change which rows belong to a group, ungroup them, rearrange the rows, and group again. This is one reason to plan your data structure before you start grouping — it saves time later.
When grouping is better than filtering
Use grouping when you want a permanent structure that shows both detail and summary at the same time. Use filtering when you want to temporarily hide rows that don't match a specific value. Filtering is temporary — it disappears when you close the file or click "Clear Filter". Grouping stays.
For example, if you have a sales spreadsheet with rows for each product and a summary row for each region, grouping lets you collapse each region to see only the regional totals, then expand one region to see its products. Filtering would hide all products except the ones you search for, which is useful if you're looking for a specific item but not if you want to see the structure of the whole spreadsheet.
Printing grouped data
When you print a spreadsheet with groups, Excel prints whatever is currently visible on screen. If you've collapsed a group, the hidden rows won't print. This is useful if you want to print only the summary view. Before you print, collapse the groups you don't want to see, then go to File > Print.
If you want to print both the detail and the summary, expand all groups first. Click the highest outline level number on the left (usually 3 or 4) to show everything, then print.
Frequently Asked Questions
Can I group non-adjacent rows?
No. Groups must be made of rows or columns that are next to each other. If your data is scattered, rearrange it first so related rows are together, then group. You can use sorting or cut-and-paste to reorganize without losing data.
What's the difference between grouping and freezing panes?
Freezing panes keeps certain rows or columns visible while you scroll through the rest of the spreadsheet. Grouping collapses and expands sections. They do different things and can be used together — you might freeze the header row and also group the data rows below it.
Can I group data that has formulas?
Yes. Grouping doesn't affect formulas. If a row contains a SUM formula, that formula will still work when the group is collapsed or expanded. The grouped rows are just hidden, not deleted.
Will my groups stay if I share the file with someone else?
Yes. Groups are saved as part of the spreadsheet file. When someone else opens the file, they'll see the same groups and outline levels. They can expand or collapse groups, but they can't change the grouping structure unless they ungroup and regroup.
How many levels of grouping can I create?
Excel allows up to 8 levels of nesting. In practice, most spreadsheets use 2 to 4 levels. More than that becomes hard to read and navigate. If you need more than 8 levels, your data structure may be too complex for a single spreadsheet.