Group and Ungroup in Excel with Keyboard Shortcuts

How-to basics · Updated November 20, 2026

In Excel for Microsoft 365 on Windows, select the rows or columns you want to fold into an outline, then press Alt+Shift+Right Arrow to group them. Select a grouped section and press Alt+Shift+Left Arrow to ungroup it. Grouping lets you collapse detail and bring it back without deleting data; first save a copy if you are changing an important workbook.

What You’ll Need

  • A workbook open in the desktop version of Excel for Microsoft 365 on Windows. The steps also apply to many recent desktop versions of Excel.
  • A worksheet with rows or columns you want to organize. Grouping works best when the detail is arranged in one continuous block.
  • Permission to edit the worksheet. If its structure is protected, Excel may not let you add or remove outline groups.

You do not need formulas or a special add-in. The keyboard shortcuts create an outline around selected rows or columns; they do not combine cells, remove records, or change the values in the worksheet.

Step-by-Step

  1. Choose what you want to group. Decide whether you need to collapse rows of detail or columns of detail. For example, a monthly sales sheet might have one summary row followed by several transaction rows. You can group the transaction rows so they can be hidden while leaving the summary visible. If you want to hide supporting columns, group those columns instead. Group only the detail you want to show or hide together.
  2. Select the complete rows or columns. For row grouping, click the row number of the first detail row, then drag down the row-number headers to the last detail row. For column grouping, click the first column letter and drag across the column headers. To select a range with the keyboard, click a cell in the first row or column and extend the selection with Shift+Down Arrow or Shift+Right Arrow; selecting the headers is the clearest way to ensure Excel interprets the selection as whole rows or columns. Do not include a summary row if you want that summary to remain visible when the group is collapsed.
  3. Create the group with the shortcut. With the intended row or column headers selected, press Alt+Shift+Right Arrow. Excel adds an outline bracket beside the selected rows or above the selected columns, along with a minus button. If Excel displays a Group dialog instead, choose Rows or Columns to match your selection, then confirm. If the selection is already clear and Excel creates the group immediately, there is no dialog to complete.
  4. Check the outline before hiding anything. Look for the bracket and the outline controls near the row numbers or column letters. A minus button means the group is expanded. Click the minus to collapse the selected detail; Excel hides it but keeps the data in the sheet. A plus button appears in its place. Click that plus when you want to see the rows or columns again. These controls are useful for checking that the group contains exactly the intended detail.
  5. Use outline levels for a larger worksheet. When Excel has created an outline, numbered buttons such as 1 and 2 may appear at the top-left of the sheet. Click a level number to display that level of summary. For a simple outline, level 1 commonly shows the most-collapsed view and a higher level shows more detail. The exact display depends on the groups in the worksheet. Use the plus and minus buttons for one group at a time when you do not want to change the view of every group at that level.
  6. Ungroup a section when you no longer need its outline. Expand the group first if it is collapsed, then select the rows or columns belonging to that group using their headers. Press Alt+Shift+Left Arrow. If Excel asks whether to ungroup rows or columns, choose the appropriate option and confirm. The outline bracket and its grouping are removed, but the worksheet data remains. Ungrouping does not delete the selected rows, columns, or cell contents.
  7. Use the ribbon if the shortcut is unavailable. Select the same rows or columns, then open Data > Outline > Group. To remove the grouping, select the relevant headers and choose Data > Outline > Ungroup. The ribbon is a useful fallback if another program intercepts a key combination or if you need to see which type of group Excel is creating.
  8. Save and verify the view. Expand and collapse the new group once to confirm it behaves as expected, then save the workbook. If the sheet contains several outline levels, check both the detailed view and the summary view. This catches accidental grouping of a heading, total, or neighboring section before someone else relies on the workbook.

On Mac: In Excel for Mac, the corresponding shortcuts are generally Option+Shift+Right Arrow to group and Option+Shift+Left Arrow to ungroup. Keyboard mappings can vary with the Mac keyboard, macOS settings, and Excel version, so use Data > Group or Data > Ungroup if the shortcut is captured by macOS or does not respond. In Excel for the web, browser shortcuts can interfere; use the Data tab commands when available, or open the workbook in the desktop app for the most consistent outline controls.

Common Mistakes

Selecting cells when you mean whole rows or columns. A selection of ordinary cells can make Excel ask whether you intend to group rows or columns, or can produce an outline that is not what you expected. Select the row-number or column-letter headers to make your intention clear. If you did create the wrong kind of outline, undo immediately with Ctrl+Z on Windows, then make the correct header selection and try again.

Including the summary in the group. If you group a total row together with its detail, collapsing the group can hide the total too. Select only the detail rows when the total should stay visible. A common layout is a summary line above a block of detail; in that layout, group the rows below the summary line, not the summary itself.

Confusing collapse with ungroup. Clicking a minus button only hides the group temporarily. The outline still exists, and a plus button lets you show the detail again. The ungroup shortcut removes the outline structure; it is not the command for simply hiding or showing detail. Use the plus or minus control when you want to change the display, and use ungroup only when you want to remove that grouping.

Trying to group separate, nonadjacent blocks in one operation. An outline group is a continuous range. Group each separate block individually, and check the brackets afterward. For example, group the detail rows for one quarter, then separately group the detail rows for the next quarter. This creates independent controls instead of one large group that hides unwanted rows.

Tips

  • Keep summary rows outside the detail range if you want totals to remain visible after collapsing. Put labels and totals in a consistent place so future users can understand the outline.
  • Use row or column headers to select the range, then verify the first and last header are correct before pressing the shortcut. This small check prevents accidentally hiding a heading or an unrelated block.
  • Build nested groups from the smallest detail blocks outward. For instance, group daily rows within each month, then group the monthly sections if you need a higher-level view. Afterward, test the outline level buttons to confirm the levels reveal the right amount of information.
  • Use the plus and minus buttons when you want a quick view change and keep the keyboard shortcut for creating or removing outline structure. A collapsed group is still part of the workbook, so expanding it restores the same data.
  • If you need a flat worksheet without outline brackets, select the relevant area and use Data > Outline > Ungroup as needed. In some situations, Data > Outline > Clear removes the worksheet outline; use that broader command carefully because it clears outline structure rather than just toggling visibility.
  • Do not use grouping as a substitute for hiding sensitive information. Collapsed rows and columns remain in the workbook and can be expanded by another person.

Troubleshooting

The shortcut does nothing. First check that Excel, rather than a cell editor or another application, has focus. Click a row or column header, select the intended range, and try the shortcut again. If you are editing a cell, press Esc or Enter to leave edit mode first. On Windows, a laptop keyboard or another utility may intercept an Alt-based shortcut; use Data > Outline > Group or Ungroup as a fallback. On Mac, try the Option-based equivalent or the Data menu.

The wrong rows or columns disappear. Click the plus control to expand the group, then inspect its bracket and the headers at both ends. If the selection is wrong, select the affected rows or columns and ungroup them with Alt+Shift+Left Arrow. Select the intended range and group it again. If a summary row disappeared, expand first and recreate the group without including that summary row.

There is no plus, minus, or outline bracket. Confirm that the grouping command completed and that you selected whole rows or columns. Also check whether outline symbols are hidden: in Windows Excel, open File > Options > Advanced, find the display options for the worksheet, and enable Show outline symbols if an outline is applied. If the sheet is protected, ask the workbook owner to allow the necessary structural changes or unprotect the sheet if you are authorized to do so.

Excel says it cannot group the selection. Make sure the selection is a continuous range and that the worksheet is not protected against outlining. If the data is inside an Excel table, table behavior or the selected range may limit what you can group; try selecting rows outside the table or convert the table to a normal range only if that suits the workbook. Also check for merged cells or an unusual layout that may prevent a clean outline. Do not remove table formatting or protection without checking how that change affects other users.

The outline has too many levels or the wrong structure. Expand the groups and inspect each bracket. Remove only the incorrect group, then rebuild the outline from smaller sections to larger ones. If you need to start over and no existing outline should be kept, use Data > Outline > Clear deliberately; it removes outline structure, not the underlying worksheet data. Save a copy first if you are unsure which groups other people depend on.

Frequently Asked Questions

What is the keyboard shortcut to group rows in Excel?
On Windows, select the row headers and press Alt+Shift+Right Arrow. The same shortcut groups selected columns when you select column headers.

What is the shortcut to ungroup rows or columns?
Select the grouped row or column headers and press Alt+Shift+Left Arrow on Windows. If prompted, choose whether to ungroup rows or columns.

Does collapsing a group delete the hidden data?
No. Collapse hides the rows or columns from view; the cells and their contents remain in the worksheet. Click the plus button to expand the group and show them again.

How do I group columns instead of rows?
Select the column letters for the continuous range you want to fold away, then use Alt+Shift+Right Arrow. To keep a heading or total column visible, leave it outside the selected range.

Can I group more than one section on a sheet?
Yes. Create separate groups for separate continuous blocks. You can also create nested groups, such as detail rows within monthly sections, and use the outline controls to show a broad summary or progressively more detail.

Will these keyboard shortcuts work in Excel for the web?
They may vary or be intercepted by the browser. If they do not work, use the Data tab’s Group or Ungroup command if available, or open the workbook in Excel for Windows or Mac to use the desktop outline controls.

Related

Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.

More in How-to basics

Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources

Spotted an error in this guide? Let us know.