Grouping in Excel means collapsing or expanding rows and columns to hide or show detail, and the feature is called Group (found on the Data tab in the Outline group). To group rows or columns, select them, press Shift+Alt+Right Arrow (Windows) or Command+Shift+K (Mac), and Excel adds outline buttons (+/−) that let you collapse or expand the selection.
What Grouping Does in Excel
Grouping is a way to organize large worksheets by hiding detail rows or columns behind a summary. When you group rows 2 through 10, for example, Excel places a bracket on the left side of the row numbers and a minus sign (−) above the group. Clicking that minus sign collapses the group, hiding rows 3–10 and leaving row 2 visible (if it’s the summary row). Clicking the plus sign (+) that replaces it expands the group again.
Grouping is different from simply hiding rows or columns because it creates a permanent, toggleable outline. You can nest groups inside other groups (up to 8 levels), which is useful for hierarchical data like financial statements, budgets, or product categories. The outline symbols (1, 2, 3…) at the top-left of the worksheet let you show or hide all groups at a given level at once.
How to Group Rows or Columns in Excel
The fastest method is to select the rows or columns you want to group, then use the keyboard shortcut:
- Windows:
Shift+Alt+Right Arrow(group) andShift+Alt+Left Arrow(ungroup) - Mac:
Command+Shift+K(group) andCommand+Shift+J(ungroup)
Alternatively, use the ribbon:
- Select the rows or columns you want to group (for example, rows 2 to 10).
- Go to the Data tab.
- In the Outline group, click Group.
- In the dialog box, choose Rows or Columns and click OK.
To ungroup, select the grouped rows/columns and press Shift+Alt+Left Arrow (Windows) or Command+Shift+J (Mac), or go to Data > Ungroup. If you want to remove all grouping at once, select the entire sheet, then Data > Ungroup > Clear Outline.
Grouping vs. Subtotals and Auto Outline
Excel’s Subtotal feature (Data > Outline > Subtotal) automatically inserts subtotal rows and creates groups for you. It works best when your data is sorted by a category column and has numeric values to sum. For example, if you have sales data with a “Region” column and an “Amount” column, Subtotal can insert a SUM row for each region and group those rows, giving you a collapsible outline.
Auto Outline (Data > Outline > Group > Auto Outline) is another option: Excel analyzes your worksheet and groups rows or columns based on formulas that reference detail cells. It works well when summary rows contain formulas like =SUM(B2:B10) and detail rows have no formulas. If Excel can’t detect a clear pattern, it may not create groups, and you’ll need to group manually.
Tips for Choosing What to Group
Grouping is most useful when you have a clear hierarchy: summary rows at the top (or bottom) and detail rows beneath. Here are practical guidelines:
- Group rows that belong to the same category, such as all expense entries for a department.
- Group columns that represent time periods, like months in a quarterly report, so you can collapse them to show only quarterly totals.
- Keep summary rows outside the group, so they remain visible when the group is collapsed. For example, if row 2 is a total, group rows 3 through 10, not row 2.
- Use nested groups for multi-level hierarchies: group all detail rows under a subcategory, then group those subcategories under a main category.
- Avoid grouping entire rows that contain important data you need to see at all times—group only the detail.
Common Problems and How to Fix Them
Problem: The +/− buttons don’t appear. This usually happens when the worksheet has “Show outline symbols if an outline is applied” disabled. Go to File > Options > Advanced, scroll to “Display options for this worksheet,” and check “Show outline symbols if an outline is applied.” On Mac, go to Excel > Preferences > View and check the same option.
Problem: Grouping is grayed out. Grouping is not available in Excel for the web. You can only group in the desktop versions (Windows and Mac). If you’re using Excel for the web, you’ll need to open the file in the desktop app.
Problem: The group collapses but the summary row also hides. This happens when you included the summary row in the group. Ungroup and regroup, making sure the summary row is outside the selected range.
Problem: You can’t group because of merged cells. Merged cells can interfere with grouping, especially when grouping columns. Unmerge the cells in the range you want to group, or group only rows that don’t contain merged cells.
Keyboard Shortcuts and Mac Differences
Keyboard shortcuts are the fastest way to group and ungroup:
- Group (Windows):
Shift+Alt+Right Arrow - Ungroup (Windows):
Shift+Alt+Left Arrow - Group (Mac):
Command+Shift+K - Ungroup (Mac):
Command+Shift+J
On Mac, the ribbon path is the same: Data tab > Outline > Group. Note that Excel for the web does not support grouping at all, so you must use the desktop version.
Alternatives to Grouping
If grouping doesn’t fit your needs, consider these alternatives:
- Hide/Unhide: Right-click a row or column header and choose Hide. This is simpler but doesn’t provide toggle buttons; you must unhide manually.
- Filtering: Use Data > Filter to hide rows that don’t match criteria. This is useful when you want to focus on specific values, but it doesn’t create an outline.
- PivotTables: For summarizing large datasets, a PivotTable lets you expand and collapse fields interactively, which is more flexible than static grouping.
- Custom Views: Save different display states (including hidden rows/columns) as custom views via View > Custom Views, so you can switch between layouts quickly.
Frequently Asked Questions
Q: Can I group rows and columns at the same time? Yes. You can group rows and columns independently. For example, group rows 2–10 and columns B–D. The outline symbols will appear on both the row header and column header areas.
Q: Why can’t I group in Excel for the web? Grouping is a desktop-only feature. Microsoft has not implemented it in Excel for the web as of this writing. If you need to group, open the workbook in the Excel desktop app.
Q: How do I remove all grouping at once? Select the entire sheet (click the triangle at the intersection of row and column headers), then go to Data > Ungroup > Clear Outline. This removes all groups and outline levels.
Q: Does grouping affect formulas or calculations? No. Grouping only hides rows or columns visually; it does not change the data or formulas. Formulas still reference the hidden cells, and calculations remain the same.
Q: Can I group non-adjacent rows? No. You must select contiguous rows or columns to group. If you need to group non-adjacent rows, consider using a PivotTable or restructuring your data.
Q: What is the maximum number of group levels? Excel supports up to 8 levels of nested grouping. This is usually more than enough for most worksheets.
Related
- Generate 100 Random Numbers: How to Do It
- YEARFRAC in Google Sheets: How to Use It
- Google Sheets Split Column by Delimiter
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- How to Open SharePoint Files in the Excel AppTo open a SharePoint workbook in the desktop Excel app, find the file in its SharePoint document library,…
- Split Feature in SOLIDWORKS: What It Does and HowThe SOLIDWORKS Split feature divides one solid part into multiple separate solid bodies, using a plane, face, or…
- How to Ungroup in Excel: Sheets, Rows, and ColumnsTo ungroup worksheets in Excel for Microsoft 365 on Windows, right-click one of the selected sheet tabs and…
- Excel Table Styles: How to Apply and Customize ThemAn Excel table style is a coordinated set of formatting applied to an Excel table, such as a…
- Python String Z-Transform: What It Is & How to Use ItPython strings do not have a built-in “z-transform” method, but the term usually refers to two distinct things:…
- Car Loan Amortization Schedule in Google SheetsYes. In Google Sheets, enter the amount financed, annual interest rate, and loan term, calculate the monthly payment…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.