What grouping does and when to use it

Grouping in Excel lets you collapse and expand rows or columns so you can hide detail and show only the summary you need. When you group cells, Excel adds a small minus sign (–) next to the grouped rows or columns. Click that minus sign and the detail disappears; click the plus sign (+) that replaces it and the detail comes back. You are not deleting anything — you are just folding the spreadsheet so you can focus on what matters right now.

Grouping works best when your data has a clear structure: months within quarters, individual transactions within department totals, or line items within invoice numbers. If your spreadsheet is flat with no hierarchy, grouping will not help. But if you have subtotals or categories that nest inside each other, grouping turns a wall of numbers into something you can actually navigate.

Excel groups rows and columns separately. You might group rows to hide individual sales and show only the regional totals, then group columns to hide the monthly breakdowns and show only the quarterly sums. Both work the same way.

Key Takeaways

  • Select the rows or columns you want to group, then use the Data menu and choose Group to add collapse buttons.
  • The minus sign (–) collapses a group; the plus sign (+) expands it again, and your data stays intact.
  • You can create multiple levels of grouping so you can collapse to different amounts of detail.
  • Ungrouping removes the collapse buttons but does not change your data or formulas.
  • Grouping works only on contiguous rows or columns — they must be next to each other with no gaps.

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, then hold Shift and click the row number of the last row. All rows in between will highlight in blue. Make sure the rows are next to each other with no gaps — if row 5 is blank, you cannot group rows 3 through 7.

Once the rows are selected, go to the Data menu at the top and click it. A dropdown menu appears. Look for the word Group and click it. Excel adds a small box with a minus sign to the left of your selected rows, usually in a new column on the far left. That box is your collapse button. Click the minus sign and those rows fold up; click the plus sign that appears and they unfold again.

If you have multiple groups, Excel also adds outline level buttons at the very top left — usually numbered 1, 2, 3. Click the number 1 and all groups collapse at once. Click 2 and groups collapse one level deeper. This is useful when you have nested groups (groups within groups) and want to jump between views without clicking each minus sign individually.

How to group columns in Excel

Grouping columns works exactly like grouping rows, but you select columns instead. Click the column letter at the top (A, B, C, and so on) for the first column you want to group, then hold Shift and click the last column letter. The columns highlight in blue. Again, they must be next to each other.

Go to Data > Group. Excel adds a collapse button above your selected columns. Click the minus sign to hide those columns; click the plus sign to show them again. The outline level buttons appear above the column letters and work the same way as they do for rows.

A common use: you have sales data for January, February, and March in columns B, C, and D. You group those three columns, then group April, May, June in columns E, F, G. Now you can collapse each quarter separately, or use the outline level buttons to show only the quarter totals.

Creating nested groups (groups within groups)

You can group a group. Start by creating your first set of groups — say, individual months grouped into quarters. Then select a larger range that includes multiple groups and group that too. Excel stacks the outline level buttons so you can collapse to different depths.

For example: rows 2–4 are January, February, March (grouped as Q1). Rows 5–7 are April, May, June (grouped as Q2). Now select rows 2–7 (both groups together) and group them again. Excel adds a new outline level button. Click 1 and everything collapses. Click 2 and you see only the quarterly totals. Click 3 and you see the monthly detail again.

Nested groups are powerful but can confuse people reading your spreadsheet. Use them only when the hierarchy is clear from the data itself — like actual calendar quarters or actual department structures.

How to ungroup rows or columns

Select the grouped rows or columns the same way you selected them to group them: click the first row or column letter, hold Shift, click the last one. Go to Data > Ungroup. The collapse buttons disappear and the rows or columns stay visible. Your data and formulas do not change — you are only removing the fold buttons.

If you have nested groups and want to remove only one level, select just that group and ungroup it. The outer groups stay in place. If you want to remove all grouping at once, select all rows or all columns (Ctrl+A) and then ungroup.

Troubleshooting grouping problems

If the Group option is grayed out in the Data menu, you probably have non-contiguous rows or columns selected — meaning there is a gap between them. Click somewhere to deselect, then try again, making sure every row or column between your first and last selection is included.

If grouping is not working the way you expect, check whether your data actually has a structure that makes sense to group. Grouping works best when you have subtotals or categories. If your spreadsheet is just a flat list with no hierarchy, grouping will not help you see patterns — you might want to sort or filter instead.

If you collapse a group and then save the file, Excel remembers which groups are collapsed when you open it again. If you want the file to open with all groups expanded, expand everything before saving.

When to use grouping instead of filtering or sorting

Grouping, filtering, and sorting are three different tools. Sorting rearranges your rows in a new order. Filtering hides rows that do not match a condition you set, and you can change the condition anytime. Grouping folds rows or columns based on their position, and the fold buttons stay in place until you ungroup.

Use grouping when you want to keep the same view but toggle between detail and summary. Use filtering when you want to see only rows that meet a specific condition (like "sales over $1000"). Use sorting when you need a different order (like alphabetical or by date). You can combine all three in the same spreadsheet.

Frequently Asked Questions

Can I group non-adjacent rows?

No. Grouping requires contiguous rows or columns — they must be next to each other with no gaps. If you need to group rows that are not adjacent, you will need to rearrange your data first or use filtering instead.

Does grouping change my formulas or data?

No. Grouping only adds collapse buttons and hides or shows rows and columns. Your formulas, values, and calculations stay exactly the same. When you ungroup, everything looks the way it did before.

Can I group rows and columns at the same time?

You can have grouped rows and grouped columns in the same spreadsheet, but you group them separately. Select and group your rows first, then select and group your columns. The collapse buttons appear on different sides of the spreadsheet and work independently.

What happens if I delete a row inside a group?

The group stays in place, but it now contains one fewer row. If you delete all rows in a group, the group disappears. If you delete a row that is part of a nested group, the grouping structure adjusts automatically.

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 have groups collapsed, the hidden rows and columns will not print. Expand everything before printing if you want the full detail on paper.