Group, Collapse & Expand Excel Rows/Columns on ALL Worksheets
Grouping rows in Excel lets you collapse and expand parts of your spreadsheet with a click. This makes large datasets easier to read by hiding repeated values.
We’ll show you how to quickly group rows in Excel using both regular Excel features and the Macabacus add-in.
Grouping rows is useful when your data contains many duplicate values. For example, you may have a dataset with sales figures for multiple products over several years. Without grouping, you’d see the product name repeated on every row. You may also have many different sections to your worksheet. You would then have to scroll down hundreds of rows to get to a section of your workbook.
By grouping rows by product, you can collapse each product to a single row. This simplifies the view and reduces scrolling. Click the arrow next to a product to expand the group and see the individual years again. Grouping also lets you subtotal numeric data at different levels. You can quickly sum figures by product, year, or overall.
Finally, grouping visually separates data into sections. This improves readability of large datasets.
How to Group Rows in Excel
Selecting and Grouping Rows
To group rows in Excel manually:
Select the rows to group together.
Navigate to the Data tab.
Press the Group button to group the selected rows.
Grouping rows allows you to show and hide parts of your data with a single click (we’ll show you how to do that later on in this post). This makes it easy to focus on specific sections of a large dataset.
Grouping Rows Automatically
If your Excel data contains patterns like subtotals, you can automatically group rows by following the instructions below:
Click any cell in your data range.
On the Data tab, open the Group menu.
Select Auto Outline. Excel will detect and group rows based on your data’s structure.
The outlining feature saves time by detecting and applying groups for you based on patterns in your data. This works well for structured data like financial models.
How to Group Columns in Excel
Column Grouping
To manually group columns:
Select your column’s cells that you want to group.
Go to the Data tab.
Press the Group button.
Grouping related columns together makes it easy to show/hide entire categories of data.
Column Grouping Automatically
If your column data has clear patterns, Excel can automatically detect and group them:
Choose any cell in your data range.
Go to the Data tab.
Open the Group menu and select Auto Outline.
Outlining columns follows the same concept as rows – Excel finds patterns and groups accordingly. This can get tedious in large, complex spreadsheets.
Grouping Nested Data
For nested data (groups within groups):
First group the innermost data.
Keep this group collapsed.
Group the larger outer data set.
This makes a hierarchy. The numbering allows you to collapse all (1), show the outer group (2), or display all groups (3).
Nested groups create a hierarchical structure, allowing you to collapse and expand the data at different levels.
Collapsing and Expanding Groups
Once groups are set up, use these shortcuts. Keyboard shortcuts and grouping icons provide quick access to show and hide grouped data.
Keyboard Shortcuts
Select the full sheet with Ctrl + A.
To collapse all groups, press Alt + A + H.
To expand them, press Alt + A + J.
Grouping Icons
Click the numbers (usually 1 and 2) on the side of the Excel window.
1 collapses groups, 2 expands them.
It’s important to note that these won’t work if your goal is to expand or collapse all worksheets. Use Macabacus for multi-sheet grouping.
Macabacus Shortcuts
Macabacus has quick shortcuts to collapse and expand.
Macabacus extends grouping functionality beyond what’s built into Excel and can also help you perform this action across all sheets or the whole workbook.
Collapsing and Expanding All Worksheets using Macabacus
To collapse/expand across multiple sheets:
Highlight multiple sheets/tabs.
Use the Macabacus shortcuts above.
Confirm you want to apply to all selected sheets.
This allows you to quickly show or hide groups on multiple sheets at the same time. The “Prepare to Share” tool will also help you collapse all groups before sending the workbook. This removes clutter by hiding grouped rows and columns before sharing with others.
When to Use Macabacus for Grouping Rows in Excel
Grouping rows manually or without shortcuts works fine for small datasets, but Excel’s native tools have clear limitations:
Grouping large sheets with many rows is tedious
Expanding/collapsing many groups requires excessive clicking
Can’t collapse groups on all sheets at once
This is where Macabacus shines. It lets you instantly expand or collapse all groups with a keyboard shortcut. It is extremely useful if you work with:
Large, complex Excel workbooks
Dashboards or reports with many grouped rows
Multi-sheet workbooks requiring group consistency
Try the Macabacus free trial today to instantly expand or collapse groups across entire workbooks with a simple keyboard shortcut.
Build Models & Decks 10x Faster with Macabacus
Gain access to 100+ shortcuts, formula auditing visualizations, easy Excel-to-PowerPoint linking, and productivity tools to build models and presentations faster than ever.
Elevate your investment analysis with our free DCF model template. Understand discounted cash flow principles and perform accurate valuations in Excel.