How to Collapse Rows in Excel: The Complete 2026 Guide to Grouping, Outlining, and Hiding Data
Learn how to collapse rows in Excel using grouping, outlining, and hiding. Step-by-step methods, shortcuts, and pro tips for cleaner spreadsheets.

Learning how to collapse rows in Excel is one of the fastest ways to turn a sprawling, overwhelming spreadsheet into a clean, navigable report that anyone can read. When you collapse rows, you temporarily hide detailed line items beneath a summary row, so a 5,000-line sales export can shrink to a tidy set of regional totals you expand only when you need the granular numbers. This skill matters whether you build monthly budgets, track inventory, or prepare board decks, and it pairs naturally with other core skills like sorting, filtering, and formatting.
Many people confuse collapsing rows with simply hiding them, but the two behaviors are different in important ways. Hiding rows removes them from view with no visual cue that anything is missing, while collapsing rows uses Excel's outline feature to add tidy plus and minus buttons in the left margin. Those buttons let you expand and re-collapse the same grouped data instantly, again and again, without right-clicking through menus or remembering exactly which row numbers you tucked away earlier.
Excel offers several routes to the same destination, and the right one depends on your data. The Group command under the Data tab is the workhorse for manual grouping, while Subtotal can build an entire collapsible outline automatically around categories you define. Pivot tables collapse and expand fields with a single click, and the humble Hide command still has its place for one-off cleanup. Understanding all four approaches means you always pick the cleanest tool for the job in front of you.
If you have ever wrestled with a report that scrolls forever, you already understand the payoff. A collapsed outline lets a manager skim top-level totals in seconds, then drill into a single department without losing the big picture. It also makes printing dramatically easier, because collapsed rows do not print, letting you produce a clean one-page summary from a workbook that holds thousands of underlying transactions across many months of activity.
This guide walks through every method in plain language, with exact menu paths, keyboard shortcuts, and the small gotchas that trip up beginners. You will learn how grouping interacts with formulas, why your plus and minus buttons sometimes appear on the wrong side, and how to keep collapsed structures intact when you share files. By the end you will collapse and expand rows confidently, even in workbooks that other people built and left poorly organized.
We will also touch on related Excel skills that frequently come up alongside row collapsing, such as how to freeze a row in Excel so headers stay visible while you scroll, and how to merge cells in Excel for cleaner summary labels. These features work together to make large datasets manageable. Treat this article as both a tutorial and a reference you can return to whenever a messy spreadsheet lands in your inbox and needs to be tamed quickly.
Collapsing Rows in Excel by the Numbers

Four Methods to Collapse Rows in Excel
Select rows and use Data > Group to add plus/minus buttons in the margin. Best for manual, reusable collapsing where you control exactly which rows fold together into a summary.
Data > Subtotal builds an automatic outline that inserts total rows and collapsible groups around each category. Ideal for sorted lists where you want summary math and structure at once.
Collapse and expand entire fields with a single click on the field button. Perfect for analysis where you constantly reshape how detailed or summarized your data appears.
Right-click selected rows and choose Hide for a quick one-off cleanup. Simple but offers no visible buttons, so it is harder to remember and reverse later.
The most reliable way to collapse rows is the Group command, and the step-by-step process is short once you know it. Start by selecting the entire range of rows you want to fold together by clicking the first row number, holding Shift, and clicking the last row number in the detail block. Select only the detail rows, not the summary row above or below them, because Excel needs that summary row to stay visible as the heading when the group collapses down into a single line.
With the rows selected, go to the Data tab on the ribbon and click Group in the Outline section, or simply press Alt+Shift+Right Arrow. Excel instantly adds an outline bar along the left margin with a small minus button. Click that minus button and your selected rows collapse, leaving only the summary row visible. Click the plus button that replaces it and the rows reappear. That single toggle is the entire payoff of the grouping feature, and it never forgets which rows belong together.
You can nest groups inside groups to build a multi-level outline up to eight levels deep. For example, group daily rows into weeks, then group those weekly blocks into months, then months into quarters. Numbered buttons labeled 1, 2, and 3 appear at the top of the outline area, letting you collapse the whole sheet to a chosen level with one click. Pressing 1 shows only grand totals, 2 reveals subtotals, and 3 expands everything, which is enormously useful in big financial models.
Excel decides which side the summary row sits on based on a setting, and by default it assumes your total row appears below the detail rows. If your totals sit above the details instead, your buttons can look backwards. Fix this by clicking the small dialog launcher arrow in the corner of the Outline group on the Data tab, then unchecking Summary rows below detail. This single checkbox controls outline direction for the whole sheet and resolves the most common layout confusion beginners hit.
Grouping plays nicely with formulas, which is what makes it so powerful for reporting. A SUM formula in your summary row keeps calculating the collapsed detail rows even while they are hidden from view, so your totals never change when you fold the data away. This is why grouping beats deleting rows. If you have used vlookup excel formulas that reference detailed ranges, those lookups continue returning correct values regardless of whether the source rows are expanded or collapsed at the moment.
To remove a group you no longer want, select the same rows and press Alt+Shift+Left Arrow, or choose Ungroup from the Data tab. To strip every outline from a sheet at once, click Ungroup, then choose Clear Outline. This wipes all the plus and minus buttons without deleting any data, returning your sheet to a flat list. Keep this command in mind when you inherit a workbook crowded with someone else's confusing grouping that no longer matches how you want to read the numbers.
Grouping vs Hiding vs Subtotal Compared
Grouping is the cleanest reusable method because it adds visible plus and minus buttons in the margin that let anyone expand or collapse the same block instantly. It never deletes data, and your summary formulas keep calculating the hidden detail rows underneath. You control exactly which rows fold together, and you can nest groups up to eight levels deep for layered reports.
The main limitation is that you must select detail rows manually, which can be tedious on huge unsorted datasets. Grouping also assumes a consistent summary row position, so mixed layouts may need the outline direction setting adjusted. Still, for repeated reporting where readers toggle detail on and off, grouping remains the most professional and forgiving option available.

Is Grouping Rows the Right Choice for Your Spreadsheet?
- +Adds clear plus and minus buttons anyone can use intuitively
- +Never deletes data, so totals and formulas keep working
- +Supports up to eight nested outline levels for layered reports
- +Collapsed rows are excluded from printouts automatically
- +Reversible instantly with Ungroup or Clear Outline
- +Keyboard shortcuts make grouping fast on large datasets
- −Requires manually selecting detail rows for each group
- −Outline direction can confuse users if totals sit above details
- −Not ideal for unsorted data without using Subtotal first
- −Nested outlines can become hard to follow if overused
- −Some older file formats may not preserve outline structure
- −Collapsed groups can hide errors a reviewer needs to see
How to Collapse Rows in Excel: Step-by-Step Checklist
- ✓Identify the detail rows you want to fold under a summary row
- ✓Select only the detail rows, not the summary or total row
- ✓Open the Data tab and click Group in the Outline section
- ✓Or press Alt+Shift+Right Arrow to group instantly
- ✓Click the minus button in the left margin to collapse
- ✓Click the plus button to expand the rows again
- ✓Use the numbered 1-2-3 buttons to set outline depth fast
- ✓Adjust Summary rows below detail if buttons look reversed
- ✓Confirm summary formulas still total the hidden rows correctly
- ✓Use Ungroup or Clear Outline to remove grouping when finished
Collapse the entire sheet with one keystroke
Once your outline is built, the numbered buttons at the top-left corner collapse or expand every group at once. Press the 1 button to show only grand totals, then 2 or 3 to reveal more detail. This single feature turns a 5,000-row export into an executive summary in under a second, then back to full detail just as fast.
Keyboard shortcuts transform row collapsing from a menu chore into a reflex you barely think about. The two essentials are Alt+Shift+Right Arrow to group the selected rows and Alt+Shift+Left Arrow to ungroup them. After a group exists, you do not even need a shortcut to toggle it, since the plus and minus buttons sit right there in the margin. Memorizing just these two combinations will make organizing any large dataset feel dramatically faster, especially when you repeat the action across dozens of separate row blocks.
To collapse or expand entire outline levels without clicking individual buttons, use the numbered level controls in the top-left corner of the outline area. On a keyboard you can also navigate the outline using the standard arrow keys after clicking into the outline pane. Power users often combine grouping with the Quick Access Toolbar, pinning the Group and Ungroup commands there so a single Alt-number sequence triggers them. This is invaluable when you build the same style of report week after week from fresh data exports.
The Subtotal command is the closest thing Excel offers to one-click automation for collapsing. Sort your data by the category column first, then open Data > Subtotal, choose the grouping column, pick a function like Sum or Count, and confirm. Excel inserts subtotal rows and builds the full collapsible outline automatically. This is the fastest path when you regularly receive flat transaction exports and need them reshaped into a tidy, foldable summary report grouped by region, product, or month every single time.
For true automation, a short VBA macro can group rows based on rules you define. A few lines using the Rows.Group method can scan a column, detect category changes, and insert groups programmatically, which is perfect for recurring reports with thousands of rows. You can assign the macro to a button or keyboard shortcut so a colleague who has never touched the Data tab can produce a perfectly outlined report by clicking once. Record a macro while you group manually to generate the starter code automatically.
Pivot tables deserve a mention here because they collapse and expand data more flexibly than any grouped range. Double-click a field button or use the collapse and expand icons to drill from grand totals down to individual line items instantly. Because pivot tables recalculate on demand, you never worry about formulas breaking when rows fold away. If your goal is exploratory analysis rather than a fixed report layout, building a pivot table is often faster than manually grouping hundreds of rows by hand.
Whichever method you automate, document it briefly inside the workbook so future users understand the structure. A small note in cell A1 or a dedicated instructions tab explaining the outline levels saves enormous confusion when you hand the file to someone else. Pair these techniques with foundational layout skills, and your spreadsheets become genuinely self-service. People can explore the numbers at whatever depth they need without ever asking you to reformat or re-export the underlying data for them again.

Because collapsed rows disappear from view and skip printouts, reviewers can easily miss data entry mistakes, broken formulas, or outlier values tucked inside a folded group. Always expand every level and scan the full dataset before sharing a workbook for sign-off or making decisions based on the summary totals alone.
Even confident users hit snags with row outlines, and most problems have quick fixes once you know the cause. The most common complaint is that the plus and minus buttons appear in the wrong place or point the wrong way. This almost always traces back to the Summary rows below detail setting in the Outline dialog. If your total rows sit above their details, uncheck that box and Excel flips the entire outline so the buttons align logically with where your summary rows actually live on the sheet.
Another frequent issue is the outline buttons vanishing entirely from the left margin. If the symbols disappear, someone likely toggled them off, so press Ctrl+8 to show or hide the outline symbols. This shortcut is a lifesaver because the buttons are easy to switch off by accident, and many users panic thinking their grouping was deleted when in fact the data and structure are fully intact and just temporarily hidden from view behind a toggled display setting.
People also struggle when grouping refuses to work on filtered data. If a filter is active, Excel may group inconsistently or refuse to fold certain rows. Clear all filters first, build your outline on the complete dataset, and then reapply filtering if needed. Similarly, grouping across a worksheet that contains merged cells can behave unpredictably, so be cautious if you have used how to merge cells in excel techniques heavily throughout the same range you are trying to outline.
Occasionally the numbered level buttons collapse more or fewer rows than expected. This usually means your nesting is inconsistent, with some groups accidentally placed one level deeper than their neighbors. Clear the outline entirely using Data > Ungroup > Clear Outline, then rebuild your groups deliberately from the innermost level outward. Building bottom-up, grouping the smallest detail blocks first and then wrapping larger groups around them, produces the cleanest and most predictable multi-level structure every single time.
If you collapse rows and your summary formulas suddenly show wrong totals, check whether you accidentally used a function that ignores hidden rows. Standard SUM includes collapsed rows, but SUBTOTAL with certain function codes deliberately excludes hidden values. This is sometimes the behavior you want and sometimes a nasty surprise, so verify which function your summary cells use. Knowing the difference between SUM and SUBTOTAL prevents totals from mysteriously changing whenever someone folds or unfolds a section of the report.
Finally, sharing files can break outlines if recipients open them in incompatible software or very old Excel versions. Save in the modern xlsx format to preserve grouping reliably. When emailing a report meant to be read collapsed, set the outline to your preferred level and save before sending, because Excel remembers the displayed state. Combine these habits with smart layout choices like freezing headers, and your collapsible reports will travel cleanly to any colleague who opens them next.
With the mechanics covered, a few practical habits will keep your collapsible spreadsheets clean and professional over the long run. First, always build a clear summary row before you group, with a descriptive label and a working total formula. A group that collapses into a blank or vaguely labeled row frustrates everyone, while a group that folds neatly into a row reading Q1 Total alongside its sum communicates instantly. Good labeling is half the value of grouping, because the collapsed view is what most readers will actually see.
Second, keep your outline depth reasonable. Just because Excel allows eight nesting levels does not mean you should use them all. Two or three levels usually convey structure without overwhelming the reader, while five or six levels of nested groups become a maze nobody wants to navigate. If you find yourself building extremely deep outlines, that is often a sign the data belongs in a pivot table or a proper database rather than a single hand-grouped worksheet.
Third, combine grouping with frozen headers so context never disappears as you scroll. Knowing how to freeze a row in Excel keeps your column titles locked in place while you expand and collapse hundreds of rows below them. This pairing is especially valuable in long financial reports where losing sight of the header row makes the numbers ambiguous. Set up your freeze panes once, build your outline, and the report becomes effortless to read at any scroll position.
Fourth, consider adding a drop down list to control which view readers start from. Learning how to create a drop down list in Excel lets you build a small control cell, and with a touch of macro code you can collapse the outline to the level the user selects. Even without macros, a drop down paired with filtering gives readers a guided way to explore your data without accidentally breaking the grouping structure you carefully built.
Fifth, test your workbook the way a recipient will use it. Before sending, collapse everything to level one, then expand a single group to confirm the buttons behave and the totals match. Open the file on a different device if possible, since outline display can vary subtly between desktop Excel, the web version, and mobile apps. A two-minute test prevents the embarrassing moment when a manager opens your report and the carefully built outline does not respond as intended.
Finally, treat grouping as one tool in a broader toolkit for taming large data. It works beautifully alongside sorting, filtering, conditional formatting, and pivot tables, and the best analysts move fluidly between them. Practice on real datasets, use the free quizzes linked throughout this guide to reinforce the shortcuts, and within a week collapsing rows will feel automatic. The payoff is spreadsheets that respect your reader's time, surfacing the right level of detail exactly when it is needed.
Excel Questions and Answers
About the Author
Business Consultant & Professional Certification Advisor
Wharton School, University of PennsylvaniaKatherine Lee earned her MBA from the Wharton School at the University of Pennsylvania and holds CPA, PHR, and PMP certifications. With a background spanning corporate finance, human resources, and project management, she has coached professionals preparing for CPA, CMA, PHR/SPHR, PMP, and financial services licensing exams.