Group Months In Pivot Table

mrhartley

Well-known Member
Joined
Mar 8, 2005
Messages
564
Hello, I have a pivot table as follows:
Book2
BCDE
9Year2005
10Origin CountryUnited Kingdom
11Freight ModeAIR
12
13Sum of Shipment Count
14MonthTotal
151333
162376
173409
184454
195414
206402
217357
228313
239410
Sheet1

My source data has the months numbered as you can see in the PT
Of course month 1 = Jan, month 2 = Feb and so on.

I am trying to avoid changing my source data, I will if I have to but I would prefer not to.

Anyone know of any funtion the PT can handle that might interpret the numbers into text months?
So to replace 1, 2, 3 with Jan, Feb, Mar and so on.

Thanks everyone in advance.
Regards
Mark
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Mark

How is the month/date formatted in the source data?
 
Upvote 0
I don't [know of a way to get the PT to do that]. Excel won't let me stick a calculated field in there as a row item. Rather than monkeying with the actual data, personally I'd just toss in a column with =text(date(yearcell,monthcell,1),"mmm")) and use that as the row source...
 
Upvote 0
Thanks for the replies. Here is a tiny snippet of my source data, many rows and columns but it will show that the date is not formatted as such, it already is as a month number.
Customer Standard Reports.xls
ABCDEFG
1Shipment URNYearMonthOrigin Country CodeOrigin City CodeDestination Country CodeDestination City Code
2750391498920051GBLONAEDXB
3750391479220054GBLONBHBAH
4750392347820051GBLONAEDXB
5750392462520058GBLONUSLAS
6750392455320059GBLONITNAP
7750392406320059GBLONSGSIN
8750392578920053GBLONANCUR
9750392353520052GBLONSGSIN
10750392583120051GBLONDEDUS
11750392167120052GBLONBNBWN
127503925432200510GBLONITFLR
Report Data


Like I say, I can go with Greg's idea, I really want to try and avoid another column, everything in my worksheet is heavily macro driven and so whatever I place in the source data by way of another forumla will need to be another macro etc.

I was just hoping for a 'clean' pivot table way or something that I was unaware of. :)

Thanks Greg, Norie :cool:
Regards
Mark
 
Upvote 0
Mark

Is that how you receive the data?

By the way Greg's idea could easily be done with a macro.
 
Upvote 0
yup, thats exactly how I get my data from another system.

I could in theory replace the column with a dates but that in practise will more likely be more difficult than implementing Greg's idea as that month column is already heavily used in pivot table and pivot charts.

I'll go with the extra formula and macro.

thanks for the input guys :biggrin:
Mark
 
Upvote 0
Yeah, well (cough, cough) about that suggestion I made... :rolleyes: I would not use the formula =text(date(yearcell,monthcell,1),"mmm")) but rather =date(yearcell,monthcell,1) and then format the pivot table field as "mmm". Feed it in with the text() formula and you can't sort worth a lick as it will sort the months alphabetically. Feed it in as a date and it sorts properly. Sorry about the earlier suggestion, I knew better than that!
 
Upvote 0

Forum statistics

Threads
1,206,834
Messages
6,075,134
Members
446,123
Latest member
junkyardforme

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