+ Reply to Thread
Results 1 to 7 of 7

Pivot table: can't sort Months in chronological order

  1. #1
    Forum Contributor
    Join Date
    12-02-2020
    Location
    Leeds
    MS-Off Ver
    Microsoft Office 365
    Posts
    271

    Pivot table: can't sort Months in chronological order

    Good evening,

    This is my first post. I am a Pharmacy Technician but my new role involves organising, analysing, interpreting and presenting data. I have started using Excel recently. I need your help to sort out my pivot table and advice regarding "how to sort the month column chronologically".
    The question reads:
    Rivaroxaban
    Dapagliflozin
    Empagliflozin
    Ticagrelor
    but this time it's a new indication for an existing product so we need to see the monthly increase in spend i.e. April 2019 vs April 2020 but can be done as one increase for the whole group rather than individually like the list above.

    I managed to get the data for the above anticoagulant drugs for 2019 and 2020 but doesn't know how to go about this?

    Why can't I sort the months in pivot table chronologically?
    How can I show the data as per requirement: to see the monthly increase in spend i.e. April 2019 vs April 2020 but can be done as one increase for the whole group rather than individually like the list above ?

    Thank you in advance.
    Attached Files Attached Files
    Last edited by Jigneshbharati; 12-02-2020 at 12:23 PM.

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,447

    Re: Pivot table: can't sort Months in chronological order

    As you can see ( left alignment) your dates are not real dates but text looking like dates.
    Replace them with real dates, and your Pivot will work as requested
    To achieve this create a new column with following formula
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    and Copy/Paste/Values on col A
    Now refresh your PT
    Last edited by Pepe Le Mokko; 12-02-2020 at 02:08 PM.

  3. #3
    Forum Contributor
    Join Date
    12-02-2020
    Location
    Leeds
    MS-Off Ver
    Microsoft Office 365
    Posts
    271

    Re: Pivot table: can't sort Months in chronological order

    Thank you so much! I am so sorry, the data hasn't been entered by me, it's from the other system we use to pull prescribing data. The Months column has months name in it. Could you please elaborate on this? How do we know that the data in the Months column is not month or data type?

  4. #4
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2404 Win 11 Home 64 Bit
    Posts
    23,865

    Re: Pivot table: can't sort Months in chronological order

    In your source data it is not entered as a date. You would be better served to have it as a date, ie. 4/1/2019 and then sort it in the PT.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  5. #5
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,447

    Re: Pivot table: can't sort Months in chronological order

    Quote Originally Posted by Jigneshbharati View Post
    Could you please elaborate on this? How do we know that the data in the Months column is not month or data type?
    Click on a cell and select the number format. it it's a date you should get a number between 1 and 40000+
    Also if no manual alignment is applied, text aligns left, and numbers right ( which is what a date is even if XL shows you something like 01/04/2009)
    As my locale is different from yours, I cannot do it for you

  6. #6
    Forum Contributor
    Join Date
    12-02-2020
    Location
    Leeds
    MS-Off Ver
    Microsoft Office 365
    Posts
    271

    Re: Pivot table: can't sort Months in chronological order

    Thank you so much.

  7. #7
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,447

    Re: Pivot table: can't sort Months in chronological order

    Based on your last post it seems that you are satisfied with the solution(s) you've received but you haven't marked your thread as SOLVED. If your problem has not been solved you can use Thread Tools (located above your first post) and choose "Mark this thread as unsolved".
    Thanks.

    Also, as a relatively new member of the forum, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Months out of order on pivot table
    By mrteater in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 11-06-2020, 12:51 PM
  2. Months out of order on pivot table
    By mrteater in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 11-06-2020, 09:38 AM
  3. pivot table doesn't show dates in chronological order
    By danielpak in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 01-22-2019, 12:28 PM
  4. Pivot Table Not Sorting Time Period in Chronological Order
    By evarjas in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 08-13-2018, 10:17 PM
  5. How to order pivot table months
    By stephme55 in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 12-30-2015, 06:17 PM
  6. Pivot Table/Chart - Months in Alphabetical order
    By MunichMag in forum Excel Charting & Pivots
    Replies: 5
    Last Post: 09-04-2013, 09:06 AM
  7. months displayed in proper order in a pivot table
    By mariusescu in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-02-2008, 11:30 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1