How to get the column label in a pivot ?

chesini

New Member
Joined
Feb 20, 2016
Messages
3
Hello,

I have a pivot table with column labels YearMonth values (eg 202101, 202102) and row labels CustomerNames. The values in the table are the sales amounts.

To get the maximum value of the monthly sales I add a calculated item MaxSales as an additional column with formula =MAX('202101','202102','202103'). That works perfect and for each CustomerName row I get the MaxSales figure.

Now I try to add another additional column that contains the YearMonth of the MaxSales, in other words that contains the column label value of the month in which the MaxSales is realized.

However, I do not succeed. Is it technically possible or is this a limit of pivot tables ? As Excel knows to find the MaxSales it should know where it found it and should be able to look up and return the associated YearMonth. Does anyone knows the trick to solve this ?

Many thanks.
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
56,788
Office Version
  1. 365
Platform
  1. Windows
Cross-posting (posting the same question in more than one forum) is not against our rules, but the method of doing so is covered by #13 of the Forum Rules.

Be sure to follow & read the link at the end of the rule too!

Cross posted at: How to get the column label in a pivot ?
If you have posted the question at more places, please provide links to those as well.

If you do cross-post in the future and also provide links, then there shouldn’t be a problem.
 

Watch MrExcel Video

Forum statistics

Threads
1,130,014
Messages
5,639,555
Members
417,098
Latest member
steverob

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
Top