Collapsing rows on excel

Home > Microsoft Excel > How to Use the Excel Collapse Rows Feature? — 4 Easy Steps

(Note: This guide on the Excel collapse rows feature is suitable for all Excel versions including Office 365.)

If you ever had to use an Excel sheet with thousands of rows, you will certainly agree that it was a daunting task. It is definitely confusing to keep track and analyze all the information, especially with complex spreadsheets. 

Thankfully, Excel has an option to collapse certain rows temporarily and group them together for later use. These collapsed rows can be expanded later to the original view and used as usual.  This feature will help you create compact and easy-to-read spreadsheets. 

For example, let’s assume you have a large worksheet. You wish to view only certain rows that summarize the data in subtotals or grand total. To do this, you can use the Excel collapse rows feature. 

In this guide, I’ll teach you how to collapse rows in Excel the easy way. 

You’ll learn:

  • How to Use the Excel Collapse Rows Feature?
  • How to Use a Nested Collapse?
  • How to Expand Collapsed Rows?
  • How to Clear Collapsed Rows?
  • How to Copy and Paste Visible Rows?

Related:

How to Delete a Pivot Table in Excel? 4 Best Methods

How to Indent in Excel? 3 Easy Methods

How to Use the Format Painter Excel Feature? — 3 Bonus Tips

How to Use the Excel Collapse Rows Feature?

Although it might look complicated at first, the Excel collapse rows feature is quite simple to use. 

Just follow these steps:

  1. Make sure that the excel worksheet is in a structured format with properly organized data. 
Click on the arrow icon in the Outline group of the Data tab
Click on the arrow icon in the Outline group of the Data tab
  1. Select the rows that you wish to collapse, then click on the Data tab and Groups in the Outline group, and then click on Group Rows.
  2. You will see a ‘-’ sign on the left of column A. When you click on the ‘-’ sign, the selected rows get collapsed. Now the ‘-’ sign changes to ‘+’ which denotes that the rows are hidden. 
+ and - buttons will appear on the left border to indicate collapsed or expanded rows
+ and – buttons will appear on the left border to indicate collapsed or expanded rows
  1. Now, toggle between the + and signs to collapse and expand the rows.
Use the + and - buttons to toggle on/off the Excel collapse feature
Use the + and – buttons to toggle on/off the Excel collapse feature

Also Read:

How to Use Goal Seek in Excel? (3 Simple Examples)

How to Insert Multiple Rows in Excel? The 4 Best Methods

How to Autofit Excel Cells? 3 Best Methods

How to Use a Nested Collapse?

If you want to collapse rows inside already existing collapsed rows, repeat the same process. Select the rows and go to Data > Group Rows

This will nest them together in groups, as shown below. 

Add multiple layers of nested collapsed rows if required
Add multiple layers of nested collapsed rows if required

You can add more nested groups if required. If you feel that you no longer need the rows to be collapsed, just click on the Ungroup option in the Outline feature under the Data tab.

This will first ungroup the outer levels first.

Level buttons with numbers starting from 1 will appear to indicate the number of nested collapses.
Level buttons with numbers starting from 1 will appear to indicate the number of nested collapses.

At the top left of the worksheet, you will find level buttons 1,2,3, and 4. These can also be used to expand and collapse the rows at each level of nesting. 

How to Expand Collapsed Rows?

You can click on the ‘+’ sign to show the hidden rows to expand the collapsed rows. Alternatively, you can also double click on the twin lines appearing in the collapsed rows area. 

Double click on the twin lines to expand collapsed rows
Double click on the twin lines to expand collapsed rows

How to Clear Collapsed Rows?

The hidden rows can be brought back by clicking on the Data -> Outline -> Ungroup – > Ungroup Rows. It starts by clearing the collapsed rows at the outer level and proceeds to clear the inner level.

You can also see the level buttons at the top-left corner of the worksheet disappearing.

Click on the Ungroup Rows option in the Outline section of the Data tab.
Click on the Ungroup Rows option in the Outline section of the Data tab.

How to Copy and Paste Visible Rows?

If you wish to copy only the visible rows follow these steps: 

  1. First, select the visible rows you want to copy.
  2.  Then, go to Home -> Editing -> Find & Select -> Go To Special and click on Visible Cells Only.
Select Visible Cells Only
Select Visible Cells Only
  1. Press Ctrl+C or right-click on the selected rows and select Copy.
  2. Paste the copied cells in a different location.  

Suggested Reads:

How to Group Worksheets in Excel? (In 3 Simple Steps)

How to Shade Every Other Row in Excel? (5 Best Methods)

How to Use the Excel Fill Handle Easily? (Top 3 Uses with Examples)

Closing Thoughts

In this guide we saw how to collapse rows in Excel, make use of nested collapse,  expand the rows and clear the collapsed rows.

The Excel collapse rows option is a very useful and lesser-known feature in Excel. Do use it to make your spreadsheets user-friendly. 

You can find more high-quality Excel guides in our free resources center.  

Simon Sez IT has been teaching critical IT software for over ten years. For a low, monthly fee you can get access to 100+ IT training courses by seasoned professionals.

Simon Calder

Chris “Simon” Calder was working as a Project Manager in IT for one of Los Angeles’ most prestigious cultural institutions, LACMA.He taught himself to use Microsoft Project from a giant textbook and hated every moment of it. Online learning was in its infancy then, but he spotted an opportunity and made an online MS Project course — the rest, as they say, is history!

To add collapsible Excel rows, simply select the rows you want to collapse and use the Outline feature under the Data tab to group them. You can then click the plus and minus symbols on the left to collapse and expand, or the numbers at the top to collapse all and expand all.

Contents

  • 1 How do I create a collapsible column in Excel?
  • 2 How do you group rows on excel and expand and collapse?
  • 3 How do you collapse rows in sheets?
  • 4 How do you collapse rows within a group?
  • 5 How do I enable filtering?
  • 6 How do you collapse multiple groups in Excel?
  • 7 What is the shortcut to collapse rows in Excel?
  • 8 How do you nest a row in Excel?
  • 9 How do you group adjacent columns or rows separately or independently in Excel?
  • 10 How do I filter rows in Excel?
  • 11 How do I create a custom filter in Excel?
  • 12 How do I filter and Unfilter in Excel?
  • 13 How do I group rows in Excel?
  • 14 How do I collapse rows in a pivot table in Google Sheets?

How do I create a collapsible column in Excel?

About This Article

  1. Click the Data tab.
  2. Click Group.
  3. Select Columns and click OK.
  4. Click – to collapse.
  5. Click + to uncollapse.

How do you group rows on excel and expand and collapse?

First, select the rows that need to be grouped. Now press the shortcut key SHIFT + ALT + Right Arrow Key to group these rows. In the above, we have seen how to group the data and how to group row with expand and collapse option by using PLUS & MINUS icons.

How do you collapse rows in sheets?

To hide a row, right click on the row number on the left of the spreadsheet and choose Hide row. To hide multiple rows in a Google Spreadsheet, click on the first row and drag across the rows you wish to hide, or hold the Shift key and click on the last row you want to hide.

How do you collapse rows within a group?

When we have a group in a Pivot table we wish to collapse, we will click on the (-) minus button at the side of the group’s bar to collapse the row.

How do I enable filtering?

Try it!

  1. Select any cell within the range.
  2. Select Data > Filter.
  3. Select the column header arrow .
  4. Select Text Filters or Number Filters, and then select a comparison, like Between.
  5. Enter the filter criteria and select OK.

How do you collapse multiple groups in Excel?

Outline Levels
Clicking the Number 1 box will collapse all of the groups. Clicking it again will expand the groups at the first level. If you have groups within groups then you will see additional numbered levels. Clicking each number will allow you to expand and collapse the data to the level you want.

What is the shortcut to collapse rows in Excel?

This method of hiding unnecessary data is much more convenient – you can press either a button with the sign “+” or “-“, or Excel shortcut ”Alt A J/H” (clicking one after another in this case) to collapse or unfold the cells.

How do you nest a row in Excel?

To create a nested (or inner) group, select all detail rows above the related summary row, and click the Group button. For example, to create the Apples group within the East region, select rows 2 and 3, and hit Group. To make the Oranges group, select rows 5 through 7, and press the Group button again.

How do you group adjacent columns or rows separately or independently in Excel?

How to group adjacent columns or rows separately or independently in Excel?

  1. Group adjacent two columns or rows separately with shortcut keys.
  2. Just select column A, and then hold Shift + Alt + Right arrow as following screenshot shown:
  3. And the first two columns are grouped immediately, see screenshot:

How do I filter rows in Excel?

To filter rows and columns:

  1. Right-click a row or column member, select Filter, and then Filter.
  2. In the left-most field in the Filter dialog box, select the filter type:
  3. In the middle field, select an option to set which values to keep or exclude:
  4. In the right-most field, enter the value to use for the filter.

How do I create a custom filter in Excel?

  1. Select the Data tab, then click the Filter command. A drop-down arrow will appear in the header cell for each column.
  2. Click the drop-down arrow for the column you want to filter.
  3. The Filter menu will appear.
  4. The Custom AutoFilter dialog box will appear.
  5. The data will be filtered by the selected text filter.

How do I filter and Unfilter in Excel?

Go to the Data ribbon and click the Clear icon in the Sort & Filter group. Go to the Home ribbon, click the arrow below the Sort & Filter icon in the Editing group and choose Clear.

How do I group rows in Excel?

To group rows or columns:

  1. Select the rows or columns you want to group. In this example, we’ll select columns A, B, and C.
  2. Select the Data tab on the Ribbon, then click the Group command. Clicking the Group command.
  3. The selected rows or columns will be grouped. In our example, columns A, B, and C are grouped together.

How do I collapse rows in a pivot table in Google Sheets?

Expand or collapse levels in a PivotTable
Double-click the item that you want to expand or collapse. Right-click the item, click Expand/Collapse, and then do one of the following: To see the details for the current item, click Expand. To hide the details for the current item, click Collapse.

Working on a sheet containing thousands of rows will definitely make you tired. Nobody would like to keep track of all the data and it becomes more daunting with a complex sheet. Excel lets you collapse rows easily by using multiple features and you can group them for later use. You can expand these Excel collapse rows quickly and convert them to their original form.

Let’s follow the below-given methods to understand how you can collapse rows in Excel.

Excel Collapse Rows Feature

Excel for some users is nothing more than a sheet containing unlimited cells that made rows and columns. When the dataset is large enough to handle, you can take Excel’s help and put that data into these rows and columns for a better understanding. The grouping feature in Excel lets you collapse rows easily.

For Excel collapse rows with headers, you will definitely be needing to add some thought into how you can do this when the sheet is all set up.

How Excel Collapse Rows with Context Menu?

Hiding rows in Excel by using the context menu is one of the main approaches you can use. In our dataset, you can see three orders for bananas. Let’s see how you can hide them:

  • First, choose the rows that have orders for Banana, such as rows 5, 6, and 7.

collapse rows context menu

  • Right-click on the mouse and then click on the “Hide” button from the Context Menu.

collapse rows context menu2

  • You will notice that rows 5, 6, and 7 are collapsed.

collapse rows context menu3

Excel Collapse Rows with Filtering

Filtering rows to hide them from a large collection of data is possible with data analysis in Excel. Let’s see how it happens:

  • First, select the entire dataset.

collapse rows filtering

  • From the Excel, Ribbon choose the Data Tab and then Filter.

collapse rows filtering2

  • Click on the down arrows that appear there. It will give you the option to filter rows based on specific criteria.

collapse rows filtering3

  • In the Category column, choose the down arrow. Check the Fruit option given in the context menu and press OK.

collapse rows filtering4

You will notice the dataset is now filtered for Fruit items only and Vegetable rows have been collapsed.

collapse rows filtering5

Excel Collapse Rows with Keyboard Shortcuts

Using a keyboard shortcut is the first approach for many Excel users. Excel every time provides shortcuts to save time and effort. This time for hiding rows, Excel gives us effectively used keyboard shortcuts. Let’s dive in to see how it happens:

  • First, choose the rows such as 5 – 10.

collapse rows shortcut

  • Now press the shortcut command:

ALT + H + O + R

collapse rows shortcut2

Things to Consider

While using keyboard shortcuts, follow the given keys as well:

  • To select the entire column in the dataset:

Press SHIFT + Space

  • To group selected rows:

Press SHIFT + ALT + Right Arrow key

  • To ungroup rows:

Press SHIFT + ALT + Left Arrow key

Wrap it Up

Now, you have learned the best methods for Excel collapse rows and columns. All you need to do is practice so that you can easily manage to perform any task quickly.

Filters or hiding cells serve the purpose when the underlying information belongs to the same category. But for those which have subsets, as in small groups within each larger group, these features provided by MS Excel does not deem to be fit. What else does Excel’s bags of tricks have got to offer on this occasion?

Also read: How to Hide Cells in MS Excel?

We are going to have a look at just that in the following sections & we would be using the following tabulation to demonstrate through each of the below methods,

  1. Selecting from Data Tab
  2. Keyboard Shortcut

Sample Dataset 1

Lengthy Dataset for Demonstration

Grouping of Rows:

To group any given data, one has to look into the commonalities that exist, which in the above dataset is the time period for 2021, which has been summarised under each Region. The given tabulation consists of four different regions with the sales details for a period of 12 months listed under each region.

12 Months Listed under North Region

12 Months Listed under North Region

There also exists a summary which contains the total of the sales numbers for that year at the very beginning.

Summary for North

Summary for North Region

That’s all for the briefing & your mission, should you choose to accept it is to group all 12 months under each region such that it would be easier to compare any two regions against each other in a single click.


Method 1 – Selecting from Data Tab:

Let us get started by selecting the rows of the 12 months given under the North region as shown in the below image.

Selecting Rows to Group

Selecting Rows to Group under North

Navigate your way using the cursor to the Data tab & that is where you will be finding the Group option.

Locating Group Option

Locating the Group Option

What are you waiting for? Click on that option!

The following changes would be visible on your screen in a jiffy.

Rows Grouped North

Rows Grouped under North

“Yeah, yeah! Enough of gimmicks & can you tell me what to do with those buttons in the above image?”

I’ve foreseen these voices of yours & here is what one can do. Click on the minus (-) button to collapse all the 12 months under the North region. Once done, the minus (-) button transforms itself into a plus (+) button & the 12 months has gone with the wind.

Plus Sign

Rows under North Collapsed

Repeat the same procedure for the other regions too such that all the rows with the months from Jan to Dec get hidden only to be summoned by the click of the plus (+) button.

All groups collapsed

All Sections Collapsed

Method 2 – Keyboard Shortcut:

The part where we select the rows of the months under a region remains the same as stated in the previous method. The difference kicks in now.

Rather than moving the cursor, one shall place the fingers over the keys of the keyboard. Which keys do you ask?

These!

SHIFT + ALT + RIGHT ARROW KEY (→)

Much emphasis is on pressing the keys one after the other, similar to the way CTRL+C or CTRL+V is exercised. Trying to pull off anything else, would only render the execution of this shortcut unfeasible.

After the above keys are pressed in the same sequence, the selected rows would be collapsed as shown below.

Rows Grouped North 1

Rows Grouped under North

The same technique is repeated to group & collapse the months of the other regions too.

All groups collapsed 1

All Sections Collapsed

Conclusion:

Hope the article was informative. Here is an additional lead to an article that might interest you! To know how to freeze columns in MS Excel, do have a look at this article. QuickExcel has numerous other articles too which could help you with that one thing that you’re trying to do with MS Excel right now. Cheers!

In this tutorial, you will learn how to expand and collapse rows or columns by grouping them in Excel and Google Sheets.

excel expand collapse rows final data

Excel allows us to group and ungroup data, which enables us to expand or collapse rows and columns to better organize our spreadsheets. This is possible by grouping data manually or using the Auto Outline option.

Group and Ungroup Rows Manually

If we want to group rows in Excel, we need to have data organized in a way that’s compatible with Excel’s grouping functionality. This means that we need several levels of information sorted correctly and subtotals for each level of information that we want to group. Also, data must not have any blank rows or spaces.

In the following example, we have total sales per month by product. Therefore, data are sorted by month and product and we have subtotals for each month, as we want to group data by month.

group ungorup excel initial data 1

To group data for Jan-21 and Feb-21:

1. (1) Select data in the column that we want to group. In our case that is Jan-21, so we’ll select C2:C8. Then, in the Ribbon, (2) go to the Data tab, and in the Outline section, (3) click on the Group icon. (Note that you could also use a keyboard shortcut instead: ALT + SHIFT + right arrow).

group rows excel 1

3. In the new window, leave Rows selected since we want to group rows and click OK.

group rows excel 2a

As a result, we get the outline bar on the left side with Jan-21 grouped.

4. If we want to collapse this group of data, we just need to click on the minus sign in the outline bar.

excel rows group 1

As shown in the picture below, all rows with Jan-21 in Column C are collapsed now and only the subtotal for this period remains visible.

excel rows ungroup 1

5. As in Step 4, we can expand the group (displaying rows) again, by clicking the plus sign. Following the exact same steps, we can also group data for Feb-21.

Group and Ungroup Multiple Levels of Data

Say we want to add another level of data grouping: Product. First, add a subtotal for all products.

group multi levels of data 1

Currently, we have two groups for Month level and subtotals for months and products. Now, we want to add groups for products. We can do this in the exact same way as we did for months. In this case, we’ll add six groups of data, selecting – separately – Keyboard (D2:D4), Mouse (D6:D7), etc. As a result, our data and outline bars look like the picture below.

group multi levels excel 1

We now have two outline bars and the second one represents groups of products. Therefore, we can collapse all product groups, and have data organized in a way that displays only subtotals per month per product.

multi level data collapsed 1

Group and Ungroup Rows Using Auto Outline

Instead of creating groups manually, we can also let Excel auto outline our data. This means that, if we have well-structured data, Excel will recognize groups and group data automatically.

To let Excel outline the data automatically, (1) click anywhere in the data, then in the Ribbon, (2) go to the Data tab, click on the arrow below the Group icon, and (3) choose Auto Outline.

auto outline data excel 1

We get almost the same outline bars as in the manual example because Excel can recognize data groups. The only difference is that the Auto Outline option creates one group more for Grand Total, which can collapse all the data except the Total.

auto outline data excel 2a

To remove outline bars created by Auto Outline, (1) click anywhere in the data then in the Ribbon, (2) go to the Data tab, click on the arrow below the Ungroup icon, and choose (3) Clear Outline.

excel clear auto outline1

This will remove all outline bars and ungroup all data.

group ungorup excel initial data 1

Expand and Collapse Entire Outline

Say we want to collapse the entire outline (for example, Month). In the outline bar, at the top, click on the outline bar number we want to collapse (in our case, outline level 2).

collapse entire outline 1

As a result, all rows with Jan-21 and Feb-21 are collapsed and only the totals are displayed.

If we want to expand the entire outline again, (1) click on Grand Total, then in the Ribbon, (2) go to the Data tab, and in the Outline section, (3) click on Show Detail.

expand entire outline 1

Now all data is visible again, and the Month outline is expanded.

auto outline data excel 2a

Group and Ungroup Columns Manually

Similarly, we can also group columns in Excel. Say we want to display only SKU and the corresponding Total Sales.

1. Select all column headings that we want to group (in our case C1:F1).

group columns excel 1a

2. In the Ribbon, go to the Data tab, and in the Outline section, choose Group (or use the keyboard shortcut ALT + SHIFT + right arrow).

group columns excel 2

2. In the pop-up screen, (1) select Columns and (2) click OK.

group columns excel

As a result, we will get a new outline bar, but this time for the columns.

3. To collapse the group of columns, click on the minus sign at the end of the outline bar.

collapse columns groups 1

As a result, Columns C:F are collapsed.

collapse columns groups 2

Group and Ungroup Rows in Google Sheets

In Google Sheets, we can only group rows manually, so let’s use the same example and see how to group data into the same categories. To group by month:

1. (1) Select all rows with Jan-21, then in the menu, (2) go to Data, and click on (3) Group.

google sheets group rows 1

2. In the new window beside the selection, click on Group rows 2 – 11.

google sheets group rows 2a

Jan-21 (Rows 2–11) are now grouped, and we can see the outline bar on the left side. The difference compared to Excel, is that the minus/plus sign for collapse/expand is a the top of each group.

3. To collapse Jan-21, click the minus sign at the top of the outline bar for months.

google sheets collapse rows 1

Now, data for the month are collapsed, and we can see only the Jan-21 Total row.

4. We now get the plus sign, so we can expand the group again.

google sheets expand rows 1

5. Following these steps, we can also group Feb-21 and create a new outline for the Product data level. When we’re done, the data and outline bars should look like this:

google sheets outline bars 1

Ungrouping data in Google Sheets works just like grouping.

1. (1) Select the data we want to ungroup (Keyboard in Jan-21– cells D2:D4), then in the menu, (2) go to Data, and (3) click on Ungroup.

google sheets ungroup rows 1

2. In the new window beside the selection, click on Ungroup rows 2 – 4.

google sheets ungroup rows 2a

Those three rows are now ungrouped and removed from the outline bar.

google sheets ungroup rows 3a

Group and Ungroup Columns in Google Sheets

Grouping columns can be done in a similar way to grouping rows.

Select Columns C:F, then in the menu, go to Data, and click on Group columns C – F.

google sheets group columns 1

Now, we get the outline bar for column grouping.

google sheets columns outline bar 1

To ungroup columns, select Columns C:F, go to Data, and click on Ungroup columns C – F.

Понравилась статья? Поделить с друзьями:
  • Coldest place in the word
  • Cold end of the word
  • Code for colours in excel
  • Coinkeeper экспорт в excel
  • Code excel на русском