Pivot table loses year, quarter, month grouping if source date range is 1 year or less

jeff_cp

Board Regular
Joined
May 21, 2015
Messages
84
I'm hoping this is just a setting I'm overlooking. I have a spreadsheet where I'm pulling in data from a query. I have a start and end date parameter. If I extend the date range to span multiple years, I can group the pivot table on years, quarters and months. However, if I change my date range to a year or less, I lose the grouping altogether. I'd like to maintain that grouping if possible regardless of the date range.

For example, let's say I run the query for 3/27/20 thru 3/31/20. I'd like the pivot table to show a year grouping of 2020, a quarter grouping of 1 and a month grouping of March. That way, no matter what my date range, the pivot table will always be grouped by year, quarters and months.

Thanks in advance for any assistance.
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
I found a work around. In the table I'm using to compile the pivot table, I added 3 fields...one for month, one for quarter and one for year. I'm using those fields as my rows in the pivot table and since those fields are available for each record, I'm no longer losing my "auto" grouping.

For the month field, I'm using:
=TEXT(A10,"mmmm")

For the quarter field, I'm using:
=IF(ROUNDUP(MONTH(A10)/3,0)=1,ROUNDUP(MONTH(A10)/3,0)&"st Quarter",IF(ROUNDUP(MONTH(A10)/3,0)=2,ROUNDUP(MONTH(A10)/3,0)&"nd Quarter",IF(ROUNDUP(MONTH(A10)/3,0)=3,ROUNDUP(MONTH(A10)/3,0)&"rd Quarter",IF(ROUNDUP(MONTH(A10)/3,0)=4,ROUNDUP(MONTH(A10)/3,0)&"th Quarter",""))))

For the year field, I'm using:
=YEAR(A10)
 
Upvote 0

Forum statistics

Threads
1,215,564
Messages
6,125,579
Members
449,237
Latest member
Chase S

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