Week numbers in pivot table not sorted correctly

bigmickm

New Member
Joined
Aug 14, 2008
Messages
7
Hi all,
I have a pivot table where I group by week number and year to show weekly totals of cycling ride data for each week of each year, with a chart to show comparison of the data. I have just noticed that for the past 3 weeks this year I have entered, the week number sort order is out of sequence, and this is reflected in the chart. Weeks 1-38 are in correct sort order, then it goes 44-46 then 39-43. The week number is taken from cells that use the "WEEKNUM" function, and this is showing the correct value for week number in the appropriate cell for each row of entered ride data.
How can I get the sort order to display correctly?
I have a screenshot with highlight showing the problem weeks in the table and chart, but can't work out how to attach it to this post (I tried the "Insert Image" button but it requires a URL to the pic - I have no website to post it to). I can provide the screenshot if you can advise me how to attach it).
PS. I also have other tables and charts that group by month, and these show correct sort order in the table but the chart sorts with December at the top and January at the bottom - is there a way to fix this? I have not been able to work out a way to do this.

Thanks in advance,
Mick McKean
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
Mick,

I suppose your weeks are in rows, when you right click on the row-label and then go to Field Settings - Advanced go can Sort these rows.

hope this helps

Steven
 
Upvote 0
Hi itlsbu,
I did read about the options you mentioned in a forum post before I posted my question, but when I right-click on the year number label (weeks are grouped by year), I have the "Field Settings" option but there is no "Advanced" tab/button to select. There are also no sort options for me to choose when I right-click on the label and select "Sort".
Forgot to mention this is in Excel 2007.
 
Upvote 0
Mick,

in xls 2007 you should be able to simply right click on the row label and use the sort?

regards, Steven
 
Upvote 0
Hi Steven,
I noticed that the raw data I was using as the basis for my year and week numbers were not formatted as numbers, so I have done this now. I recreated the pivot table from the same data source. This time the week numbers are in correct sort order (as they were when I originally created the PT). Now when I select the year or week number columns and right-click on them, the sort option is greyed out. Not sure if this is what you are referring to with the term "row labels", the data is grouped by year then by week number for each year.
Regards,
Mick
 
Upvote 0
Mick,

actually I mend the column labels, where the name of your column from the raw data is put (sic).
If this greyed out, mayby you should them as the first selection (first group) and see if you can then sort them

regards, Steven
 
Upvote 0

Forum statistics

Threads
1,214,978
Messages
6,122,547
Members
449,089
Latest member
davidcom

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