Results 1 to 6 of 6

Thread: Simple Pivot Table Sort Problem
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    Board Regular
    Join Date
    Apr 2002
    Location
    Wilmington North Carolina USA
    Posts
    165
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Simple Pivot Table Sort Problem

    Hello,
    I am trying to solve a problem a colleague is having with a simple pivot table.

    She has two data elements "Den Rsn Code" and Description. She has two sum values: Count of Den Rsn Code and Sum of Total Balance.
    The table is in tabular format. We are using Excel 2016.

    We cannot get the table to sort on Sum of Trial Balance. Every sort option seems to only sort based on the Den Rsn Code and/or Sum of Trial Balance.
    I have sorted pivot tables by balance in ascending or descending order in the past but I can't work my way through on this one.

    I know it is something simple but I am stumped.

    Any suggestions?

    Thanks to all.

  2. #2
    MrExcel MVP
    Moderator
    RoryA's Avatar
    Join Date
    May 2008
    Location
    UK
    Posts
    33,990
    Post Thanks / Like
    Mentioned
    53 Post(s)
    Tagged
    6 Thread(s)

    Default Re: Simple Pivot Table Sort Problem

    Which of the data fields are you applying the sort to?

  3. #3
    Board Regular
    Join Date
    Apr 2002
    Location
    Wilmington North Carolina USA
    Posts
    165
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Simple Pivot Table Sort Problem

    Sum of trial balance

  4. #4
    MrExcel MVP
    Moderator
    RoryA's Avatar
    Join Date
    May 2008
    Location
    UK
    Posts
    33,990
    Post Thanks / Like
    Mentioned
    53 Post(s)
    Tagged
    6 Thread(s)

    Default Re: Simple Pivot Table Sort Problem

    Not the value fields, which row field?

    If you apply it to the first row field, it will sort by the total balance for each entry in that field. If you sort the second row field, it will only sort each one within the grouping set by the first field.

  5. #5
    Board Regular
    Join Date
    Apr 2002
    Location
    Wilmington North Carolina USA
    Posts
    165
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Simple Pivot Table Sort Problem

    I am trying to sort the table using Sum of Trial Balance in descending order.
    I got it to work, and I don't understand why, starting a new pivot table on a clean worksheet, using the only the Rsn Code as my data field, putting in the sum of trial balance column and sorting on the value field. That worked and I added in the count of code and the description data field to finish it off. At this point it will not sort.
    Why does it work using only the first data field and not when the second data field is added in?

    In any case thank you for the assistance

    SRM

  6. #6
    MrExcel MVP
    Moderator
    RoryA's Avatar
    Join Date
    May 2008
    Location
    UK
    Posts
    33,990
    Post Thanks / Like
    Mentioned
    53 Post(s)
    Tagged
    6 Thread(s)

    Default Re: Simple Pivot Table Sort Problem

    If you sort by the first field, it will sort each group in the first field, but not sort the second field. If you sort the second field, it will only sort within the first field groupings. For example:

    A
    B
    C
    D
    E
    F
    G
    H
    I
    J
    K
    L
    1
    Data set Sorted descending using first field Sorted descending using second field.
    2
    f1 F3 f2 f1 F3 Sum of f2 f1 F3 Sum of f2
    3
    a a1
    1
    b a1
    16
    a a2
    12
    4
    a a1
    2
    a2
    3
    a1
    3
    5
    a a2
    3
    b Total
    19
    a Total
    15
    6
    a a2
    4
    a a1
    3
    b a1
    16
    7
    a a2
    5
    a2
    12
    a2
    3
    8
    b a1
    11
    a Total
    15
    b Total
    19
    9
    b a1
    5
    Grand Total
    34
    Grand Total
    34
    10
    b a2
    2
    11
    b a2
    1


    In the first pivot, sorting the first row field descending will not affect the order of the second field within the first field. In the second one, sorting the second field only applies within the first field grouping, but does not affect how the first field sorts.

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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