Today, we are going to learn how to group columns and rows. In our exam­ple, we have month by month sales, and their sum­maries by the first quar­ter, the sec­ond quar­ter and half a year with the use of the SUBTOTAL func­tion.

How to group columns and rows
Columns
Fig. 1 Columns

Some­times, we don’t want to show low­er val­ues, i.e. val­ues from indi­vid­ual months. We can do it by hid­ing those columns (Fig. 2).

Hide option
Fig. 2 Hide option

And some­times, we want to show those val­ues (Fig. 3). 

Unhide option
Fig. 3 Unhide option

Those tasks, how­ev­er, can some­times be a bit tedious. That’s why we are going learn how to group those columns to make it sim­pler. First, you have to select the columns you want, then go to the Data tab and click on the Group com­mand. Now, we can see a line above col­umn names, which allows us to hide the columns just by click­ing on the minus sign (Fig. 4). 

Grouped columns
Fig. 4 Grouped columns

We can also unhide them by click­ing on the plus sign (Fig. 5).

Unhiding the grouped columns
Fig. 5 Unhid­ing the grouped columns

Now, the task is quite sim­ple. You can hide or unhide many columns at once. We can group even more columns this way, how­ev­er, it’s impor­tant to have a space of at least one col­umn between those groups so that Excel does­n’t com­bine those groups in one (Fig. 6). 

Groups separated by one column
Fig. 6 Groups sep­a­rat­ed by one column

When we want to ungroup our data, there is a sim­ple solu­tion. You have to go to the Data tab, expand the Ungroup com­mand, and choose the Clear Out­line option (Fig. 7). This way, Excel will clear all groups in the sheet. Usu­al­ly, it’s eas­i­er to clear all groups and start cre­at­ing new groups from the begin­ning than try­ing to fix it. 

Ungrouping data
Fig. 7 Ungroup­ing data

Due to the fact that our val­ues are com­bined from dif­fer­ent columns, we can make Excel group the val­ues for us. You just select any cell, go to the Data tab, expand the Group com­mand and choose the Auto Out­line option (Fig. 8). 

Auto Outline option
Fig. 8 Auto Out­line option

This way, Excel has cre­at­ed three groups for us. Those groups aren’t on the same lev­el because each low­er lev­el group com­bines three columns, and the upper lev­el group com­bines all the columns from the low­er groups and a few more (Fig. 9). 

Groups on different levels
Fig. 9 Groups on dif­fer­ent levels

When we click on the group lev­el num­ber, Excel will expand or col­lapse all groups in this lev­el (Fig. 10). 

Group level numbers
Fig. 10 Group lev­el numbers

Now, let’s group some rows. We don’t have any func­tion that sums up or com­bines rows, so we have to do it man­u­al­ly. We have to select the rows we want, then go to the Data tab, then the Group option (Fig. 11). 

 Row grouping
Fig. 11 Row grouping

If we select a range, not whole columns or rows and press the Group com­mand, Excel does­n’t know which ones we want to group. Then we have to select the prop­er radio but­ton (Fig. 12). 

Selecting the proper option
Fig. 12 Select­ing the prop­er option

We can also select more rows and group them by press­ing the Group option to cre­ate a group on a high­er lev­el. This group will con­sist of groups from a low­er lev­el. We can expand and col­lapse them the using also lev­el num­ber but­tons (Fig. 13). 

Row group levels
Fig. 13 Row group levels