+ Reply to Thread
Results 1 to 3 of 3

Can't Get Sort Order Correct in Pivot Table

  1. #1
    Registered User
    Join Date
    02-05-2019
    Location
    Orlando, Florida
    MS-Off Ver
    Professional Plus 2016
    Posts
    1

    Can't Get Sort Order Correct in Pivot Table

    I created a pivot table to compare monthly totals year over year. Each data record has a date (named moyr) which is always the first of the month (so that all of my data is grouped by month). My columns are moyr and Years (which Excel inserts). My Values are Sum of amount. This produces a pivot table with 3 columns for each month (last year, this year, both years' amounts added together). In my data query I multiply last year's numbers by -1 so that when the two years' amounts are summed, I get the net difference. I know that is clunky, but I didn't know how else to do it.

    So now the problem. I sort the columns from newest to oldest. This worked great until January. I should be seeing Jan 2019/2018 followed by Dec 2018/2017 followed by Nov 2018/2017 etc. But it is sorting by month only. So, I get Dec 2018/2017, Nov 2018/2017, etc and Jan 2019/2018 is last. Any help would be greatly appreciated. And I am totally open to reworking my data query if that's what is needed.

    Here is a screen shot of my pivot table. I hide the middle months so you can see both ends of the sort order.

    PivotTable.png

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Can't Get Sort Order Correct in Pivot Table

    Hi and welcome to the forum

    Are your dates proper date numbers?

    Please upload a workbook or a representative cut down copy, anonymised if necessary. It is always easier to advise if we can see your request in its context.

    Show a before and after situation with manually calculated results, explaining which information is data and which is results, and if it's not blindingly obvious how you have arrived at your results some explanatory notes as well.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,903

    Re: Can't Get Sort Order Correct in Pivot Table

    It sounds like you need to not group the dates. Instead add a new calculated year column to your data source, then use the original date column as the first column field and format it as month only, with the new year field as the second column field.
    Rory

+ 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. Pivot Table Sort Order, help please
    By Hassan1977 in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 10-23-2015, 04:41 PM
  2. [SOLVED] how to get the correct sort order
    By sumesh56 in forum Excel General
    Replies: 15
    Last Post: 10-30-2014, 10:58 AM
  3. Pivot Table descending sort order of (Blanks) + VBA
    By bezwlosy in forum Excel Charting & Pivots
    Replies: 12
    Last Post: 09-09-2014, 07:38 AM
  4. Incorrect sort order on Pivot Table
    By bruiser in forum Excel General
    Replies: 10
    Last Post: 03-14-2014, 11:04 AM
  5. Excel 2007 : Pivot Table Sort Order
    By paulrockliffe in forum Excel General
    Replies: 1
    Last Post: 03-30-2010, 12:46 PM
  6. Pivot table sort order
    By Vincdc in forum Excel General
    Replies: 2
    Last Post: 03-01-2006, 01:25 PM
  7. [SOLVED] pivot table dates are out of order how do I correct them
    By D Beals in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-18-2005, 01:06 PM

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