custom sort pivot

ajm

Well-known Member
Joined
Feb 5, 2003
Messages
2,005
Office Version
  1. 365
Platform
  1. Windows
is it possible to have a pivot table sorted by a custom list that is created on refresh of the pivot table? I am working with a rolling 12 months of results from this year and comparing it to the same month from 1 year ago. i want to have the latest month always in front. I have a custom list set up for the Australian financial year (July to June) which works this month. Next month, when i want to see August results first (top row in my pivot table and last position on my graph), July will still be listed first because of my custom list.

so, how do i make that list order change each month?
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
Hi, a workaround can be to have an extra column in your data on which you can do the sort order as in use this dimension in your pivot.
=IF(MONTH(varDate)<=MONTH(TODAY()),MONTH(TODAY())-MONTH(varDate)+1,MONTH(TODAY())+(MONTH(varDate)-MONTH(TODAY()))) & " - " & TEXT (varDate,"mmm")

Downside it uses many times today()... volatile.
 
Upvote 0
thanks GraH. could workaround the multiple todays with a reference to a particular cell holding the Today() perhaps. So, put Today() in (for example) G# then your formula would read
=IF(MONTH(varDate)<=MONTH($G$3),MONTH($G$3)-MONTH(varDate)+1,MONTH($G$3)+(MONTH(varDate)-MONTH($G$3))) & " - " & TEXT (varDate,"mmm")
 
Upvote 0
For sure that works. You might even consider populating that cell with a simple macro or even with CTRL+ : if that shortcut for today is generic. Since in your case the date must only be updated once a month.
 
Upvote 0

Forum statistics

Threads
1,214,914
Messages
6,122,211
Members
449,074
Latest member
cancansova

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