To group rows in Excel for Microsoft 365 on Windows, select the row headers you want to group and press Alt+Shift+Right Arrow. Excel adds an outline control so you can collapse those rows to hide their details or expand them again. Before you start, make sure the rows you want to group are next to each other and that you are working in a worksheet where you can edit the outline.
What You’ll Need
- A desktop version of Excel for Microsoft 365 on Windows, or Excel for Mac if you plan to use the Mac shortcut. In Excel for the web, use the ribbon because shortcut support can vary by browser.
- A worksheet containing the rows you want to group. The rows should form one continuous block; grouping is most useful when detail rows sit beneath a heading or summary row.
- Permission to edit the worksheet. A protected sheet, shared editing restrictions, or a read-only workbook can prevent outline changes.
Step-by-Step
- Arrange the data before grouping. Put the rows you want to hide together without unrelated rows in between. For example, if rows 5 through 8 contain monthly details and row 4 contains a heading, keep the heading outside the selected block. Save the workbook first if you are making substantial structural changes, especially if other people use it.
- Select the rows, not just a few cells. Click the row number for the first detail row, then drag down the row headers to the last detail row. To select a larger range, click its first row number, hold Shift, and click its last row number. The whole row or rows should be highlighted. Selecting row headers makes it clear that you want a row outline rather than a column outline.
- Group the selection with the shortcut. Press Alt+Shift+Right Arrow while the rows are selected. Press the keys together; do not type them one at a time. Excel applies an outline to the selected rows. If a dialog asks whether to group Rows or Columns, choose Rows and confirm.
- Check the outline controls. Look along the left edge of the worksheet, beside the row numbers. Excel should show a bracket or line covering the grouped rows and a small minus button. The minus button means the detail rows are currently visible. If you do not see controls, use the troubleshooting section below.
- Collapse the group. Click the minus button beside the group. Excel hides the grouped rows and changes the control to a plus button. The row numbers may jump over the hidden rows; that is expected. The remaining visible row or rows should still show the heading or summary information that helps identify the hidden details.
- Expand it again when needed. Click the plus button to show the rows. You can collapse or expand a group whenever you need to inspect the details; grouping does not delete or move the data. If there are several separate groups, use the control next to the relevant bracket so you only affect the intended rows.
- Use outline levels for multiple groups. When a worksheet has several groups or nested groups, Excel displays numbered outline buttons, often 1 and 2, above the row numbers. Clicking a level number shows that level of detail across the outline: a higher level displays more detail, while a lower level hides more. The exact number of levels depends on how the groups are arranged.
- Ungroup rows if you need to remove the outline. Select the grouped rows again and press Alt+Shift+Left Arrow. If Excel asks whether to ungroup Rows or Columns, select Rows. You can also use Data > Outline > Ungroup. Ungrouping removes the outline structure; it does not delete the rows or their contents.
- Use the Mac equivalent when applicable. In Excel for Mac, select the row headers and press Option+Shift+Right Arrow to group, or Option+Shift+Left Arrow to ungroup. Depending on the keyboard and macOS settings, you may need to use the Option key shown on your keyboard. If the shortcut is intercepted or unavailable, use Data > Group or Data > Ungroup instead.
- Use the ribbon in Excel for the web. Select the row headers, then open the Data tab and choose Group in the outline controls. Choose the row option if prompted. Browser shortcuts can take priority over Excel shortcuts, so the ribbon is the dependable route when the keyboard combination does not work in a browser.
Common Mistakes
Selecting cells when you mean to group rows. If you select only cells in the worksheet body, Excel may ask whether you want to group rows or columns. That prompt is not an error: choose Rows. To avoid the extra choice, select the row numbers at the left edge of the sheet.
Including a heading or total in the detail group. If you hide every selected row, you can accidentally hide the label or subtotal that explains the group. For a simple outline, leave the heading or summary row outside the detail selection. For instance, if row 4 says Q1 Total and rows 5–7 list individual months, group rows 5–7 so the total remains visible when the group is collapsed.
Expecting the shortcut to hide rows immediately. Grouping creates an outline; it does not necessarily collapse it. After grouping, click the minus control to hide the rows. This distinction matters when you are setting up a sheet for someone else: the outline can be present while all details remain visible.
Grouping nonadjacent rows as one block. The outline is designed around continuous ranges. If unrelated rows are between the details, Excel may include those rows in the group or fail to produce the structure you intended. Create separate groups for separate blocks, or reorganize the worksheet so each detail section is contiguous.
Confusing grouping with hiding. The Home tab’s hide-row controls conceal rows but do not create the same expandable outline bracket. If you want readers to expand and collapse a section easily, use Group. If you only need a temporary hide with no outline, hiding rows is a different action.
Tips
- Keep a visible label or summary beside each group. When details are collapsed, a nearby heading, subtotal, or other identifier makes it obvious what the hidden rows represent. A group that hides its own only label can be confusing to other workbook users.
- Group in a consistent pattern. For a report with one summary row followed by several detail rows, apply the same structure to every section. Consistent grouping makes the outline level buttons more useful and makes it easier to scan the sheet.
- Make nested groups deliberately. You can create smaller groups inside a larger group, such as daily rows inside a monthly section. Select and group the innermost detail block first, then create the outer group. Check the numbered outline levels and test both the small and large collapse controls so the hierarchy behaves as expected.
- Use the Data tab if you forget the shortcut. On Windows, the ribbon route is Data > Outline > Group. The button may show a small menu or open a dialog depending on the selection. Choose Rows when asked. This is also a useful alternative if a laptop keyboard or another application intercepts the key combination.
- Remember that outline controls are worksheet-level display tools. Collapsing a group changes what is shown, not the underlying values. Formulas that refer to hidden cells still refer to them. If you are sharing the workbook, tell recipients that the plus and minus controls reveal or hide details rather than changing the data.
- Check print and sharing needs separately. A collapsed group may affect what is visible on screen, but it is not a substitute for checking the print area or the layout of a report. Expand the rows and review the intended output before printing or exporting if all details need to appear.
Troubleshooting
The shortcut does nothing. First confirm that the worksheet is active and that the row headers are selected. Then press Alt, Shift, and the Right Arrow together. If you are editing a cell, finish editing by pressing Enter or Esc and try again. On some keyboards, function or accessibility settings can alter key behavior. Try the Data ribbon command instead, or check whether another application or system shortcut is capturing the keys.
Excel groups columns instead of rows. Undo the unintended outline if necessary, select the row numbers rather than column letters or cells, and repeat the shortcut. If a Group dialog appears, explicitly choose Rows. The direction of the selection and the cells involved can affect what Excel offers, so checking the selection before confirming is worthwhile.
The bracket, plus, or minus controls are missing. Make sure an outline has actually been created and that the worksheet is not hiding outline symbols. In Windows desktop Excel, go to File > Options > Advanced, find Display options for this worksheet, and check Show outline symbols if an outline is applied. The displayed worksheet name matters if the workbook has multiple sheets. If the command is disabled, check whether the sheet is protected or the workbook is restricted.
The group collapses the wrong rows. Expand it, inspect the bracket alongside the row numbers, and select the exact contiguous detail range again. If the selected block accidentally included a heading, blank separator, or another section, ungroup the incorrect range and create the outline with a more precise selection. When there are nested groups, use the bracket for the specific level you want rather than assuming one click affects only the innermost rows.
Ungrouping does not remove all the outline controls. A worksheet can contain more than one group or multiple outline levels. Select and ungroup the intended rows, then check whether a parent or neighboring group remains. To remove all outline grouping from the active worksheet, use Data > Outline and open the dialog launcher if available; choose Clear Outline. This removes outline structures, so check the sheet carefully before using it.
The commands are unavailable. Confirm that you can edit the workbook and that the sheet is not protected in a way that blocks outlining. If the file is read-only, request edit access or make an editable copy if permitted. In Excel for the web, try the Data tab rather than relying on a desktop shortcut; in Excel for Mac, use the Mac key combination or the ribbon command.
Frequently Asked Questions
What is the keyboard shortcut to group rows in Excel?
In Excel for Microsoft 365 on Windows, select the rows and press Alt+Shift+Right Arrow. On Mac, use Option+Shift+Right Arrow.
What is the shortcut to ungroup rows?
On Windows, select the grouped rows and press Alt+Shift+Left Arrow. On Mac, press Option+Shift+Left Arrow. If Excel asks what to ungroup, choose Rows.
Can I group rows without selecting the entire row?
Yes. You can select cells within the rows, but Excel may ask whether to group rows or columns. Choose Rows. Selecting row headers is usually clearer and reduces the chance of choosing the wrong direction.
Does grouping rows delete or change their data?
No. Grouping adds an outline that lets you show or hide the selected rows. Collapsing the group hides the rows from view; it does not remove their contents or change formulas that refer to them.
Can I group rows in Excel for the web?
Yes, where the workbook and web app allow outlining. Select the rows and use the Group command on the Data tab. The desktop keyboard shortcut may vary in behavior in a browser, so use the ribbon if it does not respond.
Why do I see a plus button instead of a minus button?
A plus button means the group is collapsed and its detail rows are hidden. Click the plus to expand the group. A minus button means the rows are currently visible and can be collapsed.
Related
- Excel Sum by Cell Color: Methods That Actually Work
- Excel Max Cell Height: The 409-Point Row Height Limit
- Excel Modify Drop-Down Lists: Steps, Tips and Fixes
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- Copying Text from Excel to Word: Formatting, Links and TablesTo copy cells from Excel into Word, select the cells, press Ctrl+C in Excel, place the cursor in…
- Excel AutoSum Shortcut: How to Use Alt+=In Excel for Microsoft 365 on Windows, the AutoSum shortcut is Alt+=: select the blank cell where you…
- Clear Excel Shortcut: Contents, Formats, and CellsTo clear the contents of selected Excel cells on Windows, select them and press Delete. This removes values…
- Excel Column Alphabetical Order: A to XFD ExplainedExcel’s worksheet columns are labeled A through Z, then AA through AZ, BA through BZ, and onward to…
- Remove Page Break Lines in Excel: Steps for Every SheetTo hide page break lines in Excel for Microsoft 365 on Windows, open File > Options > Advanced,…
- Conditional Formatting in Excel With ColorsIn Excel for Microsoft 365 on Windows, select the cells, then choose Home > Conditional Formatting and pick…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.