Can i group data in excel

If you have a list of data you want to group and summarize, you can create an outline of up to eight levels. Each inner level, represented by a higher number in the outline symbols, displays detail data for the preceding outer level, represented by a lower number in the outline symbols. Use an outline to quickly display summary rows or columns, or to reveal the detail data for each group. You can create an outline of rows (as shown in the example below), an outline of columns, or an outline of both rows and columns.

Data with a three-level outline

1.  To display rows for a level, click the appropriate one two three outline symbols.

2.  Level 1 contains the total sales for all detail rows.

3.  Level 2 contains total sales for each month in each region.

4.  Level 3 contains detail rows — in this case, rows 17 through 20.

5.  To expand or collapse data in your outline, click the plus and minus outline symbols, or press ALT+SHIFT+= to expand and ALT+SHIFT+- to collapse.

  1. Make sure that each column of the data that you want to outline has a label in the first row (e.g., Region), contains similar facts in each column, and that the range you want to outline has no blank rows or columns.

  2. If you want, your grouped detail rows can have a corresponding summary row—a subtotal. To create these, do one of the following:

    • Insert summary rows by using the Subtotal command    

      Use the Subtotal command, which inserts the SUBTOTAL function immediately below or above each group of detail rows and automatically creates the outline for you. For more information about using the Subtotal function, see SUBTOTAL function.

    • Insert your own summary rows    

      Insert your own summary rows, with formulas, immediately below or above each group of detail rows. For example, under (or above) the rows of sales data for March and April, use the SUM function to subtotal the sales for those months. The table later in this topic shows you an example of this.

  3. By default, Excel looks for summary rows below the details they summarize, but it’s possible to create them above the detail rows. If you created the summary rows below the details, skip to the next step (step 4). If you created your summary rows above your detail rows, on the Data tab, in the Outline group, click the dialog box launcher.

    In the Outline group, click the dialog box launcher

    The Settings dialog box opens.

    The Settings dialog box for outlines

    Then in the Settings dialog box, clear the Summary rows below detail checkbox, and then click OK.

  4. Outline your data. Do one of the following:

    Outline the data automatically

    1. Select a cell in the range of cells you want to outline.

    2. On the Data tab, in the Outline group, click the arrow under Group, and then click Auto Outline.

      Click the arrow under Group, and then click Auto Outline

    Outline the data manually

    Important: When you manually group outline levels, it’s best to have all data displayed to avoid grouping the rows incorrectly.

    1. To outline the outer group (level 1), select all of the rows the outer group will contain (i.e., the detail rows and if you added them, their summary rows).

      A data selection ready to create an outer group

      1. The first row contains labels, and is not selected.

      2. Since this is the outer group, select all the rows with subtotals and details.

      3. Don’t select the grand total.

    2. On the Data tab, in the Outline group, click Group. Then in the Group dialog box, click Rows, and then click OK.

      Tip: If you select entire rows instead of just the cells, Excel automatically groups by row — the Group dialog box doesn’t even open.

      Click Rows and then click OK

      The outline symbols appear beside the group on the screen.

    3. Optionally, outline an inner, nested group — the detail rows for a given section of your data.

      Note: If you don’t need to create any inner groups, skip to step f, below.

      For each inner, nested group, select the detail rows adjacent to the row that contains the summary row.

      Data selected to group at level 2 in a hierarchy.

      1. You can create multiple groups at each inner level. Here, two sections are already grouped at level 2.

      2. This section is selected and ready to group.

      3. Don’t select the summary row for the data you are grouping.

    4. On the Data tab, in the Outline group, click Group.

      Click Group on the Data tab

      Then in the Group dialog box, click Rows, and then click OK. The outline symbols appear beside the group on the screen.

      Tip: If you select entire rows instead of just the cells, Excel automatically groups by row — the Group dialog box doesn’t even open.

    5. Continue selecting and grouping inner rows until you have created all of the levels that you want in the outline.

    6. If you want to ungroup rows, select the rows, and then on the Data tab, in the Outline group, click Ungroup.

      You can also ungroup sections of the outline without removing the entire level. Hold down SHIFT while you click the Plus box or Minus box for the group, and then on the Data tab, in the Outline group, click Ungroup.

      Important: If you ungroup an outline while the detail data is hidden, the detail rows may remain hidden. To display the data, drag across the visible row numbers adjacent to the hidden rows. Then on the Home tab, in the Cells group, click Format, point to Hide & Unhide, and then click Unhide Rows.

  1. Make sure that each row of the data that you want to outline has a label in the first column, contains similar facts in each row, and the range has no blank rows or columns.

  2. Insert your own summary columns with formulas immediately to the right or left of each group of detail columns. The table listed in step 4 below shows you an example.

    Note: To outline data by columns, you must have summary columns that contain formulas that reference cells in each of the detail columns for that group.

  3. If your summary column is to the left of the detail columns, on the Data tab, in the Outline group, click the dialog box launcher.

    In the Outline group, click the dialog box launcher

    The Settings dialog box opens.

    The Settings dialog box for outlines

    Then in the Settings dialog box, clear the Summary columns to right of detail check box, and click OK.

  4. To outline the data, do one of the following:

    Outline the data automatically

    1. Select a cell in the range.

    2. On the Data tab, in the Outline group, click the arrow below Group and click Auto Outline.

    Outline the data manually

    Important: When you manually group outline levels, it’s best to have all data displayed to avoid grouping columns incorrectly.

    1. To outline the outer group (level 1), select all of the subordinate summary columns, as well as their related detail data.

      Data arranged in columns to be grouped

      1. Column A contains labels.

      2. Select all the detail and subtotal columns. Note that if you don’t select entire columns, when you click Group (on the Data tab in the Outline group) the Group dialog box will open and ask you to choose Rows or Columns.

      3. Don’t select the grand total column.

    2. On the Data tab, in the Outline group, click Group.

      Click Group on the Data tab

      The outline symbol appears above the group.

    3. To outline an inner, nested group of detail columns (level 2 or higher), select the detail columns adjacent to the column that contains the summary column.

      Data grouped in columns

      1. You can create multiple groups at each inner level. Here, two sections are already grouped at level 2.

      2. These columns are selected and ready to group. Note that if you don’t select entire columns, when you click Group (on the Data tab in the Outline group) the Group dialog box will open and ask you to choose Rows or Columns.

      3. Don’t select the summary column for the data you are grouping.

    4. On the Data tab, in the Outline group, click Group.

      Click Group on the Data tab

      The outline symbols appear beside the group on the screen.

  5. Continue selecting and grouping inner columns until you have created all of the levels that you want in the outline.

  6. If you want to ungroup columns, select the columns, and then on the Data tab, in the Outline group, click Ungroup.

On the Data tab, click Ungroup

You can also ungroup sections of the outline without removing the entire level. Hold down SHIFT while you click the Plus box or Minus box for the group, and then on the Data tab, in the Outline group, click Ungroup.

If you ungroup an outline while the detail data is hidden, the detail columns may remain hidden. To display the data, drag across the visible column letters adjacent to the hidden columns. On the Home tab, in the Cells group, click Format, point to Hide & Unhide, and then click Unhide Columns

  1. If you don’t see the outline symbols one two three, plus, and minus, go to FileOptions Advanced, and then under the Display options for this worksheet section, select the Show outline symbols if an outline is applied check box, and then click OK.

  2. Do one or more of the following:

    • Show or hide the detail data for a group    

      To display the detail data within a group, click the plus button for the group, or press ALT+SHIFT+=.

    • To hide the detail data for a group, click the minus button for the group, or press ALT+SHIFT+-.

    • Expand or collapse the entire outline to a particular level    

      In the one two three outline symbols, click the number of the level that you want. Detail data at lower levels is then hidden.

      For example, if an outline has four levels, you can hide the fourth level while displaying the rest of the levels by clicking three.

    • Show or hide all of the outlined detail data    

      To show all detail data, click the lowest level in the one two three outline symbols. For example, if there are three levels, click three.

    • To hide all detail data, click one.

For outlined rows, Microsoft Excel uses styles such as RowLevel_1 and RowLevel_2 . For outlined columns, Excel uses styles such as ColLevel_1 and ColLevel_2. These styles use bold, italic, and other text formats to differentiate the summary rows or columns in your data. By changing the way each of these styles is defined, you can apply different text and cell formats to customize the appearance of your outline. You can apply a style to an outline either when you create the outline or after you create it.

Do one or more of the following:

Automatically apply a style to new summary rows or columns    

  1. On the Data tab, in the Outline group, click the dialog box launcher.

    In the Outline group, click the dialog box launcher

    The Settings dialog box opens.

    The Settings dialog box for outlines

  2. Select the Automatic styles check box.

Apply a style to an existing summary row or column    

  1. Select the cells to which you want to apply a style.

  2. On the Data tab, in the Outline group, click the dialog box launcher.

    In the Outline group, click the dialog box launcher

    The Settings dialog box opens.

    The Settings dialog box for outlines

  3. Select the Automatic styles check box, and then click Apply Styles.

    Settings dialog box with Automatic Styles selected

You can also use autoformats to format outlined data.

  1. If you don’t see the outline symbols one two three, plus, and minus, go to FileOptions Advanced, and then under the Display options for this worksheet section, select the Show outline symbols if an outline is applied check box.

  2. Use the outline symbols one two three, minus, and plus to hide the detail data that you don’t want copied.

    For more information, see the section, Show or hide outlined data.

  3. Select the range of summary rows.

  4. On the Home tab, in the Editing group, click Find & Select, and then click Go To.

    Click Find & Select, and then click Go To

  5. Click Go To Special.

  6. Click Visible cells only.

  7. Click OK, and then copy the data.

Note: No data is deleted when you hide or remove an outline.

Hide an outline

  • Go to FileOptions > Advanced, and then under the Display options for this worksheet section, uncheck the Show outline symbols if an outline is applied check box.

Remove an outline

  1. Click the worksheet.

  2. One the Data tab, in the Outline group, click Ungroup and click Clear Outline.

    Click Ungroup, and then click Clear Outline

    Important: If you remove an outline while the detail data is hidden, the detail rows or columns may remain hidden. To display the data, drag across the visible row numbers or column letters adjacent to the hidden rows and columns. On the Home tab, in the Cells group, click Format, point to Hide & Unhide, and then click Unhide Rows or Unhide Columns.

Imagine that you want to create a summary report of your data that only displays totals accompanied by a chart of those totals. In general, you can do the following:

  1. Create a summary report

    1. Outline your data.

      For more information, see the sections Create an outline of rows or Create an outline of columns.

    2. Hide the detail by clicking the outline symbols one two three, plus, and minus to show only the totals as shown in the following example of a row outline:

      Outlined list with only total rows showing

    3. For more information, see the section, Show or hide outlined data.

  2. Chart the summary report

    1. Select the summary data that you want to chart.

      For example, to chart only the Buchanan and Davolio totals, but not the grand totals, select cells A1 through C19 as shown in the above example.

    2. Click Insert > Charts > Recommended Charts, then click the All Charts tab and choose your chart type.

      Insert Chart dialog

      For example, if you chose the Clustered Column option, your chart would look like this:

      Chart made from subtotal data

      If you show or hide details in the outlined list of data, the chart is also updated to show or hide the data.

You can group (or outline) rows and columns in Excel for the web.

Note: Although you can add summary rows or columns to your data (by using functions such as SUM or SUBTOTAL), you cannot apply styles or set a position for summary rows and columns in Excel for the web.

Create an outline of rows or columns

Outline of rows in Excel Online

Outline of columns in Excel Online

Outline of rows in Excel Online

  1. The first column contains labels.

  2. The detail rows and summary rows are grouped in the outline.

  3. The grand total is not grouped in the outline.

Outline of columns in Excel Online

  1. The first row contains labels.

  2. The detail columns and summary columns are grouped in the outline.

  3. The grand total is not grouped in the outline.

  1. Make sure that each column (or row) of the data that you want to outline has a label in the first row (or column), contains similar facts in each column (or row), and that the range has no blank rows or columns.

  2. Select the data (including any summary rows or columns).

  3. On the Data tab, in the Outline group, click Group > Group Rows or Group Columns.

  4. Optionally, if you want to outline an inner, nested group — select the rows or columns within the outlined data range, and repeat step 3.

  5. Continue selecting and grouping inner rows or columns until you have created all of the levels that you want in the outline.

Ungroup rows or columns

  • To ungroup, select the rows or columns, and then on the Data tab, in the Outline group, click Ungroup and select Ungroup Rows or Ungroup Columns.

Show or hide outlined data

Do one or more of the following:

Show or hide the detail data for a group    

  • To display the detail data within a group, click the plus for the group, or press ALT+SHIFT+=.

  • To hide the detail data for a group, click the minus for the group, or press ALT+SHIFT+-.

Expand or collapse the entire outline to a particular level    

  • In the one two three outline symbols, click the number of the level that you want. Detail data at lower levels is then hidden.

  • For example, if an outline has four levels, you can hide the fourth level while displaying the rest of the levels by clicking three.

Show or hide all of the outlined detail data    

  • To show all detail data, click the lowest level in the one two three outline symbols. For example, if there are three levels, click three.

  • To hide all detail data, click one.

Need more help?

You can always ask an expert in the Excel Tech Community or get support in the Answers community.

See Also

Group or ungroup data in a PivotTable

What Is Group In Excel?

The Group is an Excel tool that groups two or more rows or columns. With this function, the user has the option to minimize and maximize the grouped data. The rows or columns of the group collapse on minimizing and expand on maximizing. The group option is available under the Outline section of the Data tab.

Group in Excel

Table of contents
  • What is Group in Excel?
    • How to Group Data in Excel?
      • Auto Outline With Succeeding Subtotals
      • Auto Outline With Preceding Subtotals
      • The Collapse and Expansion of Grouped Data
      • Manual Grouping
      • Automatic Subtotals
    • Frequently Asked Questions
    • Recommended Articles
  • The Group in excel is used to group two or more rows or columns.
  • We can collapse or expand the grouped data by minimizing and maximizing, respectively.
  • The Excel shortcut keys to group data are Shift+Alt+Right Arrow. Similarly, the shortcut keys to ungroup the grouped data are Shift+Alt+Left Arrow.
  • The “clear outline” option removes grouping from the worksheet.
  • When we are using the “auto outline” option while grouping, the subtotals can either precede or succeed the grouped data.
  • Alternatively, we can also use the shortcut keys Shift+Alt+Left Arrow.

How to Group Data in Excel?

Let us consider a few examples.

Example #1 – Auto Outline With Succeeding Subtotals

The Excel sheet consisting of the country name, product, units sold, price,  gross sales, COGS, and profit is shown in the succeeding image. We can either club the countries into one or group the products into categories to make the data precise.

Let us go with the former approach and club the countries.

Group Example 1

The steps to create an auto outline with succeeding subtotals are listed as follows:

  1. Enter the data as shown in the following image.

    Group Example 1

  2. To each country, add subtotals manually

  3. Place the cursor inside the table. Click on Auto outline in Group under the Data tab.

    Group Example 1-2

  4. Clicking on Auto Outline will group the range included in the country-wise total.

    Group Example 1-3

  5. Clicking the plus sign (+) hides the sub-items of each country. The consolidated summary of every country can be seen as highlighted in the below image.

    Group Example 1-4

Example #2 – Auto Outline With Preceding Subtotals

In the previous method, we added the totals at the end of every country. Let us add the totals before the data of a particular country.

Group Example 2

The steps to group data with preceding totals are:

  • Step 1: Click on the Dialog Box Launcher under the Outline section of the Data tab.

Group Example 2-1

  • Step 2: The Settings dialog box appears.

Uncheck the box Summary rows below detail and click on Create to complete the process.

Group Example 2-2

  • Step 3: The group buttons appear at the top.

Group Example 2-3

Example #3 – The Collapse And Expansion Of Grouped Data

At any point in time, we can collapse or expand the group. In the top left-hand corner, there are two numbers following the name box. The numbers 1 and 2 appear within the boxes.

Clicking on 1 reveals the group summary, as shown in the following image.

Group Example 2-4

Clicking on 2 expands the table and reveals the breakup of the group, as shown below.

Group Example 2-5

Example #4 – Manual Grouping

The previous examples utilize the basic Excel formulas and groups automatically. An alternative method is to group manually.

The steps for manual grouping are as follows:

  • Step 1: Select the range (row-wise) that we have to group. To group Canada, select the range till row 14.

Group Example 3

  • Step 2: Select Group under the Data tab.

Group Example 3-1

  • Step 3: A dialog box, titled Group appears.

Since we are grouping the data row-wise, select “rows” option.

Alternatively, the Excel shortcut Shift+Alt+Right Arrow groups selected cells of the data.

Group Example 3-2

  • Step 4: Now, we have grouped the rows of Canada.

Example 3-3

Remember, we have to repeat the process of manually grouping for the other countries as well. Please note that we should select the data of every country before grouping.

Note: The data should not contain any hidden rows during manual grouping.

Example #5 – Automatic Subtotals

In the previous examples, we added the subtotals manually. Alternatively, we can also add subtotals automatically.

The steps to add subtotals automatically are:

  • Step 1: First, we should remove all the added subtotals manually.

Example 4

  • Step 2: Click on Subtotal under the Data tab.

Example 4-1

  • Step 3: The Subtotal dialog box appears.

Example 4-2

  • Step 4: Select the basis on which subtotals are to be added.
  • Select Country as the base, under At each change in: option.

group excel data Example 4-3

  • Step 5: Since totals are required, select Sum under Use function: option.

Note: The user can select different functions like sum, average, min, max, etc., in the “subtotal” dialog box.

Example 4-4

  • Step 6: For totaling the columns, select them under Add subtotal to:. Check the boxes for Units Sold, unit price, Gross Sales, COGS, and Profit.

Click OK.

group excel data Example 4-5

  • Step 7: The subtotals and the groups appear, as shown below.

Example 4-6

Important Things To Note

  • Group in excel is used to group rows and columns.
  • It is used to create structured financial models.
  • Also, it helps to read complex data.

Frequently Asked Questions

1. What is group in Excel?

The Group in Excel is a tool that helps club similar data. It provides an organized, compact, and readable view to the reader. For grouping, the worksheet must contain headings and subtotals for every column and row respectively. Moreover, there should not be any blank cells in the data to be grouped.

The groups in Excel are used to create structured financial models. Since groups provide minimize and maximize options, they are used to hide unnecessary calculations.

2. Why is data grouped and ungrouped in Excel?

The data is grouped and ungrouped for the following reasons:

• Grouping helps read through the detailed and complex data. Ungrouping removes the grouping of rows and columns, thereby helping the user go back to the initial data view.
• With grouping, it is possible to look at the required data sections of the worksheet. Ungrouping helps to look at the entire worksheet data in one go.

Note: The grouping shortcut is Shift+Alt+Right Arrow, and the ungrouping shortcut is Shift+Alt+Left Arrow.

3. How does ungrouping work in Excel?

The ungrouping of data works as follows:

• To ungroup the entire data, clear the outline.
Click Clear outline under the Ungroup arrow (Outline section of the Data tab).

• To ungroup particular data, select the rows to be ungrouped. In the ungroup box, select Rows option and click OK.
Alternatively, we can also use the shortcut keys Shift+Alt+Left Arrow.

Note: Ungrouping does not delete any data. In case the outline is removed, it cannot be undone with Ctrl+Z.

Download Template

This article must be helpful to understand the Group in Excel, with its formula and examples. You can download the template here to use it instantly.

You can download this Group in Excel template here – Group in Excel template

Recommended Articles

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 –

  • Group Rows in Excel
  • ExcelGroup Data
  • Group Excel Worksheets
  • Excel Column Grouping


Download Article

Layer your data to stay organized


Download Article

  • Preparing Your Data
  • |

  • Outlining Automatically
  • |

  • Outlining Manually
  • |

  • Minimizing & Clearing
  • |

  • Q&A
  • |

  • Tips
  • |

  • Warnings

Outlining (grouping) data in Excel is a great way to organize and summarize data. This feature nests your information into up to eight levels. Inner levels have the detailed data for the surrounding outer level. As long as your data has column headings and no blank rows, you can automatically group and outline automatically with Excel. This wikiHow guide teaches you how to group and outline Excel data so you can work with large data sets more efficiently.
This works on Windows and Mac!

Things You Should Know

  • Prepare your data by making column or row headers and getting rid of blank rows and columns.
  • Outline rows or columns automatically by selecting a cell in the data and going to Data > Group > Auto Outline.
  • For the manual method, click the Group button and choose “Rows” or “Columns.”
  1. Image titled Group and Outline Excel Data Step 1

    1

    Organize the data you want to outline. Each column should have a column header in the first row. Make sure the range you’re going to outline doesn’t contain blank rows or columns.[1]

    • For a general spreadsheet guide, check out how to make a spreadsheet in Excel and format it.
    • If you’re looking for Excel database info, read our guide on creating a database from an Excel spreadsheet.
    • Are you using the free version of Excel and considering upgrading to Microsoft 365? See our coupon site for Staples discounts.
  2. Image titled Group and Outline Excel Data Step 2

    2

    Optionally, create a summary row. This is also called a subtotal. You have two options for this:

    • Select a cell in the data range. Go to the Data tab and click Subtotal in the Outline group.
    • Insert summary rows with your own formulas. For example, you could use the SUM function to subtotal information. These can go above or below the data.
    • If you place your summary rows above the data, open the dialog box in the Outline group of the Data tab (it’s the right angle with an arrow). Uncheck “Summary rows below detail.”
  3. Advertisement

  1. Image titled Group and Outline Excel Data Step 3

    1

    Select a cell that’s in the range you’re going to outline. This can be any cell in the data.

    • Your data must have column headers and no blank lines for this feature to work.
  2. Image titled Group and Outline Excel Data Step 4

    2

    Click the Data tab. It’s on the left side of the green ribbon that’s at the top of the Excel window. Doing so will open a toolbar below the ribbon.

  3. Image titled Group and Outline Excel Data Step 5

    3

    Click the down arrow under the Group button. You’ll find this option on the far-right side of the Data tab. A drop-down menu will appear.

  4. Image titled Group and Outline Excel Data Step 6

    4

    Click Auto Outline. It’s in the Group drop-down menu.

    • If you receive a pop-up box that says «Cannot create an outline», your data doesn’t have an outline-compatible formula in it. You may also have some blank cells in your data or missing column headers. You’ll need to manually outline the data.
  5. Advertisement

  1. Image titled Group and Outline Excel Data Step 7

    1

    Select your data. Click and drag your cursor from the top-left cell of the data you want to group to the bottom-right cell of the data.

  2. Image titled Group and Outline Excel Data Step 8

    2

    Click Data if this tab isn’t open. It’s in the left side of the green ribbon at the top of Excel.

  3. Image titled Group and Outline Excel Data Step 9

    3

    Click Group. It’s on the right side of the Data toolbar.

  4. Image titled Group and Outline Excel Data Step 10

    4

    Select a group option. Click Rows to minimize your data vertically, or click Columns to minimize horizontally.

  5. Image titled Group and Outline Excel Data Step 11

    5

    Click OK. It’s at the bottom of the pop-up window. Your grouped data is all set!

  6. Advertisement

  1. Image titled Group and Outline Excel Data Step 12

    1

    Minimize your data. Click the [-] button at the top or on the left side of the Excel spreadsheet to hide the grouped data. In most cases, doing this will only display the final line of the data.

  2. Image titled Group and Outline Excel Data Step 13

    2

    Clear your outline if needed. Click Ungroup to the right of the Group option, then click Clear Outline… in the drop-down menu. This will ungroup and unhide any data that was minimized or grouped previously.

  3. Advertisement

Add New Question

  • Question

    How do I reverse the grouping so that the total is at the top line and the collapsed lines fall below?

    Community Answer

    Click the «Data» tab, then come to the «Outline» section, then click the small arrow on the right bottom corner to «Show the Outline Dialog Box». From the settings, unclick «Summary Rows Below Detail.»

  • Question

    My data is grouped, but I cannot see the outline symbols along the left side of my spreadsheet. What can I do?

    Community Answer

    While the document is open, go to «File,» «Options,» «Advanced,» «Display options for this worksheet.» Make sure «Show outline symbols if an outline is applied» is selected. This is necessary for every sheet where there are outlines/groupings applied.

  • Question

    How do I group Rows 23 through 31 and then group Rows 32 through 36? When I do it, Excel groups Rows 23 thru 36.

    Community Answer

    You need an empty row between your two groups. Otherwise Excel will automatically merge them.

See more answers

Ask a Question

200 characters left

Include your email address to get a message when this question is answered.

Submit

Advertisement

  • You cannot use this function if the sheet is shared.

Thanks for submitting a tip for review!

Advertisement

  • Don’t use grouping/outlining if you plan to protect the worksheet. If you do, other users won’t be able to expand and collapse the rows.

Advertisement

About This Article

Article SummaryX

1. Open the Excel document.
2. Click Data
3. Click Group
4. Click Auto Outline
5. Click [-] to minimize data.

Did this summary help you?

Thanks to all authors for creating a page that has been read 1,502,469 times.

Is this article up to date?

Get a handle on your data

Grouping rows and columns in Excel lets you collapse and expand sections of a worksheet. This can make large and complex datasets much easier to understand. Views become compact and organized. This article shows you step-by-step how to group and view your data.

Instructions in this article apply to Excel 2019, 2016, 2013, 2010, 2007; Excel for Microsoft 365, Excel Online and Excel for Mac.

Grouping in Excel

You can create groups by either manually selecting the rows and columns to include, or you can get Excel to automatically detect groups of data. Groups can also be nested inside other groups to create a multi-level hierarchy. Once your data is grouped, you can individually expand and collapse groups, or you can expand and collapse all groups at a given level in the hierarchy.

Groups provide a really useful way to navigate and view large and complex spreadsheets. They make it much easier to focus on the data that’s important. If you need to make sense of complex data you should definitely be using Groups and could also benefit from Power Pivot For Excel.

How to Use Excel to Group Rows Manually

To make Excel group rows, the simplest method is to first select the rows you want to include, then make them into a group.

  1. For the group of rows you want to group, select the first row number and drag down to the last row number to select all the rows in the group.

  2. Select the Data tab > Group > Group Rows, or simply select Group, depending on which version of Excel you’re using.

  3. A thin line will appear to the left of the row numbers, indicating the extent of the grouped rows.

    Select the minus (-) to collapse the group. Small boxes containing the numbers one and two also appear at the top of this region, indicating the worksheet now has two levels in its hierarchy: the groups and the individual rows within the groups.

  4. The rows have been grouped and can now be collapsed and expanded as required. This makes it much easier to focus on just the relevant data.

How to Manually Group Columns in Excel

To make Excel group columns, the steps are almost the same as doing so for rows.

  1. For the group of columns you want to group, select the first column letter and drag right to the last column letter, thereby selecting all the columns in the group.

  2. Select the Data tab > Group > Group Columns, or select Group, depending on which version of Excel you’re using.

  3. A thin line will appear above the column letters. This line indicates the extent of the grouped columns.

    Select the minus (-) to collapse the group. Small boxes containing the numbers one and two also appear at the top of this region, indicating the worksheet now has two levels in its hierarchy for columns, as well as for rows.

  4. The rows have been grouped and can now be collapsed and expanded as required.

How to Make Excel Group Columns and Rows Automatically

While you could repeat the above steps to create each group in your document, Excel can automatically detect groups of data and do it for you. Excel creates groups where formulas reference a continuous range of cells. If your worksheet doesn’t contain any formulas, Excel won’t be able to automatically create groups.

Select the Data tab > Group > Auto Outline and Excel will create the groups for you. In this example, Excel correctly identified each of the groups of rows. Because there’s no annual total for each spending category, it has not automatically grouped the columns.

This option isn’t available in Excel Online, if you’re using Excel Online, you’ll need to create groups manually. 

How to Create a Multi-Level Group Hierarchy in Excel

In the previous example, categories of income and expense were grouped together. It would make sense to also group all of the data for each year. You can do this manually by applying the same steps as you used to create the first level of groups.

  1. Select all of the rows to be included.

  2. Select the Data tab > Group > Group Rows, or select Group, depending on which version of Excel you are using.

  3. Another thin line will appear to the left of the lines representing the existing groups and indicating the extent of the new group of rows. The new group encompasses two of the existing groups and there are now three small numbered boxes at the top of this region, signifying the worksheet now has three levels in its hierarchy.

  4. The spreadsheet now contains two levels of groups, with individual rows within the groups.

How to Automatically Create Multi-Level Hierarchy

Excel uses formulas to detect multi-level groups, just as it uses them to detect individual groups. If a formula references more than one of the other formulas which define groups, this indicates these groups are part of a parent group.

Keeping with the cash flow example, if we add a Gross Profit row to each year, which is simply the income minus the expenses, then this allows Excel to detect that each year is a group and the income and expenses are sub-groups within these. Select the Data tab > Group > Auto Outline to automatically create these multi-level groups.

How to Expand and Collapse Groups

The purpose of creating these groups of rows and/or columns is that it allows regions of the spreadsheet to be hidden, providing a clear overview of the entire spreadsheet.

  1. To collapse all of the rows, select the number 1 box at the top of the region to the left of the row numbers.

  2. Select the number two box to expand the first level of groups and make the second level of groups visible. The individual rows within the second level groups remain hidden.

  3. Select the number three box to expand the second level of groups so the individual rows within these groups also become visible.

    It’s also possible to expand and collapse individual groups. To do so, select the Plus (+) or Minus (-) that appears to mark a group that’s either collapsed or expanded. In this way, groups at different levels in the hierarchy can be viewed as required.

Thanks for letting us know!

Get the Latest Tech News Delivered Every Day

Subscribe

The best way to keep spreadsheets organized

Guide on How to Group in Excel

Grouping rows and columns in Excel[1] is critical for building and maintaining a well-organized and well-structured financial model. Using the Excel group function is the best practice when it comes to staying organized, as you should never hide cells in Excel. This guide will show you how to group in Excel with step-by-step instructions, examples, and screenshots.

Example of How to Group in Excel

Keyboard Shortcuts Sheet

Looking to be an Excel wizard? Increase your productivity with CFI’s comprehensive keyboard shortcuts guide.

Excel Group Function

The Excel group function is one of the best secrets a world-class financial analyst uses to make their work extremely organized and easy for other users of the spreadsheet to understand.

Reasons to use the Excel Group Function:

  • To easily expand and contract sections of a worksheet
  • To minimize schedules or side calculations that other users might not need
  • To keep information organized
  • As a substitute for creating new sheets (tabs)
  • As a superior alternative to hiding cells

The function is found in the Data section of the Ribbon, then Group.

Example of How to Group in Excel

Let’s look at a simple exercise to see how it works.  Suppose we have a schedule in a worksheet that is becoming quite long, and we want to reduce the amount of detail that’s shown.  The screenshots below will show you how to properly implement grouping in Excel.

Here are the steps to follow to group rows:

  1. Select the rows you wish to add grouping to (entire rows, not just individual cells)
  2. Go to the Data Ribbon
  3. Select Group
  4. Select Group again

Steps to use the Excel Group Function

You can repeat the steps above as many times as you like, and you can also apply it to columns as well.

Once you’re finished, you can press the “-” buttons in the margin to collapse the rows or columns.

If you want to expand them again, press the “+” buttons in the margin, as shown in the screenshot below.

There is also a “1” button in the top left corner to collapse all groups, and a “2” button to expand all groups.

Groups are the best alternative to hide cells in Excel

Why You Should Never Hide Cells in Excel

Though many people do it, you should never hide cells in Excel (or spreadsheets either, for that matter). The reason is that Excel does not make it clear to the user of the spreadsheet that cells have been hidden, and thus they may go unnoticed.

The only way to see that cells are hidden is to notice that the row number or column number suddenly jumps (e.g., from row 25 to row 167).

Since other users of the spreadsheet may not notice this (and you may forget yourself) you should never hide cells in Excel.

Download Excel Group Template

You can download the Template for free if you wish to use it as an example or starting point for how to group in Excel and apply it to your own work and financial analysis.

Additional Resources

Thank you for reading CFI’s guide to Group in Excel. To continue learning and advancing your career, these additional CFI resources will be helpful:

  • List of 300+ Excel Functions
  • Keyboard Shortcuts
  • What is Financial Modeling?
  • Financial Modeling Courses
  • See all Excel resources

Понравилась статья? Поделить с друзьями:
  • Can i get word on my ipad 2
  • Can i get microsoft word
  • Can i end a sentence with the word that
  • Can i edit pictures in word
  • Can i edit a word doc in google docs