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, Excel adds a minus sign (–) next to the row numbers on the left side of your sheet. Click that minus sign and the grouped rows hide. Click the plus sign (+) that appears and they show again. You can group multiple sections independently, so you might hide rows 5–10 while keeping rows 15–20 visible.

Grouping is useful when your spreadsheet has natural sections — like monthly data within a year, or product categories with individual items underneath. It keeps your sheet readable without deleting anything, and you can show the detail whenever you need it.

Key Takeaways

  • Select the rows or columns you want to hide together, then use the Data menu to create a group that collapses with one click.
  • Excel adds outline buttons (minus and plus signs) on the left or top edge of your sheet so you can toggle each group open or closed.
  • You can create nested groups — groups within groups — and collapse them at different levels to show only the summary you need.
  • Grouping does not move, delete, or change your data; it only hides rows or columns temporarily.

How to group rows in Excel

Select all the rows you want to group together. 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.

Go to the Data menu at the top of the screen. Click Group. A dialog box may appear asking whether you want to group by rows or columns — choose Rows. Excel will add outline buttons to the left side of your sheet. A minus sign (–) appears next to the grouped rows. Click it to hide those rows; a plus sign (+) replaces it. Click the plus sign to show them again.

If you want to group multiple separate sections, repeat this process for each section. Each group gets its own collapse button, so you control them independently.

How to group columns in Excel

Select the columns you want to group by clicking the column letter of the first column, then holding Shift and clicking the column letter of the last column. The columns will highlight in blue.

Go to the Data menu and click Group. Choose Columns from the dialog. Excel adds outline buttons above your columns. A minus sign appears above the grouped columns. Click it to hide those columns; click the plus sign to show them again.

Column grouping works the same way as row grouping — you can create multiple independent groups and collapse or expand each one separately.

Creating nested groups (groups within groups)

You can group rows or columns, then group some of those grouped rows or columns again to create a hierarchy. For example, you might group individual months (April, May, June) into a "Spring" group, then group all the seasonal groups (Spring, Summer, Fall, Winter) into a "Year" group.

To create nested groups, first create your smallest groups. Then select a larger range that includes those groups and group again. Excel will add multiple sets of outline buttons — one for each level. The outermost buttons control the largest groups; the innermost buttons control the smallest ones. You can click any button to collapse or expand just that level.

Nested groups are helpful for financial reports (individual transactions grouped by month, months grouped by quarter, quarters grouped by year) or inventory sheets (individual items grouped by category, categories grouped by department).

How to ungroup rows or columns

Select the grouped rows or columns you want to ungroup. Click the Data menu and choose Ungroup. The outline buttons disappear and the rows or columns stay visible.

If you have nested groups and want to remove only one level, select just the rows or columns in that level before clicking Ungroup. To remove all groups at once, select all cells in your sheet (press Ctrl+A or Cmd+A), then go to Data and click Ungroup.

What happens when you save or print grouped sheets

When you save a file with groups, Excel remembers which groups are collapsed and which are expanded. The next time you open the file, the groups will be in the same state you left them.

When you print a grouped sheet, Excel prints only the rows and columns that are currently visible. If you have collapsed some groups, those hidden rows or columns will not appear on the printed page. Before printing, decide whether you want to show all details or keep some groups collapsed for a summary view.

Outline levels and the outline buttons

When you create groups, Excel adds numbered buttons (usually 1, 2, 3) at the top left of your sheet, above the row numbers. These are outline level buttons. Click the number 1 to collapse all groups and show only the top level. Click 2 to show the first two levels, and so on. This is faster than clicking individual minus signs when you have many groups.

For example, if you have months grouped into quarters, and quarters grouped into a year, clicking outline level 1 shows only the year total. Clicking level 2 shows the year and each quarter. Clicking level 3 shows everything — year, quarters, and individual months.

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 non-consecutive rows, you can hide them individually instead — right-click the row number, choose Hide, and repeat for each row you want hidden. But grouping works only on continuous ranges.

What if I accidentally ungroup everything?

Press Ctrl+Z (or Cmd+Z on Mac) to undo the ungroup action. Your groups will come back. You can undo multiple times to go back several steps if needed.

Can I group rows and columns at the same time?

No. You group rows separately from columns. Select and group your rows first, then select and group your columns. Both sets of groups will work independently on the same sheet.

Do grouped rows take up less file space?

No. Grouping only hides rows or columns; it does not remove them or compress them. Your file size stays the same whether groups are collapsed or expanded.

Can I copy grouped data to another sheet?

Yes, but the groups do not copy. If you copy rows from a grouped sheet and paste them into another sheet, the data arrives without the grouping. You would need to create new groups in the destination sheet if you want them.