How to Group Cells (Rows / Columns) in Excel & Google Sheets

Written by

Mel Jenkins

Reviewed by

Laura Tsitlidze

Last updated on August 25, 2023

Shortcut to Group Rows or Columns

ALT + SHIFT +

See all Excel shortcuts

This tutorial demonstrates how to group rows and columns in Excel and Google Sheets.

grouping intro

Grouping or outlining data in Excel allows you to show and hide rows or columns depending on how much detail you want to see onscreen. Excel allows up to eight levels of grouping. To use the group function in Excel, your data must be organized in your worksheet in a way that works with the grouping functionality.

Manually Group or Ungroup Rows

  1. To group several rows together, first highlight the rows you want to group.

grouping select rows

  1. In the Ribbon, go to Data > Outline > Group > Group.

Group Ribbon

  1. A minus sign gets added into the outline bar on the left of the screen. Clicking on the minus collapses the group. The minus sign changes to a plus sign, indicating that there is hidden data.

Group Row Group

  1. If necessary, repeat manual grouping to add more groups to the worksheet.

Group Multiple Row Groups

Tip: Instead of the +/ outline symbols, you can also use the 1 or 2 in the top-left corner of the screen to expand or collapse all the groups. Clicking on the 1 collapses all groups; clicking on 2 expands all groups.

Group Row 1or2

Manually Group or Ungroup Columns

  1. To group several columns together, first highlight the columns you wish to group. This can be done whether or not there are existing row groups.

grouping select columns

  1. In the Ribbon, go to Data > Outline > Group > Group to group the columns together. Repeat this until you have created all the groups you need.

grouping group columns

  1. Once you group columns (just like with rows), you can add a new level by grouping again. This adds a third level of grouping to the outline symbols in the top-left corner of the screen.

grouping group 3 level

Once again, you can repeat this across the worksheet, adding up to eight levels of grouping.

Grouping grouping all levels

Ungroup Rows or Columns

  1. Highlight the group you wish to ungroup and then, in the Ribbon, go to Data > Outline > Ungroup > Ungroup. This only removes one group.

Grouping Ungroup

  1. To remove all the grouping in the worksheet, click anywhere in the data, and then in the Ribbon, go to Data > Outline > Ungroup > Clear Outline.

grouping clear outline

Auto Outline

You can use the Auto Outline feature in Excel if your data is logically organized so that Excel recognizes the groups within the rows and columns. There must not be any blank rows in the data and the data must be summed or subtotaled at each level.

▸ Click anywhere in the data where you wish the outline to be created and then, in the Ribbon, go to Data > Outline > Group > Auto Outline.

grouping auto outline

Excel creates as many grouping levels as the logical layout of the data has.

grouping auto outline groups

Group Cells in Google Sheets

You can only group or ungroup rows and columns manually in Google Sheets.

  1. Select the rows you wish to group, and then in the Menu, go to View > Group > Group rows (the row numbers selected are shown).

Grouping GS Group

  1. Similarly, select the columns you wish to group and then in the Menu, go to View > Group > Group columns (the column letters selected are shown).

grouping gs group columns

  1. To ungroup rows or columns, click in the group you wish to ungroup and then in the Menu, go to View > Group > Ungroup (rows or columns).

grouping gs ungroup columns

AI Formula Generator

Try for Free

See all How-To Articles