12 Manual Auto Grouping of Excel Pivot Tables
12 Manual Auto Grouping of Excel Pivot Tables
Ability to combine items in groups is one of the most useful features of a pivot table. You
can group items that are placed in the ROWS or COLUMNS section in
the PivotTable Fields task pane. You can use two ways to group items: manually and
automatically.
This article is part of my series: Excel Pivot Table Tutorials for Dummies [Step by Step]
1
Excel Pivot Table Auto Grouping by Date, Time, Month, and Range!
You can create any number of groups and even you can create groups of groups.
Excel provides a good number of options for displaying your pivot table. When you
create groups of items in a pivot table, you may want to use these styling options. You
will find these commands on the PivotTable Tools ➪ Design tab of the Ribbon. You
can try several designs and choose one which best suits your pivot table in visualization
perspective. A suitable style can greatly enhance readability.
The following figure shows some pivot tables manipulated using various options for
displaying subtotals, grand totals, and styles.
2
Excel Pivot Table Auto Grouping by Date, Time, Month, and Range!
Automatic Grouping in a Pivot table, Explained with Example
When a data source field contains numbers, dates, or times, Excel can create groups
automatically.
We shall demonstrate automatic groupings using two examples.
The following figure shows a portion of a simple table. The table has two fields: Date and
Sales. This table has total 730 rows and these rows cover sales data between 1st January
2012 and 31st December 2013. Our goal is to summarize the information by month
using a pivot table.
Sales day by date. This table has 730 rows covering data between 1st January 2012 and
31rd 2013
The following figure shows part of a pivot table created from the above data. We have
placed the Date field is in the Rows area, and the Sales field is in the Values area. This
pivot table looks exactly like the data source as the dates are unique.
3
Excel Pivot Table Auto Grouping by Date, Time, Month, and Range!
We want to group the items by month and year. To group the items by month and year,
select any date in the pivot table and choose PivotTable Tools ➪ Analyze ➪ Group
➪ Group Field (or right-click any date and choose Group from the shortcut menu).
The Grouping dialog box will appear shown in the following figure. Excel supplies
values automatically for the Starting At and Ending At fields. Starting
At and Ending At fields cover the data range and you can change if you want to
shorten your data range.
4
Excel Pivot Table Auto Grouping by Date, Time, Month, and Range!
Grouping dialog box. You can enter Starting at and Ending at data in this dialog box.
Select Months and Years from the By list box. Click OK. The Date items in the pivot
table are grouped by years and by months, as shown in the following figure.
5
Excel Pivot Table Auto Grouping by Date, Time, Month, and Range!
Note:
You can select only Months in the By list box in the Grouping dialog box, months in
different year will be combined together. For example, the March item would display the
sum of sales for year 2012 and 2013.
6
Excel Pivot Table Auto Grouping by Date, Time, Month, and Range!
The following figure shows one more pivot table grouped by quarter and by year.
We shall use this table to show you how to group items by hours.
7
Excel Pivot Table Auto Grouping by Date, Time, Month, and Range!
We are going to create a pivot table that will use this table to group items by hours. Here
are the steps that I have used to create the pivot table:
• We have made three instances of the Reading field in the Values area in
the PivotTable Fields task pane. Three instances display respectively Average,
Minimum, and Maximum summary methods. If you don't know how to change
the summary method for a column, use this method: right-click any cell in the
column, a shortcut menu will appear, choose the Summarize Values By option
and then select your appropriate option from Sum, Count, Average, Max, Min,
Product and other choices.
• I have placed the Time field is in the Rows area, and I used
the Grouping dialog box to group the items by Hours.
• I have deselected the Field Headers from the pivot table using this command,
changed the headings of columns and used a style to make it more readable.
8
Excel Pivot Table Auto Grouping by Date, Time, Month, and Range!
If your computer uses 24 h time format you will find this type of pivot table:
Happy Excelling :)
Time-based-grouping.xlsx