Simple Pivot Table Sort Problem

srmorgan

Board Regular
Joined
Apr 18, 2002
Messages
165
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.
 

RoryA

MrExcel MVP, Moderator
Joined
May 2, 2008
Messages
34,188
Office Version
365, 2019, 2016, 2010
Platform
Windows, MacOS
Which of the data fields are you applying the sort to?
 

RoryA

MrExcel MVP, Moderator
Joined
May 2, 2008
Messages
34,188
Office Version
365, 2019, 2016, 2010
Platform
Windows, MacOS
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.
 

srmorgan

Board Regular
Joined
Apr 18, 2002
Messages
165
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
 

RoryA

MrExcel MVP, Moderator
Joined
May 2, 2008
Messages
34,188
Office Version
365, 2019, 2016, 2010
Platform
Windows, MacOS
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 setSorted descending using first fieldSorted descending using second field.
2
f1F3f2f1F3Sum of f2f1F3Sum of f2
3
aa1
1
ba1
16
aa2
12
4
aa1
2
a2
3
a1
3
5
aa2
3
b Total
19
a Total
15
6
aa2
4
aa1
3
ba1
16
7
aa2
5
a2
12
a2
3
8
ba1
11
a Total
15
b Total
19
9
ba1
5
Grand Total
34
Grand Total
34
10
ba2
2
11
ba2
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.
 

Forum statistics

Threads
1,078,487
Messages
5,340,631
Members
399,387
Latest member
amrita34

Some videos you may like

This Week's Hot Topics

  • Problem with Radio Button's format control
    I am creating an employee evaluation template (a sample is below) Column A is the category Column B, C D, E and F will be ratings (unacceptable...
  • Last Display on userform to a Listbox
    [CODE=vba] lstdisplay.ColumnCount = 15 lstdisplay.RowSource = "A1:O600000" [/CODE] So when i do this it Displays everything on the sheet i am...
  • Rename and move files to a new location
    Dear all, I have an excel file with the following information. The actual file name is at column A but i want to rename it using the following...
  • Help with True/False Formula
    Hello! Am stumped how to fix this formula, in which my result returns 'True', but it should return False. =IF(AG2=True...
  • Clear extra characters from a provided range of cells
    Dear All, I have following code which gives me desired output to remove extra characters from a provided range. But it takes too much time when...
  • Help with Current and highest streaks
    Hi there, I've just joined the forum and this is my first post. I've already spent quite a bit of time searching the net and this forum for a...
Top