What is Group in Excel?
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.
How to Group Data in Excel? (with Examples)
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 the same for some items and sometimes have some 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.
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.
- Step 4: 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
The 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 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 Subtotals to the Data
In the previous examples, we have added subtotals manually. We can add subtotals automatically by following the below steps.
- Step 1: Remove all the manually added subtotals.
- Step 2: Select the data and click on SUBTOTAL under the 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.
- Step 5: Under Use Function, I have selected the Sum. Since I want to take the totals I have selected SUM.
- Step 6: Under Add subtotal to I want to add Units Sold, Unit Price, Gross Sales, COGS, and Profit.
- Step 7: Click on OK it will add the subtotals. It will group as well.
Things to Remember
- When you are grouping manually it should not contain any hidden rows.
- Under SUBTOTAL we can add a variety of functions 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.
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 –