Group is a tool in excel with which we can group two or more rows or columns together, it helps to represent the group of rows or columns together, also it gives us an option of minimize and maximize the group, minimizing the group hides those rows or columns grouped together and maximizing shows the group, Group option is available in the data tab under the outline section.
Excel Group Data (Table of Contents)
Group Excel Data
In a worksheet, we see many lines of data and it is often difficult to see the entire report at a time. Sometimes data is a complex structure and it forces us to organize the data according to our needs. Fortunately, in excel we have many ways of consolidating the data precisely. In such cases, we need to group our rows and columns make the data readily readable and reduce the complexity of the data structure.
Grouping either rows or columns in excel makes the data easy to read and understand. We can expand to see the break-up and we can collapse at any point in time to see the actual data in a worksheet.
How to Group Data in Excel?
You must be wondering when you have to group your data and how to group in Excel. For this, I have created on simple example data in a worksheet.
Now let me tell you the data structure here. A country is same for some items and sometimes have same countries. Instead of seeing all the country names we can club all the countries into one and make the data very precise or else we can go one step ahead and group products as well and show very little data.
In this article, we will concentrate and grouping and ungrouping of data in an excel spreadsheet.
Example #1 – Create Auto Outline or Group Automatically
Step 1: Add subtotals to each country manually.
Step 2: Place a cursor inside the data and click on the DATA tab > Group > Auto Outline.
Step 3: As soon as you click on Auto Outline it will group all the range which is included in the country-wise total.
Click on those buttons to hide all the sub items involved in each country.
Now we can see only the consolidated summary of each country.
Example #2 – Auto Outline with Above Totals
In the previous method, each countries total was added at the end of each country and the auto outline was worked perfectly without any kind of trouble.
However, if the total is before each country Auto Outline does not work in a normal way, we need to tell the excel that total is above the subheading. I have added the total of each country above each country.
Step 1: Go to DATA > Outline > Click on the Outline dialogue box launcher.
Step 2: After you click on that arrow you will see below dialogue box. Uncheck the box Summary rows below detail.
Step 3: Click on Create to complete the process. Now it will group. Now we will see the group button at the top, not at the bottom.
Collapse & Expand
We can collapse and expand at any point in time. If you notice on the top left-hand side corner (just below the name box) we have two numbers
If you click on One (1) it will show only a summary.
If you click on Two (2) it will expand and show breakup.
Example #3 – Group Manually in Excel
Above methods can quickly identify the excel formula cells and group automatically. If that method does not work we can group manually as well.
Step 1: Select the range of rows you want to group. For example, if you want to group the country CANADA then selects the full range.
Step 2: Go to DATA > Group. It will show the below dialogue box.
Since we are grouping Rows select Rows.
You can also type the excel shortcut key SHIFT + ALT + RIGHT ARROW (hold Shift & Alt key together and press Right Arrow). It will group instantly without any further prompts.
Step 3: Done. Grouping of rows is done.
It has grouped only the CANADA country. Repeat the same for other countries as well. You have select each country individually and group.
Example #4 – Group and Add Subtotal to the Data in Excel
In the previous examples, we have added subtotals manually. We can add subtotals automatically by following below steps.
Step 1: Remove all the manually added subtotals.
Step 2: Select the data and click on SUBTOTAL under DATA tab.
Step 3: You will see below dialogue box.
Step 4: Here we need to select on what basis we are adding the subtotals. I have selected Country as the base.
Under Use Function, I have selected the Sum. Since I want to take the totals I have selected SUM.
Under Add subtotal to I want to add Units Sold, Unit Price, Gross Sales, COGS, and Profit.
Step 5: Click on OK it will add the subtotals. It will group as well.
Things to Remember About Group in Excel
- When you are grouping manually it should not contain any hidden rows.
- Under SUBTOTAL we can add a variety of function like SUM, AVERAGE, MIN, MAX, and many other things.
- Clear Outline will remove all the grouping from the worksheet.
- SHIFT + ALT + RIGHT ARROW is the short cut key to group selected cells.
You can Download this Group and Subtotal Excel template here – Excel Group Template
This has been a guide to Group in Excel (Auto, Manual). Here we discuss how to group and ungroup data in excel along with examples and downloadable excel template. You may learn more about excel from the following articles –