Forum Discussion
Sort months in chronological order
- 9 years ago
Hi ArtFi. Can you combine your desired month number with a year prefix to give it a list of one-to-one values? For example, if you want 2015 to be ordered Jan then Feb etc., they would be numbered 201501, 201502. If you wanted 2016 to be ordered Mar, Jan, Feb, then March would still get 201601, then 201602 for Jan and 201603 for Feb. You'd just need to find some way to define the custom sort order in your column, either through a conditional column or maybe hard-coding the values in an Excel table.
If it's just that a year doesn't start with January because there is no January for that year (e.g., no sales for that month), you could still use the YYYYMM format to sort your months, and if the year starts with March, it won't hurt your chronological sort order anyway.
I think I have a much simpler answer. The 2 main issues are the first letters of each month of the year are not in alphabetical order, so Excel always wants to put April first instead of January. And if you try to give each month a number, October, November, and December present problems because 10, 11, and 12 get put before 1 (which would be January).
So, however you're going to label your months (typically January = 1, February = 2 and so on), make October = 91 (because September would have equaled 9), make November = 92 and December = 93.
This gets your pivot table sorted correctly and when you go to make your graph, you can just rename each of those fields to be whatever you want. And most importantly, they'll stay in the same order you want them.