How to Group Rows in Excel
Learn how to group rows in Excel with step-by-step instructions, keyboard shortcuts, nested grouping tips, and fixes for common errors.

Grouping rows in Excel is one of those features that you do not think about until you need it. Then, suddenly, you cannot live without it. When a worksheet starts to spread into hundreds of lines, the eye gets tired and the mouse wheel starts to feel like a treadmill. Grouping fixes that. It lets you collapse blocks of related rows behind a tidy plus or minus button, then expand them again when you actually want to see the detail. The headline view stays clean. The drill-down view stays available. You stop scrolling, you start reading.
This guide walks through every part of the workflow. You will see the standard menu path, the keyboard shortcut that takes the click count down to almost nothing, and the trick for nesting groups inside groups.
We will look at how to group by date, how to auto-outline a financial model, and what to do when Excel refuses to cooperate and throws back the dreaded "Cannot group that selection" message. We will also touch the small things — how to keep grouping when you save as PDF, how to remove all groups in one shot, and how the feature plays with filters and freeze panes.
If you are studying for a workplace certification or just trying to get a budget pack ready for Monday morning, the skill matters. Excel hiring tests almost always include at least one outline or grouping question, and managers notice when a deck of numbers can be navigated rather than scrolled. Treat this as a working reference, not a one-shot tutorial. Skim it now, bookmark it, and come back when a real spreadsheet is sitting in front of you.
Excel Grouping at a Glance
What grouping actually does
Grouping rows creates an outline. Excel draws a thin bar along the left edge of the row numbers with a minus icon at the bottom. Click the minus, the rows collapse into a single summary band. Click the plus that replaces it, the rows reappear. The data does not move, change, or get deleted. Cell references still resolve, formulas still calculate, formatting stays intact. The only thing that changes is whether you can see the rows at the moment.
The point is visual decluttering. Compare two views of a sales workbook. View one shows every transaction across twelve months, line by line, scrolling for days. View two shows twelve summary rows — one per month — with the daily detail tucked away behind plus icons. You can still expand October when an auditor asks about it, but you do not have to look at October every time you open the file. That second view is what grouping gives you, and it gives it to you in about three keystrokes per block.

Three Ways to Trigger Grouping
Open the Data tab in the ribbon, locate the Outline group on the right side, and click the Group button. A small dialog asks whether you want to group rows or columns; pick rows. This path works identically in Excel 2010, 2013, 2016, 2019, 2021, and Microsoft 365 on both Windows and Mac, making it the most reliable choice when teaching the feature to a colleague who may be on a different version than you.
Select the rows by clicking the row numbers in the left margin, then press Shift + Alt + Right Arrow on Windows or Command + Shift + K on Mac to group instantly. To ungroup, use Shift + Alt + Left Arrow or Command + Shift + J. The shortcut takes the time per group from about four seconds to under one second, which adds up fast on a workbook with thirty or more groups to build.
Click anywhere in a sheet that already has SUM or subtotal formulas referencing contiguous detail blocks, then choose Data → Group → Auto Outline. Excel reads the formula structure, identifies the parent-child relationships between summary and detail rows, and builds the entire outline in a single operation. The feature struggles when formulas reference scattered ranges, but on a clean financial layout it can save thirty minutes of manual selection.
Step by step: the manual group
Start with a clean selection. Click the row number on the left edge to pick the entire row, then drag down to the last row you want included. The whole strip should turn blue. If you select only a few cells inside the rows Excel will pop up a small dialog asking whether you mean to group rows or columns — answer rows and continue, but it is cleaner to grab the row numbers from the start.
Next, go to the Data tab on the ribbon. In the Outline block on the right end, click the small icon labelled Group. A new vertical bar appears in the margin to the left of the row numbers. That bar is the visual cue that a group exists. At the bottom of the bar sits a minus button.
Click it once. The rows fold up. Click the plus that replaces the minus. The rows fold back out. That is the entire mechanic. Repeat the selection for the next block of rows you want to collapse and you have built a full outline.
If you would rather skip the ribbon entirely, keyboard users get the same result with one key combo. Select the rows the same way, then hit Shift, Alt, and the Right Arrow at the same time. Excel groups instantly. To unwind, hit Shift, Alt, Left Arrow. The shortcut works on Windows. Mac users press Command, Shift, and K. Memorise it once and you will save hours over a year.
Before You Group, Check These
- ✓Every column you want collapsed sits inside the selection — partial row selections trigger a dialog and slow you down
- ✓No merged cells fall on the boundary of the group — Excel will reject the operation outright with a confusing error
- ✓Your worksheet is not protected, or the protection settings explicitly allow outline edits in the Review tab
- ✓Summary rows are placed either above or below the detail rows consistently — mixing styles breaks the collapse buttons
- ✓Filters and AutoFilter are turned off — they compete with the outline feature for the same margin space
- ✓You have saved a backup copy of the workbook in case Clear Outline removes more groups than you intended
- ✓The workbook is saved in the xlsx format rather than the older xls format — outlines persist better across reopens
Nested groups: building a real outline
One group is useful. Eight nested groups is a working financial model. Excel supports up to eight levels of nesting, which is more than almost any sane workbook needs. The trick is selecting child blocks before parent blocks, otherwise the math of which rows are inside which group gets confused fast.
Imagine an income statement broken down by quarter. The lowest level is the week. Group the seven daily rows for week one. Move down and group week two, three, and four. Now you have four week groups. Select all four week groups in one continuous selection — rows two through twenty-nine, say — and group them again.
Excel notices the existing groups and creates a parent that wraps them. The outline bar in the margin now has two stripes side by side. The inner stripe collapses one week, the outer stripe collapses the whole month. Repeat the pattern for the next three months and you have a quarter-month-week outline that an analyst can navigate by clicking a single button.
Look at the small numbers in the top-left corner of the worksheet. They show one, two, three, and so on, depending on how many nesting levels you have. Click "1" and Excel collapses everything down to the highest level summaries — usually just the quarterly totals. Click "3" and the weekly details unfold. This is the headline benefit of building an outline properly: you flip between detail and summary with a single click, and your audience never sees the underlying complexity unless they ask for it.

Shortcuts and Methods by Platform
Group selected rows: Shift + Alt + Right Arrow. Ungroup: Shift + Alt + Left Arrow. Toggle outline symbols: Ctrl + 8. Collapse to level: click the 1, 2, 3 buttons in the top-left of the outline area. Show all: click the highest number on the level bar.
When Excel refuses to group
You select rows, hit the shortcut, and a dialog box appears: "Cannot group that selection." The most common cause is an active filter. AutoFilter and grouping fight for the same outline space, so Excel disables one when the other is on. Turn the filter off through Data, Filter, and try again.
The second common cause is a protected worksheet. Open Review, Unprotect Sheet, supply the password if there is one, then group. If you cannot remove the protection you can sometimes still group, depending on how the original protection was configured — but usually the action is blocked outright.
A third issue shows up in shared workbooks. Excel turns off many outlining features when a workbook is being co-authored over OneDrive or SharePoint. Save a local copy, build the outline, and resave to the shared location. Once the structure is there other users can use it. They just cannot easily change it.
Excel assumes summary rows sit below their detail by default. If yours sit above, click the dialog launcher in the Outline group, untick "Summary rows below detail," and click OK. Otherwise the collapse button will land on the wrong row and your outline will look upside down.
Grouping rows by date
The plain grouping feature is purely visual — it does not look at your data. If you want Excel to bunch rows together because they share a date, a category, or a customer, you usually want a PivotTable instead. Select the data range, hit Insert, PivotTable, and drag the date column into the Rows area. Right-click any date inside the pivot and choose Group. A dialog lets you pick days, months, quarters, or years.
This is a different feature from the row outline tool we have been talking about, and the two often get confused in search results. Outline grouping is a presentational tool you apply to any worksheet. Date grouping is a PivotTable function that aggregates underlying values.
Use the first when the layout already reflects the structure you want. Use the second when you want Excel to do the bucketing for you. If you find yourself counting matching values by hand to set up an outline, switch to a pivot — the COUNTIF function can also help when you only need a single bucket count.
Name your summary rows before collapsing. Label each summary row with a short, descriptive heading in bold — for example, "Q1 Total" or "West Region Subtotal." When the detail rows are folded, the summary label is all your reader sees. A vague "Total" row in row 47 is useless out of context. A bold "Q1 Total — West" is a navigation signpost.
Grouping vs Hiding Rows
- +Outline bar shows the structure at a glance
- +Plus and minus icons make expand and collapse one click
- +Nested levels jump between summary depths instantly
- +Survives saving as PDF — collapsed view prints collapsed
- +Auto outline can build the structure from your formulas
- −Hidden rows leave no visible cue, future you will forget they exist
- −Right-click Unhide is fiddly on large ranges
- −Hide-state does not carry over to PDF the same way
- −Mixed hide and group in the same sheet creates confusion
- −Auditors usually flag hidden rows but accept grouped rows

Removing groups without breaking the sheet
Three options. The first is targeted: select the grouped rows, press Shift Alt Left Arrow, and that single group disappears. The data stays. The outline bar segment for those rows vanishes. The second is also targeted but goes through the menu: Data, Ungroup, Ungroup. Same outcome.
The third option is the nuclear one and useful when a workbook has been touched by half a dozen people and the outline has become a tangle. Go to Data, Ungroup, Clear Outline. Every group on the active sheet is removed in one step. The outline bar in the margin disappears entirely. No data is lost. Subtotals, formulas, and formatting are all preserved. You just get a flat sheet back. From there you can rebuild the outline cleanly using auto outline or by hand.
One small gotcha. Clear Outline only operates on the current worksheet, not the entire workbook. If you have outlines on twenty tabs you have to walk through each tab one at a time. There is no global "remove all outlines" command in the ribbon. Power users sometimes write a one-line VBA loop to do this, but for most occasional users a tab-by-tab pass takes under a minute.
Excel Questions and Answers
Practical workflow tips
Use grouping early. It is tempting to wait until a sheet is finished before adding outline structure, but the discipline of grouping as you build forces cleaner column layouts and consistent summary placement.
The act of asking "is this a detail row or a summary row?" while you are typing is itself a quality check on the model. By the time the sheet hits a hundred rows the structure is already there.
Combine grouping with named ranges and an absolute reference in your summary formulas. The two features were designed together. A summary row that uses a hard-coded sum range will break the moment you insert a new detail row.
A summary row that references a named range or a structured table will keep working forever. When you build a fresh outline, commit to using tables — they protect the summary math while the visual outline manages the eye traffic.
Finally, do not be afraid to teach the feature to colleagues. Half of the people who open one of your grouped workbooks will not realise they can click the plus to see more. Add a one-line note at the top of the sheet — "Click the plus icons in the left margin to expand sections" — and you will save a dozen support questions a quarter.
If your team is new to Excel beyond the basics, point them at structured Excel training online so the muscle memory builds across the whole stack: tables, formulas, pivots, and outlines together.
Combining grouping with subtotals
One of the cleanest ways to land in a fully outlined workbook with almost no manual effort is the Subtotal tool. Sort your data by the column you want to break on — say, region. Then go to Data, Subtotal, pick the column, choose Sum, and click OK.
Excel inserts a subtotal row at each break, calculates the running sums for you, and — this is the part most people miss — also builds the entire row outline at the same time. You did not press Group once, but the outline is there in the margin, ready to collapse.
This is the workflow many accountants use without thinking about it. They never select rows, never hit shortcuts, never open the Outline dialog. They sort, click Subtotal, and the worksheet collapses into a clean hierarchical view.
Layer in a second Subtotal pass on a different column without ticking "Replace current subtotals" and you get a two-level outline. A third pass gives you three levels. It is the fastest way in Excel to go from raw transactional data to a presentation-ready outline.
Freeze the rows you want fixed at the top — usually your header row and any always-visible summary band — and then build the outline below. The outline bar still extends the full height of the worksheet, but the frozen rows will not scroll out of view as you expand and collapse the groups underneath. Split views work too, though level buttons only respond when the active cell is in the matching pane.
What to do when grouping disappears after saving
Older xls files do not always preserve outline state, and certain cloud-saved formats can drop the outline silently. If you reopen a file and the margin bar is gone, your data is fine — only the visual structure was lost.
Resave as xlsx. The newer file format keeps outlines reliably across reopens, OneDrive syncs, and email attachments. If you must stay on xls for compatibility, build the outline last, right before you save and close, and warn your reader that they may need to rebuild it.
One more habit pays off: write a tiny comment in cell A1 noting that the sheet uses row grouping. New readers will find it, click the plus icons, and avoid the trap of staring at a collapsed summary thinking it is the full data set.
Final pre-flight checklist
Before you ship a workbook with grouping, walk through three quick checks. First, expand every group and confirm the data still reads correctly when fully unfolded — sometimes a group inadvertently swallows a header row and the structure no longer makes sense at full detail.
Second, collapse every group to the highest level and confirm the summary rows tell a coherent story on their own. If a reader could not follow the narrative from just the summaries, your outline is not yet earning its keep.
Third, save, close, and reopen the file. Outlines occasionally drop unexpectedly on save, especially in older xls formats or shared environments, and you want to catch that before someone else does.
Grouping rows is a small feature with a disproportionate effect on how readable a workbook feels. Master the shortcut, place your summaries consistently, nest with care, and you will turn cluttered sheets into navigable models. The next time someone hands you a forty-thousand-row export, you will not scroll. You will outline, collapse, and read.
About the Author
Attorney & Bar Exam Preparation Specialist
Yale Law SchoolJames R. Hargrove is a practicing attorney and legal educator with a Juris Doctor from Yale Law School and an LLM in Constitutional Law. With over a decade of experience coaching bar exam candidates across multiple jurisdictions, he specializes in MBE strategy, state-specific essay preparation, and multistate performance test techniques.