Manually Group Pivot Table Items

You can group pivot table data, as an easy way to see subtotals.

For example, in a pivot table with sales order data, you can group the Order Date field by years and months, to quickly compare the sales totals each month, for a selected year.

group dates by years and months
group dates by years and months

In this pivot table example, we have sales data for six stores. Three of the stores are new, and opened in the past 12 months. The other 3 stores are older. You’re doing a presentation to the Board of Directors, and you’d like to compare the sales in the new stores to sales in the older stores.

The new stores are in:

  • Los Angeles
  • Philadelphia
  • San Diego

The older stores are in:

  • Boston
  • New York
  • Pittsburgh

To group the Order Date field, you clicked on one of the dates in the pivot table, then clicked Group Field on the Ribbon’s Option tab.

Group Field on the Ribbon’s Option tab
Group Field on the Ribbon’s Option tab

However, when you click a label in the City field, the Group Field command isn’t available, so you aren’t sure how to create the Old and New groups for the City field.

Group the Selected Items

The Group Field command is only available for date and number fields in the Row Labels or Column Labels area of the pivot table.

Because the City names are entered as text, you can use a different method to group them.

  • Manually select the cities you want in the first group. To select nonadjacent cities, hold the Ctrl key, and then click the city names.
    • In this example, we’ll select the cities with the new stores, Los Angeles, Philadelphia and San Diego.
select text items to group them
select text items to group them
  • With the city names selected, on the Ribbon’s Options tab, click Group Selection
click the Group Selection command
click the Group Selection command

Name the Group

This creates a new item in the City field, named Group1, with the selected cities listed under that heading. For each of the remaining cities, a heading is created, with its city name.

Group1 created in pivot table
Group1 created in pivot table

To change the name of the new group, click on the Group1 heading cell, and then type a name for the group, such as New Stores.

change name of new group
change name of new group

Group the Remaining Items

Next, you can group the remaining stores and name that group.

  • Select the remaining stores, and click the Group Selection command to group them.
Select the remaining stores
Select the remaining stores
  • Name the second group as Old Stores.

Alternative Method of Grouping

Instead of grouping the stores in the pivot table, you could add a StoreType field to the source data, and then enter Old or New for each record.

Next, add the new StoreType field as the first field in the Row Labels area. The city names will appear under the correct StoreType heading.

Videos: Pivot Table Grouping

Learn more about pivot table grouping, and get a workbook with sample file that you can use for testing. Go to the How to Group Pivot Table Data page on my Contextures website.

First, this video shows how to group Text items in a pivot table.

Next, this short video shows the basics of pivot table grouping

______________

For more information on Pivot Tables, please see the Pivot Table Tutorials on the Contextures Website.

______________

Change the Pivot Table Field List Order

In the PivotTable Field List, the fields usually appear in the same order that they appear in the source data. If the pivot table source data has lots of fields, it might be hard to find a specific field in the list.

PivotOptionsSortFields02

To make it easier to find the fields in the long list, you would like the field list in alphabetical order.

Sort the List

You can change a pivot table option, to make the PivotTable Field List show the fields in alphabetical order.

  1. Right-click a cell in the pivot table, and in the pop-up menu, click PivotTable Options.
  2. In the PivotTable Options dialog box, click the Display tab.
  3. At the bottom of the Display tab, in the Field List section, select Sort A to Z, and then click OK

Pivot Table Field List Sort

Later, if you want to return the field list to its original order, select Sort in Data Source Order, instead of Sort A to Z.

_______________