What grouping does in Excel
Grouping in Excel lets you collapse and expand sections of rows or columns with a single click. When you group rows or columns, Excel adds a small minus sign (−) or plus sign (+) next to them. Click the minus to hide that section; click the plus to show it again. This is useful when you have a large spreadsheet with detailed data you don't always need to see.
Grouping is different from filtering. Filtering hides rows based on what's in them; grouping hides rows based on their position and structure. You can group the same data multiple ways, and the grouping stays in place until you remove it.
Key Takeaways
- Select the rows or columns you want to group, then use the Data menu to create the group.
- Excel adds outline buttons (+ and −) on the left side of rows or above columns so you can expand and collapse the group.
- You can create nested groups — groups within groups — by selecting and grouping different ranges at different sizes.
- Ungrouping removes the outline buttons and returns the spreadsheet to normal view.
How to group rows
Start by selecting all the rows you want to group together. Click 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.
Once your rows are selected, go to the Data menu at the top. Click it, then look for the Group option. Click Group, then select Group again from the submenu (not "Hide"). Excel will add a small outline box with a minus sign on the left side of your spreadsheet, next to the selected rows.
Click the minus sign to collapse the group and hide those rows. The minus becomes a plus sign. Click the plus to expand the group and show the rows again. You can create multiple separate groups in the same spreadsheet — each one gets its own outline button.
How to group columns
Grouping columns works the same way as grouping rows, but you select columns instead. Click the column letter of the first column you want to group, then hold Shift and click the column letter of the last column. The columns will highlight in blue.
Go to Data > Group > Group. Excel adds an outline box with a minus sign above your selected columns. Click the minus to hide those columns; click the plus to show them again.
Column grouping is helpful when you have many months of data (January through December) or many similar categories side by side that you want to hide temporarily without deleting them.
Creating nested groups (groups within groups)
You can create multiple levels of grouping so that some rows collapse into others. For example, you might have 12 rows of monthly sales data, and you want to group months 1–4 together, months 5–8 together, and months 9–12 together. Then you could group all 12 months as a single larger group.
To do this, start with the smallest groups first. Select rows 1–4 and group them. Then select rows 5–8 and group them. Then select rows 9–12 and group them. Now select all rows 1–12 and group them again. Excel will create outline buttons at different levels on the left side. You'll see numbers (1, 2, 3) that let you collapse to different depths — click 1 to hide everything, click 2 to show only the first level of groups, click 3 to show all rows.
How to ungroup rows or columns
To remove grouping, select the grouped rows or columns again. Go to Data > Group > Ungroup. The outline buttons disappear, and the rows or columns return to normal. If you have nested groups, you can ungroup one level at a time or ungroup everything at once.
If you want to remove all grouping in your spreadsheet at once, select all cells by clicking the box in the top-left corner (where the row numbers and column letters meet), then go to Data > Group > Ungroup. All outline buttons will disappear.
Common mistakes when grouping
The most common mistake is selecting non-consecutive rows or columns. Grouping only works on rows or columns that are next to each other. If you need to group rows 1–5 and rows 10–15 separately, create two different groups — don't try to select both ranges at once.
Another mistake is confusing grouping with hiding. If you right-click on a row and select Hide, that's different from grouping. Hidden rows don't have outline buttons, and they're harder to find later. Use grouping when you want outline buttons; use hiding only when you need to hide a single row or a few rows temporarily.
If your outline buttons disappear or don't appear where you expect them, make sure you're using Data > Group, not the Format menu. Some versions of Excel also have a Group option in the Format menu, but it's not the same thing.
When grouping is useful
Grouping works well for financial reports where you have detailed line items under category headers. You can group all the expense details under "Office Supplies," all the travel expenses under "Travel," and so on. Then collapse to see only the category totals.
Grouping also helps with project timelines. If you have a spreadsheet with tasks broken down by week, you can group all tasks in Week 1 together, all tasks in Week 2 together, and so on. Then collapse to see only the week-level view.
For data with many columns, grouping lets you hide supporting calculations or raw data while keeping summary columns visible. For example, you might group columns B through G (which contain formulas) and leave column H (the final result) visible.
Frequently Asked Questions
Can I group non-consecutive rows?
No. Grouping only works on rows or columns that are next to each other. If you need to hide non-consecutive rows, use the Hide feature instead: right-click the row number and select Hide.
What's the difference between grouping and filtering?
Grouping hides rows or columns based on their position and adds outline buttons you control. Filtering hides rows based on the values in them and shows only rows that match your criteria. Use grouping for structure; use filtering to find specific data.
Can I print a spreadsheet with groups collapsed?
Yes. When you print, Excel prints only the rows and columns that are currently visible. If you collapse a group before printing, the hidden rows won't print. This is useful for printing summary reports without all the detail.
How do I remove grouping from just one section?
Select the rows or columns in that group, then go to Data > Group > Ungroup. Only that group will be removed. Other groups in the spreadsheet stay in place.
What if the Group option is grayed out?
The Group option is grayed out when no rows or columns are selected, or when you've selected only one row or column. Select at least two consecutive rows or columns, then try again.