If you’ve been asking yourself, “Can Google Sheets group rows?” The answer is yes. The functionality was added in 2018, and it works great!
Grouping data allows you to group rows/columns (that you can expand and collapse with a single click or a keyboard shortcut). This makes your data more concise by hiding the grouped data, and in case more detail is needed, you can quickly ungroup and show the grouped data.
Below is an example where I have the data for four quarters, and I have grouped each quarter’s data. To view the data, I can easily click on the plus icon on the left, and it shows me the data for that quarter.
Now, let’s see how to use the Google Sheets group rows and columns feature.
Table of Contents
Simple Google Sheets Group Rows Guide
Below is a dataset where I want to group rows so that I only have the quarter-wise data available, and the rows that make this data are grouped.
Below are the steps for grouping rows in Google Sheets:
- Select the rows that you want to group. Make sure you select the entire row by selecting the row number at the leftmost of the document (and not the cells in the worksheet).
- Hover the cursor over the selected rows and right-click.
- Go to “View more row actions.” Click on the option, Group rows 2-4 (in your case, it will show the number of the rows you have selected).
And that’s how you use Google Sheets to collapse rows!
The steps above will instantly group the rows. It will also display a gray vertical block on the left-most part with a minus icon (−).
When you click on this minus icon (−), it will hide all the grouped rows and the icon will change to a plus sign (+), indicating it contains some grouped rows.
If you want to group any other rows, you need to follow the same steps above.
Note: You can only group contiguous rows. If you select non-contiguous rows and right-click, it will not show you the option to group.
Related Reading: How To Merge Cells in Google Sheets
Keyboard Shortcut to Group Rows in Google Sheets: Alt + Shift + ->
Suppose you have the dataset below where you want to group rows 2-4. Below are the steps to using a keyboard shortcut to do this:
- Select the cells that you want to group (A2:A4 in this example).
- With the cells selected, hold the Alt and Shift keys and press the right arrow key (on Windows). Mac users should hold the Option key instead of Alt).
- Choose Group rows 2-4.
This will automatically group your rows and a minus sign will appear to the left.
Personally, I find using this keyboard shortcut method a lot faster to group rows and columns in Google Sheets.
Group Columns In Google Sheets
Just like rows, you can also group columns in Google Sheets.
Suppose you have a dataset as shown below and you want to group column B and C, so that you can hide and only show the total sales column.
Here’s how to group columns in Google Sheets:
- Select the columns that you want to group. Make sure you select the entire row by selecting the column alphabet at the top-most of the document (and not the cells in the worksheet).
- Hover the cursor over the selected columns and right-click.
- Go to “View more column actions” and click on the option, “Group column B-C.”
The above steps will instantly group these two columns and show a minus icon at the top of the rows. When you click on this minus icon, it will hide the columns and change it into a plus icon (+). When you want to see these columns, you can click on the plus icon (+) and these columns will become visible.
Now you know how to collapse columns in Google Sheets, we’ll move onto grouping rows in mutliple layers.
Creating Multiple Layers of Grouping
In the above examples, we have only grouped rows based on one layer. For example, when we grouped the rows, we did it for all the quarters. So when you hide all the grouped rows, you will see the dataset as shown below, (which shows only the quarters and the year values).
But what if now you want to add another layer of grouping, where even the quarters are grouped and hidden and only the year value is visible? You can do that by adding another layer of grouping over the existing one, saving space, especially if you have enlarged rows or columns.
Below are the steps to do this:
- Start by creating the individual groups
- Select the rows you want to group. In our case, we’ll select the rows without the header and the year summary at the bottom.
- You can use the keyboard shortcut (Alt + Shift + ->) or right-click to go to “View row actions” > “Group rows.”
As soon as you do this, you will notice that you now have two layers of grouping (you can see this visually in the gray stripe in the left-most part).
The first (bigger) layer will hide all the rows and show only the year, while and the second layer has multiple grouping that you can use to hide all month level data and show only quarterly data.
Expanding/Collapsing all Grouped Rows/Columns
When you create a lot of grouped rows or columns, it will take you a lot of time to expand or collapse all. While doing it one by one for each group is an option, it’s not the efficient one. Instead, you can use the shortcut below.
- To expand all groups (i.e., to make all the rows visible), right-click on any of the plus (+) /minus (−) icons and click on “Expand all row groups.”
- To collapse all groups (i.e., to hide all the rows and only show the outlines), right-click on any of the plus (+) /minus (−) icons and click on “Collapse all row groups.”
Ungroup Rows and Columns in Google Sheets
Now that you can group cells in Google Sheets, removing the Google spreadsheet collapsed rows is super simple.
Just right-click on either the plus (+)/ minus (−) icon and then click on “Remove Group.”
In case you have a huge dataset and many groups, you can select all the grouped rows (by selecting the left-most column numbers) and then clicking on the “Ungroup rows” option.
You can also change the position of the +/- icon that appears after the grouping. Just right-click on any of the +/- icon and you get the “Move +/- button to the bottom” option. You can also follow similar steps to unhide rows in Google Sheets.
Ungroup Rows and Columns With a Keyboard Shortcut
To remove grouping columns in Google Sheets with a keyboard shortcut, you use a left arrow instead of a right arrow. So, the whole shortcut would be:
- PC: Alt + Shift + Left Arrow
- macOS: Option + Shift + Left Arrow
Frequently Asked Questions
What Is the Shortcut to Group Rows in Google Sheets?
To group rows in Google Sheets, you can use the shortcut: Shift + Alt + →.
Just select the rows you want to group and press and hold the Shift key, then press the Alt key, and finally press the right arrow key (Shift + Alt + →). This will group the selected rows together, and a small gray line will appear to the left of the row numbers indicating that the rows are grouped.
How Do You Name a Group of Rows in Google Sheets?
Click on the group, then navigate to “Data” > “Ranges” and assign a name.
What Does It Mean to Group a Row in Google Sheets?
Grouping rows or columns attaches them to each other so they can be easily selected all at once next to the row or column header.
So now you know how to use the Google Sheets group rows and columns function. We have provided you with all the information and steps, so you can practice away and improve your Google Sheets skills. We hope you found this tutorial, and feel free to leave your comments below.
- How To Freeze Rows in Google Sheets
- How To Lock Cells in Google Sheets
- How To Insert Multiple Rows in Google Sheets (with Useful Shortcut)
- How To Color Alternate Rows In Google Sheets
- How To Delete Empty Rows in Google Sheets
- How To Jump to Specific Cell or Range in Google Sheets?
- How To Unmerge Cells in Google Sheets
- How To Merge Cells in Google Sheets (Easy Step-by-Step)
- How To Move Columns in Google Sheets