+ Reply to Thread
Results 1 to 5 of 5

Pivot table not sorting correctly

  1. #1
    Forum Contributor
    Join Date
    08-03-2021
    Location
    London
    MS-Off Ver
    365
    Posts
    610

    Pivot table not sorting correctly

    Hi,
    I have table with upper and lower limits defined as

    F16&"<"&"Sales"&"<"&G16 so; 5 < Sales <= 10 etc.

    But when I used this in a pivot it didn't sort correctly , so I added a "" to the start of each cell

    ""&F16&"<"&"Sales"&"<="&""&G16

    and then it worked ok, but not entirely sure why, I've attached the workbook with both examples, have I moved the 5 from the 'tens' to "units' ?

    Richard.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Pivot table not sorting correctly

    "F16&"<"&"Sales"&"<"&G16 so; 5 < Sales <= 10 etc."

    F16 contains a value.

    If Excel sorts a value it sorts 20 before 5, since 20 begins with 2.


    After you add "" in the formula Excel sorts on text.
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  3. #3
    Forum Contributor
    Join Date
    08-03-2021
    Location
    London
    MS-Off Ver
    365
    Posts
    610

    Re: Pivot table not sorting correctly

    Well yes, that was my initial thought, but if you concatenate a number with text, doesn't it all become text anyway,
    joining a and 5 to make a5 or 5a would be to the left ( text) , even before adding "", its not really a value its text already?

    Or am I wrong?

  4. #4
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Pivot table not sorting correctly

    Yes, you are right.

    But you did not add a before 5 (a5 => which is text).

    You just used 5 (5 => which is a value).

  5. #5
    Forum Contributor
    Join Date
    08-03-2021
    Location
    London
    MS-Off Ver
    365
    Posts
    610

    Re: Pivot table not sorting correctly

    The formual is

    "F16&"<"&"Sales"&"<"&G16 so; 5 < Sales <= 10 etc.",

    were you just looking at the result of the formula and not the formula or actual tables?

    so F16 (5) , will now become text, as is joined , but still won't sort correctly,
    it is only after adding "", which I is a null value, so not blank, that the pivot sorts.

    RD

+ 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] Issue with Pivot Chart not Displaying Pivot Table Info Correctly
    By dayuewan in forum Excel General
    Replies: 16
    Last Post: 10-19-2021, 08:31 AM
  2. [SOLVED] Pivot Table Not Sorting Correctly
    By marshak in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 12-05-2019, 08:09 PM
  3. [SOLVED] Pivot Table Not Sorting "Wk_1" through "Wk_52" Correctly
    By eNinjaInTraining in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 09-26-2019, 09:41 AM
  4. Dates Not Sorting Correctly in Pivot Table
    By eightythree in forum Excel Charting & Pivots
    Replies: 12
    Last Post: 01-20-2015, 02:28 PM
  5. Replies: 14
    Last Post: 10-10-2014, 05:25 PM
  6. Pivot table no longer sorting correctly (2003)
    By mlk in forum Excel General
    Replies: 0
    Last Post: 02-28-2011, 02:15 PM
  7. [SOLVED] Pivot Table not sorting correctly
    By Marian in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 04-28-2006, 12:20 PM

Tags for this Thread

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