• Skip to main content
  • Skip to header right navigation
  • Skip to site footer

My Online Training Hub

Learn Dashboards, Excel, Power BI, Power Query, Power Pivot

  • Courses
  • Pricing
    • Free Courses
    • Power BI Course
    • Excel Power Query Course
    • Power Pivot and DAX Course
    • Excel Dashboard Course
    • Excel PivotTable Course – Quick Start
    • Advanced Excel Formulas Course
    • Excel Expert Advanced Excel Training
    • Excel Tables Course
    • Excel, Word, Outlook
    • Financial Modelling Course
    • Excel PivotTable Course
    • Excel for Customer Service Professionals
    • Excel for Operations Management Course
    • Excel for Decision Making Under Uncertainty Course
    • Excel for Finance Course
    • Excel Analysis ToolPak Course
    • Multi-User Pricing
  • Resources
    • Free Downloads
    • Excel Functions Explained
    • Excel Formulas
    • Excel Add-ins
    • IF Function
      • Excel IF Statement Explained
      • Excel IF AND OR Functions
      • IF Formula Builder
    • Time & Dates in Excel
      • Excel Date & Time
      • Calculating Time in Excel
      • Excel Time Calculation Tricks
      • Excel Date and Time Formatting
    • Excel Keyboard Shortcuts
    • Excel Custom Number Format Guide
    • Pivot Tables Guide
    • VLOOKUP Guide
    • ALT Codes
    • Excel VBA & Macros
    • Excel User Forms
    • VBA String Functions
  • Members
    • Login
  • Blog
  • Excel Webinars
  • Excel Forum
    • Register as Forum Member
  • Login

Excel PivotTable Grouping

You are here: Home / Excel PivotTables / Excel PivotTable Grouping
pivot table grouping
March 26, 2013 by Mynda Treacy

Battling to consolidate monthly figures into quarters, or segment data into numeric bands?

Perhaps you're aiming for a bespoke grouping in your PivotTables.

PivotTable grouping lets you intuitively classify dates, times, and number intervals, while also allowing for tailored group creations to reveal the hidden narratives in your data.

 

Table of Contents

  • What is PivotTable Grouping
  • Watch the PivotTable Grouping Video
  • Download Example Excel File
  • Preparing Your Data for Grouping
  • Accessing the Grouping Feature in Excel
  • Group Dates and Time
  • Grouping Numbers into Intervals or Bands
  • Custom Groups
  • Grouping Cross-tabular Data
  • Limitations

What is PivotTable Grouping?

PivotTable grouping enables users to categorize data into specific groups, making it easier to analyze and derive insights.

Instead of sifting through individual data points, you can view summarized data based on your grouping preferences.

 

Watch the Video

Subscribe YouTube

 

Download Workbook

Download an Excel workbook with the examples in this post.

Enter your email address below to download the sample workbook.

By submitting your email address you agree that we can email you our Excel newsletter.
Please enter a valid email address.

Download the Excel Workbook. Note: This is a .xlsx file, please ensure your browser doesn't change the file extension on download.

 

Preparing Your Data for Grouping

Before diving into grouping, ensure your data is clean—remove blank cells, ensure consistent data types in each column, and double-check for valid dates. i.e. Dates must be in a date serial number format.

PivotTables also require your data to be formatted in a tabular format where there is a separate column for each field, like the example below:

Example of tabular data in Excel

Use Power Query to unpivot your data if required.

Accessing the Grouping Feature in Excel

To access the grouping feature: Right-click an item in the field you wish to group > Select 'Group' from the menu:

Accessing the grouping feature for a pivot table

Group Dates and Time

With PivotTable grouping we can quickly sum monthly data into quarterly and yearly summaries, and easily segment time-based data into specific time intervals.

For example, accountants often need to summarize monthly data into quarters or years, and Grouping by Days of the Week enables retail and service industries to analyze data based on specific days.

Grouping dates and times

Grouping Numbers into Intervals or Bands

We can easily create numeric intervals, for example, group sales or other numbers into defined ranges like 1-10, 11-20, etc.

And segment data into bands: for instance, classify customers into bands based on their purchase amounts. Or employees into age bands as shown here:

Grouping data into bands

 

Custom Groups

Want to group data that doesn't fit traditional categories? Create your custom groups to tailor your analysis to your needs.For example, you can group specific row/column labels together, which is especially useful for categorical data.

To create a custom group, select the items you want to group > right-click > Group:

Grouping data into custom groups

The new group has the default name: Group1.

Rename it by typing over the text in the cell (E9) and then give the field a new name via the PivotTable Analyse tab:

Rename group and field

This adds a new field to the PivotTable which I’ve renamed: ‘Creatures’ and you can see in the image below that it appears as a new field in the field list.

I’ve also renamed Group1, ‘Magical Beings’ by typing over ‘Group1’ in PivotTable cell E9.

New custom grouping shown in pivot table field list

Continue adding groups as required. And because this is now a new field, I can add a Slicer for it:

Add slicer for new custom Group

Custom Group Gotchas: any other PivotTables based on the same source data (that share the pivot cache) will also have these custom groups added, but they won’t pick up the group names you manually type into the cells of the PivotTable.

You will need to repeat the name labels for each PivotTable individually or copy the one you’ve changed and rebuild the others.

Grouping Cross-tabular Data

Accountants in particular love working with cross-tabular data, like the example below where the dates run across the columns and the items or categories listed down the rows.

Watch this video to see the problems you’ll encounter when you try to Pivot data in this format. Spoiler, it’s a train wreck.

To fix this, first we need to unpivot the data using Power Query, as shown in the video at the top of this page.

Unpivoting cross-tab data

We can then build a PivotTable that groups the data by quarters and Item, and sums the Amount column:

Build pivot table using grouping by quarters

When working with dates in PivotTables, Excel will automatically group them when they’re used in row or column labels.

To modify the default grouping, right-click on the date field in the PivotTable > Group:

Modify default pivot table groupings

In the Grouping dialog box, choose the groups you want:

Choose the groupings you want

Tip: if your data spans multiple years, include ‘Years’ in the grouping.

You’ll see these fields are added to the PivotTable field list for use in your reports:

Chosen groups are added to pivot table field list

PivotTable Grouping Limitations

PivotTable grouping in Excel offers powerful capabilities, but it does come with certain restrictions and considerations:

  1. Blank Cells: If there are any blank cells in the column you're trying to group, Excel will throw an error. You'll need to either fill or remove blank cells before grouping.
  2. Mixed Data Types: Grouping won't work if your column has mixed data types, such as a combination of text and numbers.
  3. Date Grouping: When grouping by dates, the data must be valid date serial numbers. If there are invalid dates or non-date entries like text, the grouping will fail.

    Dates must not include text

  1. Grouping Shared Field: If you group a field in one PivotTable, and if that field is also present in another PivotTable, the second table will also get grouped. This happens because both PivotTables share the same pivot cache.
  2. Manual Groups: If you're creating manual or custom groups, you can't use the usual calculated field or item capabilities in PivotTables and will see an error like this:

    Can't add calculated item to grouped filed

  3. If you need calculated fields and items in your PivotTable and you get this error, then add a field to your source data that enables you to group the data the way you want without having to use the PivotTable Grouping tool. e.g. if you want to group your dates by month, add a Month column to the source data.

  1. Grouping on External Data: Depending on the source of external data, you might encounter limitations or extra steps when trying to group data. For instance, when connecting to OLAP sources, the grouping has to be defined in the cube itself and not in the Excel PivotTable.

Next time you need to summarize data into groups, instead of doing it the hard way with formulas, use PivotTable grouping to make your life easier.

Get started with PivotTables with my Excel PivotTable Quick Start course.

Pivot Table Course

 

pivot table grouping
Mynda Treacy

Microsoft MVP logo

AUTHOR Mynda Treacy Co-Founder / Owner at My Online Training Hub

CIMA qualified Accountant with over 25 years experience in roles such as Global IT Financial Controller for investment banking firms Barclays Capital and NatWest Markets.

Mynda has been awarded Microsoft MVP status every year since 2014 for her expertise and contributions to educating people about Microsoft Excel.

Mynda teaches several courses here at MOTH including Excel Expert, Excel Dashboards, Power BI, Power Query and Power Pivot.

More Excel PivotTables Posts

PivotTable Formatting

12 PivotTable Formatting Tips

Create PivotTables that don’t look like PivotTables with these really easy PivotTable Formatting tips and tricks.
Images in Excel Pivot Tables

Images in Excel PivotTables

Include images in Excel PivotTables, combined with some slick formatting, and create dynamic and visually rich PivotTables like never before.

Auto Refresh PivotTables

Auto Refresh PivotTables isn’t on by default, and the process differs depending on if your PivotTables is loaded to the data model or not.

Show Items with no Data in PivotTables

Show Items with no Data in PivotTables allows you to maintain a constant structure to your PivotTable or Pivot Chart axis when filtering.

Force Excel Slicers to Single Select

There's no build in way to force Excel Slicers to single select but we can use these clever warnings to persuade your users.
excel pivottable p&L

Excel PivotTable Profit and Loss

Creating an Excel PivotTable Profit and Loss Statement means you can use Slicers and Conditional Formatting and have the P&L automatically update.

Excel PivotTable Field List Tips

Customize the Excel PivotTable Field List to suit your needs. Find how to turn the PivotTable Field List on and off and other handy tips.

Hide Blanks in Excel PivotTables

Hide blanks in Excel PivotTables caused by empty cells in your source data. I’m talking about PivotTable cells containing the (blank) placeholder.
Excel Slicer Formatting

Excel Slicer Formatting

Excel Slicer Formatting is essential because they’re big and chunky. In this tutorial I show you the tricks to make Excel Slicers small.
Excel PivotTable Quick Explore

Excel PivotTable Quick Explore

Drill down into data hierarchies using PivotTables and Pivot Charts with Excel PivotTable Quick Explore. New in Excel 2013 onward.


Category: Excel PivotTables
Previous Post:Excel PivotTable Add Percentage of Total Column [Video]Excel PivotTable Add Percentage of Total Column [Video]
Next Post:Excel PivotTable Month Comparison [Video]Excel PivotTable Month Comparison [Video]

Reader Interactions

Comments

  1. Maxine Brown

    May 27, 2020 at 4:55 am

    Hi Mynda,

    I want thank you for sharing the may ways of utilizing Microsoft Excel. I am particularly interested in Pivot tables. Exel recognizes Quarters beginning in January of a year. In my location, the Quarter begins in April. How do I use Excel to recognize Quarter 1 beginning in April?

    Reply
    • Mynda Treacy

      May 27, 2020 at 9:21 am

      Hi Maxine,

      You need to add a column(s) to your source data that classifies the dates into their fiscal periods. Then you can use that field(s) in your PivotTable and Slicers.

      I hope that points you in the right direction. If you get stuck, please post your question on our Excel forum.

      Mynda

      Reply
  2. Tracy

    May 23, 2019 at 7:27 pm

    Hi Mynda,

    Now I realise that grouping the dates is not what I’m after, I need to see my list of dates but have a subtotal by month. When I select sub-total I get a total for each date and not a total of all the spends in June and July.
    Is there a way around this?

    tnx

    Reply
    • Mynda Treacy

      May 24, 2019 at 8:20 am

      Hi Tracy,

      Please post your question on our Excel forum where you can upload a sample Excel file with your data and a mock up of your desired solution so we can see what you want and help you further.

      Mynda

      Reply
  3. Tracy

    May 23, 2019 at 7:14 pm

    HI Mynda,

    I have fixed it – I added a total row at the end of my data which created a blank cell in the dates column. Removed the row and now all happy days.

    tnx

    Reply
  4. Tracy

    May 23, 2019 at 6:57 pm

    Hi Mynda,

    My source data is definitely in date format – I get sum, average in the bar below. However, when I click on a date and select group, I get “cannot group that selection”. Any ideas?

    tnx

    Reply
  5. Nicci

    August 20, 2015 at 4:04 am

    Thanks for the above video Mynda! Bless you! 🙂

    Reply
    • Mynda Treacy

      August 20, 2015 at 7:52 am

      You’re welcome, Nicci. Glad we could help.

      Reply
  6. Suman Dutta

    April 3, 2013 at 12:47 pm

    Thank you for your vedio of pivot table presentation. your sound is clear but vedio charecter too small so kindly guide to me how to display screen in Big charecter.

    Thanks again for presentation. Its help for me.

    Kind regards

    Suman

    Reply
    • Mynda Treacy

      April 8, 2013 at 3:13 pm

      Hi Suman,

      You can watch the video in full screen. Simply start playing the video and then click on the ‘Full Screen’ icon in the bottom right hand corner of the video screen.

      Kind regards,

      Mynda.

      Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Current ye@r *

Leave this field empty

Sidebar

More results...

Popular Content

  • 10 Common Excel Mistakes to Avoid
  • Top Excel Functions for Data Analysts
  • Secrets to Building Excel Dashboards in Less Than 15 Minutes
  • Pro Excel Formula Writing Tips
  • Hidden Excel Double-Click Shortcuts
  • Top 10 Intermediate Excel Functions
  • 5 Pro Excel Dashboard Design Tips
  • 5 Excel SUM Function Tricks
  • 239 Excel Keyboard Shortcuts

100 Excel Tips and Tricks eBook

Download Free Tips & Tricks

239 Excel Keyboard Shortcuts

Download Free PDF

mynda treacy microsoft mvpHi, I'm Mynda Treacy and I run MOTH with my husband, Phil. Through our blog, webinars, YouTube channel and courses we hope we can help you learn Excel, Power Pivot and DAX, Power Query, Power BI, and Excel Dashboards.

Blog Categories

  • Excel
  • Excel Charts
  • Excel Dashboard
  • Excel Formulas
  • Excel Office Scripts
  • Excel PivotTables
  • Excel Shortcuts
  • Excel VBA
  • General Tips
  • Online Training
  • Outlook
  • Power Apps
  • Power Automate
  • Power BI
  • Power Pivot
  • Power Query
microsoft mvp logo
trustpilot excellent rating
Secured by Sucuri Badge
MyOnlineTrainingHub on YouTube Mynda Treacy on Linked In Mynda Treacy on Instagram Mynda Treacy on Twitter Mynda Treacy on Pinterest MyOnlineTrainingHub on Facebook

Sign up to our newsletter and join over 400,000
others who learn Excel and Power BI with us.

 

Company

  • About My Online Training Hub
  • Disclosure Statement
  • Frequently Asked Questions
  • Guarantee
  • Privacy Policy
  • Terms & Conditions
  • Testimonials
  • Become an Affiliate
  • Sponsor Our Newsletter

Support

  • Contact
  • Forum
  • Helpdesk – For Technical Issues

Copyright © 2023 · My Online Training Hub · All Rights Reserved. Microsoft and the Microsoft Office logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries. Product names, logos, brands, and other trademarks featured or referred to within this website are the property of their respective trademark holders.

Download A Free Copy of 100 Excel Tips & Tricks

excel tips and tricks ebook

We respect your privacy. We won’t spam you.

x