Excel grouping lets you collapse and expand sections of your spreadsheet
Grouping in Excel hides rows or columns under a collapsible button, so you can show and hide large sections of data without deleting anything. When you group rows or columns, Excel adds a small minus sign (−) next to the grouped section. Click it to collapse the group and hide those rows or columns; click the plus sign (+) that appears to expand them again. This is useful when you have detailed data you want to keep but don't always need to see — like monthly breakdowns under yearly totals, or individual line items under category subtotals.
Key Takeaways
- Select the rows or columns you want to hide, then go to Data > Group to create a collapsible section.
- Excel adds outline buttons (−/+) on the left side of rows or above columns so you can toggle visibility.
- You can create multiple nested groups, and Excel's outline levels let you collapse everything at once to show only summary rows.
- Ungrouping removes the collapse buttons but keeps all your data intact.
How to group rows in Excel
Select all the rows you want to hide under a group. Click the row number on the left to select an entire row; hold Shift and click another row number to select a range. For example, if you have sales data for January through November under a December total row, select rows 2 through 12 (the detail rows), then leave row 13 (the total) unselected.
Go to the Data tab at the top of the ribbon. Click Group — it's in the Outline section on the right side of the Data tab. Excel will add a minus sign (−) button to the left of your selected rows. Click that button to collapse the group and hide those rows; the minus becomes a plus (+), and clicking it expands them again.
If you have multiple levels of detail — for instance, weeks within months within quarters — you can group them separately. Group the smallest sections first (weeks), then select and group the larger sections (months). Excel will stack the outline buttons, and you can click the numbered outline levels (1, 2, 3) on the far left to show only that level of detail across the whole sheet.
How to group columns in Excel
Select the columns you want to group by clicking the column letter at the top. Hold Shift and click another column letter to select a range. For example, if you have sales data split into January, February, and March columns and you want to hide them under a "Q1" column, select those three columns.
Go to Data > Group. Excel adds a minus sign (−) button above your selected columns. Click it to hide those columns; the button becomes a plus (+) to expand them again. Column grouping works the same way as row grouping — you can create nested groups and use the outline levels to show only summary columns.
Creating nested groups for multi-level data
Nested groups let you collapse data at different levels of detail. Start by grouping the smallest sections — the most detailed rows or columns. Then select a larger range that includes those already-grouped sections and group again. Excel will add another set of outline buttons.
For example, you might have individual transaction rows grouped by day, then those day-groups grouped by week, then week-groups grouped by month. Click the outline level numbers (1, 2, 3, 4) on the left to jump between levels: level 1 shows only the grand total, level 2 shows monthly totals, level 3 shows weekly totals, and level 4 shows all detail. This is much faster than manually collapsing and expanding each group.
Ungrouping rows or columns
Select the grouped rows or columns you want to ungroup. Go to Data > Ungroup. The minus and plus buttons disappear, but all your data stays in place — ungrouping only removes the collapse buttons, it does not delete anything.
If you have nested groups and want to remove only one level, select just that level's rows or columns before ungrouping. To remove all groups at once, select all cells (Ctrl+A) and then ungroup.
When grouping does not work as expected
Grouping requires that the rows or columns you select are contiguous — they must be next to each other with no gaps. If your data has blank rows or columns in the middle, Excel will not let you group across the gap. Delete the blank row or column, group, then add it back if you need it for formatting.
If the Group button is grayed out, check that you have selected at least two rows or columns. Grouping a single row or column does not work. Also make sure you are on the Data tab — the Group button does not appear on other tabs.
Grouping with subtotals
Excel's Subtotals feature automatically groups your data and adds summary rows at the same time. Go to Data > Subtotals. Excel will sort your data by a column you choose, insert subtotal rows at each change in that column, and create groups automatically. For instance, if you have a list of sales by region, Subtotals can group by region and add a sum row after each region's data.
Subtotals is faster than grouping manually if your data is already sorted or if you want both the groups and the summary calculations at once. After Subtotals runs, you get the same outline buttons as manual grouping, so you can collapse and expand the same way.
Frequently Asked Questions
Can I group non-adjacent rows or columns?
No. Grouping requires rows or columns to be next to each other. If you need to hide non-adjacent sections, you will have to group them separately, or hide them manually by right-clicking and selecting Hide.
What happens to groups when I save and reopen the file?
Groups are saved with your file. When you reopen it, the groups are still there, and the rows or columns stay in whatever state they were in when you saved — collapsed or expanded.
Can I group rows and columns at the same time?
No. You must group rows and columns separately. Select and group your rows first, then select and group your columns in a separate step.
How do I remove all groups from my sheet at once?
Select all cells by pressing Ctrl+A, then go to Data > Ungroup. Excel will remove all group buttons from the entire sheet while keeping your data intact.
Does grouping work in Excel Online?
Yes. Excel Online supports grouping through the Data menu, though the interface is slightly different. The collapse and expand buttons work the same way as in the desktop version.