Pivottable: grouping dates

MrsAlice

New Member
Joined
May 8, 2012
Messages
26
Hello,

How do I group dates in a pivottable where the source table looks like this (dates are dd-mm-yyyy)?

[TABLE="width: 593"]
<tbody>[TR]
[TD]Product[/TD]
[TD]Packaging[/TD]
[TD="align: right"]1-1-2015[/TD]
[TD="align: right"]1-2-2015[/TD]
[TD="align: right"]1-3-2015[/TD]
[TD="align: right"]1-4-2015[/TD]
[/TR]
[TR]
[TD]Product A[/TD]
[TD]Box[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]4[/TD]
[/TR]
[TR]
[TD]Product B[/TD]
[TD]Box[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]5[/TD]
[/TR]
[TR]
[TD]Product B[/TD]
[TD]Individual[/TD]
[TD="align: right"]5[/TD]
[TD="align: right"]6[/TD]
[TD="align: right"]7[/TD]
[TD="align: right"]8[/TD]
[/TR]
</tbody>[/TABLE]

Grouping just doesn't seem to be an option, unless I reformat the table to look like this:

[TABLE="width: 421"]
<tbody>[TR]
[TD]Product[/TD]
[TD]Packaging[/TD]
[TD]Date[/TD]
[TD]Number[/TD]
[/TR]
[TR]
[TD]Product A[/TD]
[TD]Box[/TD]
[TD="align: right"]1-1-2015[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD]Product A[/TD]
[TD]Box[/TD]
[TD="align: right"]1-2-2015[/TD]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD]Product A[/TD]
[TD]Box[/TD]
[TD="align: right"]1-3-2016[/TD]
[TD="align: right"]3[/TD]
[/TR]
[TR]
[TD]Product A[/TD]
[TD]Box[/TD]
[TD="align: right"]1-4-2015[/TD]
[TD="align: right"]4[/TD]
[/TR]
[TR]
[TD]Product B[/TD]
[TD]Box[/TD]
[TD="align: right"]1-1-2015[/TD]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD]Product B[/TD]
[TD]Box[/TD]
[TD="align: right"]1-2-2015[/TD]
[TD="align: right"]3[/TD]
[/TR]
[TR]
[TD]Product B[/TD]
[TD]Box[/TD]
[TD="align: right"]1-3-2015[/TD]
[TD="align: right"]4[/TD]
[/TR]
[TR]
[TD]Product B[/TD]
[TD]Box[/TD]
[TD="align: right"]1-4-2015[/TD]
[TD="align: right"]5[/TD]
[/TR]
[TR]
[TD]Product B[/TD]
[TD]Individual[/TD]
[TD="align: right"]1-1-2016[/TD]
[TD="align: right"]5[/TD]
[/TR]
[TR]
[TD]Product B[/TD]
[TD]Individual[/TD]
[TD="align: right"]1-2-2015[/TD]
[TD="align: right"]6[/TD]
[/TR]
[TR]
[TD]Product B[/TD]
[TD]Individual[/TD]
[TD="align: right"]1-3-2015[/TD]
[TD="align: right"]7[/TD]
[/TR]
[TR]
[TD]Product B[/TD]
[TD]Individual[/TD]
[TD="align: right"]1-4-2015[/TD]
[TD="align: right"]8[/TD]
[/TR]
</tbody>[/TABLE]

The actual source table contains many more attributes and dates, so if possible I'd like to avoid doing this (not even sure how). Are there any alternatives?

Just to be sure we're on the same page I've included an image with how I'd like the date filter option to look below:
date-grouping.png


Many thanks in advance for any advice :warning:.
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
You can't with your source table layout because they are separate fields. If you have access to power query / get and transform, then you could perhaps use that to unpivot the data to get it into your second layout.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,183
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top