In Excel for Microsoft 365 on Windows, select the rows or columns and press Alt+Shift+Right Arrow to group them; press Alt+Shift+Left Arrow to ungroup. On a Mac, use Option+Shift+Right Arrow to group and Option+Shift+Left Arrow to ungroup. Grouping adds collapsible outline controls; ungrouping removes the outline for the selected rows or columns without deleting their contents.
What the Group and Ungroup Shortcuts Do
Excel’s grouping feature creates an outline around adjacent rows or columns. The outline adds controls, usually marked with plus and minus signs and level numbers, that let you hide detail temporarily and show it again. For example, you can group several daily transaction rows beneath a monthly total, then collapse those rows when you want a more compact summary.
Use the right-arrow shortcut to create a group and the left-arrow shortcut to remove one. The direction is easy to mix up: right means add a group; left means remove a group. These commands are not the same as hiding or deleting rows. A grouped row remains in the worksheet and can be expanded again, while deleting a row removes its data and hiding a row does not create an outline.
Grouping is useful when a worksheet has a clear detail-and-summary structure. It is not a formula or a data transformation: grouping does not calculate a total, change cell values, or rearrange records. It only gives you a way to show and hide selected worksheet sections.
How to Select Rows or Columns Before Grouping
Selection matters because Excel needs to know which worksheet dimension to outline. To group full rows, select their row-number headers. To group full columns, select the column-letter headers. Then press the grouping shortcut. For instance, selecting row headers 5 through 9 and pressing Alt+Shift+Right Arrow creates a group for those rows. Selecting column headers C through E creates a column group instead.
You can also select cells within the range you want to group and use the shortcut. Depending on the selection and worksheet layout, Excel may display a Group dialog asking whether you want Rows or Columns. Choose the appropriate option and confirm. If the result is not what you intended, use the matching ungroup shortcut, review the selection, and try again.
- For rows, select the row numbers for the full range whenever practical.
- For columns, select the column letters for the full range.
- Check that the selection does not include a total row or column that should remain visible outside the group.
Keeping a summary outside its detail group is often helpful. If a monthly total sits immediately below the transaction rows, for example, group only the transaction rows. The total can then remain visible when the detail is collapsed, making the outline easier to read.
Using the Ribbon Instead of a Shortcut
If the key combination is difficult to remember, or a laptop keyboard handles the keys differently, use Excel’s ribbon. Select the relevant rows or columns, open Data > Outline > Group, and choose Rows or Columns if Excel asks. To remove a group, select the grouped range and choose Data > Outline > Ungroup.
The ribbon is also useful when you want to confirm which command you are applying. The Group and Ungroup commands operate on the selection, so selecting an unintended range can create or remove the wrong outline. If the Outline group is not visible on the Data tab, the ribbon may be compressed because the Excel window is narrow; widening the window can reveal commands that are otherwise condensed.
Excel for the web can have different shortcut behavior because browser and operating-system shortcuts may take precedence. If the key combination does not work in a browser, use the Data tab’s outline commands if they are available in that workbook, or open the file in the desktop app for the keyboard workflow described here.
Understanding Outline Levels and Nested Groups
Groups can be nested. Suppose a report contains transaction lines, weekly subtotals, and monthly totals. You might group transaction lines within each week, then group the weekly sections within each month. Excel shows outline level buttons, commonly numbered 1, 2, and 3, that control how much detail is displayed. A lower level number generally shows a more summarized view; a higher number reveals more detail.
Collapsing a group hides its rows or columns from view but does not erase them. Use the plus sign beside a collapsed group to expand it, or use the outline level buttons to show a broader level of detail across the worksheet. Excel supports up to eight outline levels, but a complicated outline can be hard to navigate. A few well-planned levels are usually easier for other people to understand than many small, overlapping groups.
When adding a nested group, select the exact inner range rather than the entire area by habit. For example, group the transaction lines for each week first, then group the weekly blocks if a higher-level monthly collapse is useful. The outline’s summary rows and placement settings can affect how the levels appear, so check the result with the level buttons after creating groups.
Ungrouping Is Not the Same as Clearing an Outline
Ungroup removes grouping from the selected rows or columns. It does not remove the values, formulas, formatting, or worksheet rows themselves. If a range has nested groups, you may need to ungroup more than once, selecting the relevant level each time. If Excel presents a Rows or Columns choice, select the dimension whose grouping you want to remove.
Use Clear Outline only when you intend to remove the worksheet’s outline structure more broadly. In the Data tab’s Outline area, open the Ungroup menu and choose Clear Outline. This is different from removing one selected group: it clears the outline groups on the sheet. It still does not delete the underlying worksheet data, but it removes the convenient expand-and-collapse structure, so use it carefully if the outline took time to build.
If you only need to hide a group temporarily, do not ungroup it. Click its minus control to collapse it, then click the plus control when you need the detail again. Ungrouping is for changing the outline itself; collapsing is for changing what is currently visible.
Common Shortcut Problems and Their Fixes
If the shortcut appears to do nothing, first check the selection. A cell selection may not make the intended row-versus-column choice obvious, whereas selecting row numbers or column letters does. Also check that the sheet is not protected in a way that prevents changes, and confirm that Excel has focus rather than another window or an active text-editing field.
- The wrong dimension is grouped: Undo immediately if appropriate, then select row headers or column headers explicitly before trying again.
- A dialog appears: This is a request to specify Rows or Columns. Choose the intended option rather than assuming Excel has inferred it.
- The keyboard combination is intercepted: Some keyboard layouts, language-switch settings, remote-desktop tools, or browser shortcuts can capture Alt+Shift. Use the Data tab commands or adjust the selection and shortcut method.
- Plus and minus controls are missing: Check whether the sheet has an outline and whether outline symbols are displayed. In desktop Excel for Windows, the outline symbols setting is available under File > Options > Advanced, in the display options for the worksheet.
- Ungroup seems to remove the wrong level: Select the rows or columns at the intended outline level and repeat only if another nested level also needs removal.
One frequent misconception is that the shortcut to ungroup is the same as the shortcut to unhide. They are separate actions. Excel’s row and column hide or unhide commands affect visibility, while Group and Ungroup manage outline structure. If a row is merely hidden, ungrouping will not necessarily reveal it; use the appropriate unhide command or the row/column context menu instead.
Grouping Compared With Hiding Rows
Use grouping when people should be able to expand and collapse a meaningful section repeatedly. It is especially handy for reports with a hierarchy, such as product details under category totals or individual expenses under department totals. The outline controls make the relationship between summary and detail visible and provide a quick way to switch between levels.
Use ordinary hiding when you need to conceal a few rows or columns without building a hierarchy. Hidden rows do not provide the same outline level controls, and the relationship between hidden details and a summary may be less obvious. Neither hiding nor grouping is a security measure: people with access to a workbook may be able to reveal hidden or collapsed data. Do not rely on either feature to protect confidential information.
A Practical Workflow for a Clean Outline
Before grouping, identify the ranges that belong together and decide which totals should remain visible when details are collapsed. A simple monthly expense sheet, for example, might have one subtotal row after each month’s daily entries. Group only the daily-entry rows for each month, leaving the subtotal outside the group. After creating the groups, collapse one section and verify that the subtotal remains visible and the intended detail is hidden.
For a larger report, create the smallest useful groups first, then add higher-level groups only when they genuinely help. Test the outline buttons at each level. If the display becomes confusing, ungroup the unnecessary layer rather than adding more groups to compensate. It is also sensible to save the workbook before making substantial structural changes, especially when the sheet contains a complex outline or is shared with others.
Frequently Asked Questions
What is the Excel shortcut to ungroup rows?
On Windows, select the grouped rows and press Alt+Shift+Left Arrow. On a Mac, use Option+Shift+Left Arrow. The shortcut removes the outline grouping; it does not delete the rows or their contents.
What is the Excel shortcut to group columns?
Select the column headers you want to group, then press Alt+Shift+Right Arrow in Excel for Windows. On Mac, press Option+Shift+Right Arrow. If Excel asks whether to group rows or columns, choose Columns.
Does ungrouping delete data in Excel?
No. Ungrouping removes the selected outline structure, not the cell values or formulas. The rows or columns remain in the worksheet. Deleting data or clearing an outline is a separate action.
How do I show grouped rows again without ungrouping them?
Click the plus sign beside the collapsed group, or use an outline level button to reveal more detail. Expanding restores visibility while preserving the group, so you can collapse it again later.
Why does Excel ask whether I want to group rows or columns?
Excel may not be able to infer the intended direction from the selected cells. Choose Rows or Columns in the dialog. Selecting row-number headers or column-letter headers before using the shortcut makes the intended direction clearer.
How do I remove every group from a worksheet?
On the Data tab, open the Ungroup menu in the Outline area and choose Clear Outline. This clears the worksheet’s outline structure but leaves its underlying cell data in place.
Related
- Excel Format Cells Shortcut: Quick Keys for Windows and Mac
- Excel Format as Number: Steps and Common Fixes
- Excel Format by Number Range with Conditional Formatting
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- AG Grid Hide Column: APIs, Menus, and Visibility RulesTo hide a column in AG Grid, set hide: true in its column definition when creating the grid,…
- How to Insert a Table of Contents in WordThe easiest way to insert a table of contents in Microsoft Word is to apply built-in Heading styles…
- How to Remove Duplicates in Excel Files on SharePointTo remove duplicates from an Excel workbook stored in SharePoint, open the workbook in Excel, select the full…
- Excel Data Model in the Web: What Works and What Doesn’tExcel for the web can open a workbook that contains an Excel Data Model, but it does not…
- Percentage of a Number in Excel: How to Calculate ItTo find a percentage of a number in Excel, multiply the number by the percentage. For example, with…
- Excel Subtotal Visible Rows: Sum Filtered Data CorrectlyTo subtotal only the rows visible after filtering in Excel, use the SUBTOTAL function with function number 9…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.