Grouping in Excel lets you collapse and expand rows or columns with a single click, and ungrouping reverses it—select the grouped rows or columns, then press Shift+Alt+Right Arrow to group or Shift+Alt+Left Arrow to ungroup on Windows (Cmd+Shift+K / Cmd+Shift+J on Mac). This feature is built into Excel for organizing large datasets, hiding detail temporarily, and creating collapsible sections in reports without deleting data.
What Grouping Actually Does
Grouping does not hide data permanently or delete it. It creates an outline level (1, 2, 3…) on the left side for rows or the top for columns. Clicking the minus sign collapses the group; clicking the plus sign expands it. The data stays intact—only the view changes. This is different from filtering, which removes rows from view based on criteria, or hiding, which requires manual unhide steps. Grouping is reversible instantly and can be saved with the workbook.
How to Group Rows or Columns (Step by Step)
- Select the rows or columns you want to group. For rows, click the row numbers; for columns, click the column letters. You can select non-adjacent ranges by holding Ctrl (Cmd on Mac) while clicking.
- Go to the Data tab on the ribbon.
- In the Outline group, click Group.
- Choose Rows or Columns in the dialog (or use the keyboard shortcut directly).
Keyboard shortcuts: Windows—Shift+Alt+Right Arrow to group, Shift+Alt+Left Arrow to ungroup. Mac—Cmd+Shift+K to group, Cmd+Shift+J to ungroup. These work on the selected range. For Excel for the web, the Data tab has Group and Ungroup buttons, but keyboard shortcuts may not work consistently—use the ribbon buttons instead.
Grouping Whole Sheets vs. Rows/Columns
People often confuse grouping rows/columns with grouping sheets. Sheet grouping (selecting multiple sheet tabs) lets you enter data or format multiple sheets at once—it does not collapse anything. To group sheets, click a tab, hold Ctrl (Cmd on Mac), and click other tabs. To ungroup, right-click any tab and choose Ungroup Sheets. This is a separate feature entirely.
Nested Groups and Outline Levels
You can create multiple levels of grouping. For example, group months within a quarter, then group quarters together. Excel automatically assigns outline levels: level 1 is the outermost group, level 2 the next, and so on. The outline bar shows plus/minus buttons at each level. To create nested groups, first group the inner range (e.g., Jan–Mar), then select the entire range including those rows (e.g., Jan–Dec) and group again. Excel will treat the second as a higher level. You can have up to 8 levels of nesting.
Common Problems and How to Fix Them
- Group option is grayed out: This happens when the sheet is protected. Go to Review > Unprotect Sheet, or ensure the “Allow users to edit ranges” setting permits outlining.
- Grouping works but minus signs don’t show: Go to File > Options > Advanced, and under “Display options for this worksheet,” check “Show outline symbols if an outline is applied.”
- Ungroup removes all levels at once: Excel’s Ungroup dialog lets you choose “Rows” or “Columns” and whether to remove the entire outline. To remove only one level, use the “Clear Outline” option under Data > Outline > Ungroup > Clear Outline, then re-group the levels you want.
- Grouping a filtered range: Grouping works on visible rows, but if you group while a filter is active, it may group the visible rows only, which can cause confusion. Clear the filter first.
- Cannot group columns with merged cells: Merged cells can interfere. Unmerge them, group, then re-merge if needed.
Grouping vs. Hiding vs. Filtering
Grouping is the most flexible because it is one click to collapse/expand and does not alter the data order. Hiding (right-click > Hide) is simpler but requires manual unhide, and hidden rows/columns can be easily missed. Filtering (Data > Filter) is for selecting rows based on values, not for organizing layout. Use grouping when you want a collapsible report structure; use hiding when you want to temporarily remove a few rows; use filtering when you need to find specific data.
Practical Examples and Tips
- Financial statements: Group monthly columns under each quarter, then group quarters under the year. Click level 2 to see only quarters, level 1 to see the annual total.
- Project plans: Group subtask rows under each milestone, then group milestones under the project phase.
- Data entry forms: Group optional fields so users can collapse them if not needed.
- Printing: Collapsed groups print only the visible rows, so you can print a summary without deleting detail.
- Auto Outline: If your data has summary formulas (like SUM) in a consistent pattern, try Data > Outline > Auto Outline—Excel may detect the structure automatically.
Remember, grouping does not affect formulas or references. A SUM formula still references all rows, even if some are collapsed. Collapsing only changes what you see.
Frequently Asked Questions
How do I ungroup all rows at once?
Select the entire sheet by clicking the triangle at the top-left corner (or press Ctrl+A twice on Windows, Cmd+A on Mac). Then go to Data > Outline > Ungroup > Clear Outline. This removes all grouping levels but keeps your data intact.
Why can’t I group in Excel on Mac?
Grouping is available in Excel for Mac. Use the Data tab > Group, or the keyboard shortcut Cmd+Shift+K. If it’s grayed out, check if the sheet is protected or if you have a filtered range. Also, ensure you have selected entire rows or columns, not just cells.
Does grouping work in Excel for the web?
Yes, but with limitations. Excel for the web supports grouping and ungrouping via the Data tab, and you can collapse/expand groups. However, keyboard shortcuts may differ—use the ribbon buttons. Nested groups work, but some advanced outline options like Auto Outline are not available in the web version.
Can I group non-adjacent rows?
Yes, you can select non-adjacent rows by holding Ctrl (Cmd on Mac) while clicking row numbers, then group them. Excel will create a single group that spans the entire range from the first to last selected row, including the unselected rows in between. If you want truly separate groups, group each range individually.
What is the difference between group and subtotal?
Subtotal (Data > Subtotal) automatically inserts subtotal rows and creates groups for each category. Grouping is manual and does not insert any formulas. Subtotal is for summarizing data by a category, while grouping is for organizing any rows or columns you choose.
How do I remove only the outermost group level?
Click the outermost group’s minus sign to collapse it, then select the rows or columns that are part of that group (the entire range), and press Shift+Alt+Left Arrow (Windows) or Cmd+Shift+J (Mac). This removes one level at a time. Repeat for each level you want to remove.
Related
- How to Write “h” on a Calculator
- Records Management Data Entry: A Complete Guide
- Give Me a Random Number 1-5? Here’s Your Answer
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- Repair Excel in Windows 11: Practical Fixes and StepsTo repair Excel in Windows 11, first restart your PC and check whether the problem affects Excel itself…
- Insert a Check Box in Word 2016: Clickable or PrintableTo add a box that readers can click in Word 2016, open the Developer tab and choose Developer…
- Remove Duplicates in Excel: A Clear Step-by-Step GuideTo remove duplicates in Excel for Microsoft 365 on Windows, select your full data range, choose Data >…
- Excel Undo Shortcut: Ctrl+Z and How It WorksIn Excel for Microsoft 365 on Windows, press Ctrl+Z to undo your most recent action; on a Mac,…
- Outlook Form Templates: Create and Save OneTo create a reusable custom form in classic Outlook for Windows, enable the Developer tab, choose Developer >…
- Data Entry Software for Small Surveys? Best PicksThe best data entry software for a small survey is a free or low-cost online form tool like…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.