What grouping cells means and when you need it

Grouping cells in Excel means collapsing rows or columns so they take up less space on your screen, then expanding them again when you need to see what's inside. Excel adds a small minus sign (−) next to the grouped rows or columns. Click it to hide them, and a plus sign (+) appears so you can click again to show them.

You group cells when you have a spreadsheet with many rows or columns organized by category — like monthly sales broken into weeks, or a budget with line items under each department. Grouping lets you show only the summary rows (the totals) and hide the detail rows until someone needs to see them. This makes the spreadsheet easier to read and lets different people work at different levels of detail.

Grouping is different from filtering or sorting. Those tools rearrange or hide data based on what you're looking for. Grouping creates a permanent structure that stays the same every time you open the file.

Key Takeaways

  • Select the rows or columns you want to hide, then go to the Data menu and click Group to add collapse buttons.
  • The minus sign (−) collapses your selection, and the plus sign (+) expands it again.
  • You can create multiple levels of grouping so users can collapse to different amounts of detail.
  • To remove grouping, select the grouped rows or columns and click Ungroup in the Data menu.
  • Grouping works best when your data is already sorted and organized by the categories you want to hide and show.

How to group rows in Excel

Start by organizing your data so that the rows you want to group together are next to each other. For example, if you have a budget with weeks 1 through 4 under January, put all four weeks in consecutive rows, then put February's weeks below them.

Click on the row number of the first row you want to hide. Hold Shift and click on the row number of the last row you want to hide. All the rows in between will turn blue, showing they are selected. Do not select the summary row (the one with the total) — select only the detail rows underneath it.

Go to the Data menu at the top of the screen. Click Group. Excel will add a small box with a minus sign (−) to the left of your selected rows. Click the minus sign to collapse those rows and hide them. The minus sign becomes a plus sign (+). Click the plus sign to expand and show them again.

If you have multiple groups, Excel also adds numbered buttons (1, 2, 3) to the left of the row numbers. Click button 1 to collapse all groups at once. Click button 2 to show the first level of detail, button 3 to show everything.

How to group columns in Excel

Grouping columns works the same way as grouping rows. Click on the column letter of the first column you want to hide. Hold Shift and click on the column letter of the last column you want to hide. All columns in between will turn blue.

Go to the Data menu and click Group. A collapse button appears above your selected columns. Click the minus sign to hide them, and the plus sign to show them again.

This is useful when you have many months of data (12 columns, one per month) and you want to show only the quarterly totals at first. Group January, February, and March together, then group April, May, and June together, and so on. Users can then click to expand only the months they need to see.

Creating multiple levels of grouping

You can nest groups inside other groups so that clicking one button collapses a large section, and clicking another button collapses a smaller section within it. This is called outline levels.

To create nested groups, first group your smallest sections. For example, group weeks 1 and 2 together, then group weeks 3 and 4 together. Then select all four weeks and group them again. Excel now shows buttons 1, 2, and 3 on the left. Button 1 hides everything. Button 2 shows only the month total. Button 3 shows the weeks and the month total.

Nested grouping works best when your data has a clear hierarchy — weeks inside months, line items inside departments, or products inside categories. Plan your grouping structure before you start, because adding or removing groups later can be confusing.

How to remove grouping

Click on any row or column number within the group you want to remove. You do not have to select all of them — one is enough. Go to the Data menu and click Ungroup.

If you have nested groups and want to remove only one level, click Ungroup and a small dialog box will appear asking which level to remove. Choose the level you want to delete and click OK. The collapse buttons for that level disappear, but the other levels stay.

If you want to remove all grouping at once, select every row or column in the spreadsheet (press Ctrl+A), go to the Data menu, click Ungroup, and choose to remove all levels. All collapse buttons disappear.

Common mistakes when grouping

The most common mistake is selecting the summary row along with the detail rows. If you select a total row and then group, the total will hide when you click the collapse button, and users will not see the number they are looking for. Always select only the rows or columns you want to hide, not the row that shows the result.

Another mistake is grouping data that is not sorted. If your weeks are out of order or your departments are scattered throughout the spreadsheet, grouping will not work the way you expect. Sort and organize your data first, then group.

A third mistake is creating too many levels of nesting. If you have buttons 1 through 6, most users will not understand what each one does. Stick to two or three levels at most.

Frequently Asked Questions

Can I group non-consecutive rows?

No. Excel groups only rows or columns that are next to each other. If your data is scattered, you need to sort it first so the rows you want to group are in a block. Then select and group them.

What happens to grouping when I save and reopen the file?

Grouping stays in place. When you reopen the file, the groups are still there, and they are in the same state (collapsed or expanded) as when you saved. This is why grouping is useful for templates or reports that many people use.

Can I print only the collapsed view?

Yes. If you collapse your groups before printing, Excel prints only what you see on screen. This is a quick way to print a summary without the detail rows. Expand the groups again before closing if you want to keep the full data visible for the next person who opens the file.

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 and adds collapse buttons. They serve different purposes and you can use both in the same spreadsheet.

What if I want to hide rows but not add collapse buttons?

Right-click on the row numbers you want to hide and click Hide. This hides the rows without creating a group structure. To show them again, select the rows on either side of the hidden rows, right-click, and click Unhide. Grouping is better if you want users to be able to show and hide rows themselves.