All You Need to Know About

Excel Pivot Table Grouping Tutorials

Did you know there are many creative ways in doing grouping in Excel Pivot Tables? Learn all about it here!

Here are the top things on how to group in Pivot Tables in Excel:

Group By Custom Dates With Excel Pivot Tables

In this Group By Month post, we grouped our Sales by each month.

However the cool thing with Excel is that we can take that a step further and customize our grouped date range!

In the example below I show you how to get the Sales Grouped by Custom Dates:

DOWNLOAD EXCEL WORKBOOK

 

STEP 1: Insert a new Pivot table by clicking on your data and going to Insert > Pivot Table > New Worksheet or Existing Worksheet

group-by-custom-date-01

 

STEP 2: In the ROWS section put in the Order Date field.

Notice that in Excel 2016 (the version that I am using) it will automatically Group the Order Date into Years & Quarters:

group-by-custom-date-02

 

STEP 3: Right click on any row in your Pivot Table and select Group so we can select our Group order that we want:

group-by-custom-date-03

 

STEP 4: We need to deselect Quarters, Years and make sure only Months are selected (which will be highlighted in blue). This will group our dates by the Months only.

We can now define a custom date range!

For example, we can only show the Sales numbers from January 2014 to September 2014.  To do this we need to set the following:

Starting at: 2014-01-01

Ending at: 2014-09-30

Click OK.

group-by-custom-date-04

 

STEP 5: In the VALUES area put in the Sales field.  This will show the total of the Sales for each Month:

group-by-custom-date-05

 

We can see that everything that does not fall in between January and September is Grouped into its own bucket.

group-by-custom-date-06

 

STEP 6: Now we have our sales numbers grouped by Month & Years, notice that we can improve the formatting.

Click the Sum of SALES and select Value Field Settings

group-by-custom-date-07

 

STEP 7: Select Number Format

group-by-custom-date-08

 

STEP 8: Select Currency. Click OK.

group-by-custom-date-09

You now have your total sales for each monthly period based on your custom dates! Very Easy!

group-by-custom-date-10

 

Group By Time With Excel Pivot Tables

Let’s put yourself in my place for a second.

It was a dark, rainy night in Dublin city and I was working overtime…again!

I downloaded a report with lots of transnational data.  Time of Sale in one column and Sales in another, among other columns.

I wanted to get the Sales numbers by the hour, so that I could understand which part of the day had the best sales and which is the slowest time of the day.

Grouping these would take a ton of effort!

Thankfully there is the Pivot Table way, which is quick and reduces the risks of making any errors….and it makes updating the report easily with any new additional data!

In the example below I show you how to get the Sales Grouped by Time:

DOWNLOAD EXCEL WORKBOOK

 

STEP 1: Insert a new Pivot table by clicking on your data and going to Insert > Pivot Table > New Worksheet or Existing Worksheet

group-by-time-01

 

STEP 2: In the ROWS section put in the Time of Sale field.

Notice Excel will automatically Group the Time of Sale field in Excel 2016 (a new feature):

group-by-time-02

 

STEP 3: Right click on any Row item in your Pivot Table and select Group

group-by-time-03

 

STEP 4: It was able to determine our time range (minimum time and maximum time).

Make sure only Hours is selected (blue highlight).

This will group our times by the Hours only.  Click OK.

group-by-time-04

 

STEP 5: In the VALUES area put in the Sales field. This will get the total of the Sales for each hourly range you have defined:

group-by-time-05

Now we have our sales numbers grouped by the hour, notice that we can improve the formatting:

group-by-time-05b

 

STEP 6: Click the Sum of SALES and select Value Field Settings

group-by-time-06

 

STEP 7: Select Number Format

group-by-time-07

 

STEP 8: Select Currency. Click OK.

group-by-time-08

You now have your total sales for each hourly period!

group-by-time-09

Extra Tip: You can Right Click on any Sales value in the Pivot Table and select Sort > Largest to Smallest.  This will show you the part of the day that has the most sales at the top!

 

Errors When Grouping By Dates With Excel Pivot Tables

In our Group By Date post, we grouped our sales numbers by weeks.

However there are times when we try to group by Dates and we get an error message!  That is frustrating!

Instead of checking the dates one by one to find out where the error occurred, I will show you a cool way to get to those problematic dates & fix them in one go!

We already have the pivot table ready for grouping by Dates:

In the example below I show you how to get the Errors when Grouping By Dates:

DOWNLOAD EXCEL WORKBOOK

 STEP 1: Right click on any row in your Pivot Table and select Group so we can select our Group type that we want:

However we notice that we have an error!

 

STEP 2: To check where our error occurred, go to the data table and highlight the column that contains our dates.

 

STEP 3: Go to Home > Find & Select > Go To Special:

 

Make sure the Constants, Text and Errors are selected.  This will select all our invalid dates (Errors) and text data (Text).

 

STEP 4: Excel has now selected the incorrect dates.  To make each incorrect cell easier to view go to Home > Fill Color

The invalid dates are now highlighted:

 

STEP 5: Manually replace the incorrect dates with the correct dates:

 

STEP 6: We need to Refresh our pivot table to load our new correct dates but first we need to “uncheck” the ORDER DATE field.

Right click on the Pivot Table and click Refresh:

“Check” the ORDER DATE Field:

 

STEP 7: Right click on the Pivot Table and click Group:

The Grouping Options are now displayed!  Your data is now clean!

 

Latest Tutorials

Want to get better at Excel?

Join Our Excel Community

Get our Free Weekly Excel lesson plans that cover the must know Excel features and tips to make you better at Excel!
[l]
[l]
[l]
[l]
[l]
[l]
[l]
[l]
[l]
[l]
[l]
[l]
[l]
[l]
[l]
[l]
[l]
[l]
[l]
[l]
[l]
[l]
[l]
[l]
[l]
[l]
[l]
[l]
[l]
[l]