How to Group Rows and Columns in Google Sheets: A Comprehensive Guide

Video google sheet group rows by value

If you’re wondering whether Google Sheets allows you to group rows, the answer is a resounding yes! This feature was added in 2018, and it works like a charm!

Grouping data in Google Sheets enables you to consolidate rows/columns that you can expand and collapse with a simple click or keyboard shortcut. It makes your data more concise by hiding grouped data. And if you need more details, you can quickly expand and view the grouped data.

View more row actions

Let’s dive into how you can use the grouping feature in Google Sheets.

A Simple Guide to Grouping Rows in Google Sheets

Imagine you have a dataset where you want to group rows to display data by quarter and have the rows representing each quarter grouped together.

Here are the steps to group rows in Google Sheets:

  1. Select the rows you want to group. Make sure to select the entire row by clicking on the row number on the left of the document, not just the cells in the spreadsheet.
  2. Right-click on the selected rows.
  3. Go to “Show more options for rows.” Click on the “Group 2-4 rows” (it will display the number of rows you selected).

And that’s how you use Google Sheets to group rows! These steps will instantly group the rows, and a gray vertical block will appear on the left with a minus (-) icon.

Clicking on this minus icon hides all the grouped rows, and it transforms into a plus (+) sign, indicating that it contains grouped rows.

If you want to group other rows, simply follow the same steps mentioned above.

Note: You can only group contiguous rows. If you select non-contiguous rows and right-click, the grouping option will not appear.

Recommended read: How to Merge Cells in Google Sheets

Keyboard Shortcut to Group Rows in Google Sheets: Alt + Shift + ->

There’s another (faster) way to group rows in Google Sheets: using a keyboard shortcut.

Let’s say you have the dataset below, and you want to group rows 2-4. Here are the steps to use a keyboard shortcut to do so:

  1. Select the cells you want to group (A2:A4 in this example).
  2. With the selected cells, hold down the Alt and Shift keys and press the right arrow key (on Windows). Mac users should hold down the Option key instead of the Alt key.
  3. Choose “Group 2-4 rows.”

This will automatically group your rows, and a minus sign will appear on the left.

Personally, I find this keyboard shortcut method much quicker for grouping rows and columns in Google Sheets.

Grouping Columns in Google Sheets

Similar to grouping rows, you can also group columns in Google Sheets.

Let’s say you have a dataset as shown below, and you want to group columns B and C to be able to hide and display only the Total Sales column.

Here’s how you can group columns in Google Sheets:

  1. Select the columns you want to group. Make sure to select the entire column by selecting the column header at the top of the document, not just the cells in the spreadsheet.
  2. Right-click on the selected columns.
  3. Go to “Show more options for columns” and click on the “Group columns B-C” option.

The above steps will instantly group these two columns, and a minus icon will appear above the rows. Clicking on this minus icon hides the columns, and it transforms into a plus icon. Clicking the plus icon will make these columns visible again.

Now that you know how to hide columns in Google Sheets, let’s move on to grouping rows on multiple levels.

Creating Multiple Levels of Row Grouping

In the above examples, we only grouped rows based on a single level. For example, when we grouped rows, we did it for all quarters. So when you hide all grouped rows, you will see the dataset as shown below (which only shows quarters and annual values).

But what if you now want to add another level of grouping, where even the quarters are grouped and hidden, and only the annual value is visible? You can do this by adding another layer of grouping on top of the existing one, which helps save space, especially if you have expanded rows or columns.

Here are the steps:

  1. Start by creating the individual groups.

Select all the groups

  1. Select the rows you want to group. In our case, we will select the rows without the header and the annual summary at the bottom.
  2. You can either use the keyboard shortcut (Alt + Shift + ->) or right-click and go to “Show more options for rows” > “Group rows.”

As soon as you do this, you will notice that you now have two levels of grouping (visually shown in the gray bar on the left).

The first (larger) level will hide all the rows and only show the year, while the second level will have multiple groupings that you can use to hide all the data at the month level and only show quarterly data.

Expanding/Collapsing All Grouped Rows/Columns

When you have created many groups of rows or columns, expanding or collapsing them one by one can be time-consuming. While the option to do it individually for each group exists, it’s not efficient. Instead, you can use the following shortcut.

  • To expand all groups (i.e., make all rows visible), right-click on one of the plus (+)/minus (-) icons and click “Expand all grouped rows.”
  • To collapse all groups (i.e., hide all rows and only show the outlines), right-click on one of the plus (+)/minus (-) icons and click “Collapse all grouped rows.”

Ungrouping Rows and Columns in Google Sheets

Now that you know how to group cells in Google Sheets, removing grouped rows in Google Sheets is extremely simple.

Simply right-click on the plus (+)/minus (-) icon and click “Remove group.”

If you have a large dataset and many groups, you can select all the grouped rows (by selecting the leftmost column numbers) and then click on the “Ungroup rows” option.

You can also change the position of the +/- icon that appears after grouping. Just right-click on one of the +/- icons and choose “Move +/- button to the bottom.” You can follow similar steps to restore hidden rows in Google Sheets.

Ungrouping Rows and Columns with a Keyboard Shortcut

To ungroup columns in Google Sheets using a keyboard shortcut, use the left arrow instead of the right arrow. So the complete shortcut would be:

  • PC: Alt + Shift + Left arrow
  • macOS: Option + Shift + Left arrow

FAQs

What is the shortcut to group rows in Google Sheets?

To group rows in Google Sheets, you can use the shortcut: Shift + Alt + →.

Simply select the rows you want to group, then hold down the Shift, Alt, and right arrow keys (Shift + Alt + →). This will group the selected rows, and a small gray line will appear to the left of the row numbers to indicate that the rows are grouped.

How to name a group of rows in Google Sheets?

Click on the group, then go to “Data” > “Named ranges”, and assign a name.

What does grouping a row in Google Sheets mean?

Grouping rows or columns attaches them together so that you can select them all at once next to the row or column header.

Conclusion

Now that you know how to use the grouping feature in Google Sheets, we have provided you with all the necessary information and steps to practice and enhance your skills on Google Sheets. We hope you found this tutorial helpful, and feel free to leave your comments below.

Bolamarketing.com – Crawlan.com

Related posts