sorting by "difference from"

miconian

Well-known Member
Joined
Aug 18, 2004
Messages
768
I used Pivot Table Options -> Field Settings -> Show Values As -> Difference From.

I did this to show the difference in dollars from one month to another. My report now has two columns: month1 (which is blank, as it should be, since it's the base), and month2 (which shows the difference between the months).

I then formatted the month2 column like so:

"increase by" #,##0_);[Red]"decrease by" (#,##0);"no change"

So, my "difference from" column now looks kind of like this:

no change
no change
increase by $1
no change
decrease by ($3)
no change


I want it to look like this:

no change
no change
no change
increase by $1
increase by $2
increase by $6
decrease by ($7)
decrease by ($10)

For the life of me, I cannot figure out how to do this sort. Alphabetical doesn't do it, in either direction. The pivot table will not let me do a manual sort because it's a custom calculation.

Maybe I could use a custom list, but I don't know what that list would consist of, since the numbers in question will change constantly.

Any thoughts?
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.

GlennUK

Well-known Member
Joined
Jul 8, 2002
Messages
11,547
Number formatting doesn't alter the actual values. So, you are wanting to sort in this order
zeroes
positive numbers
negative numbers
... which is not a valid sort order.

Do you have to do the sorting within the pivottable? Otherwise you could copy the pivottable results as values, and create a sort field via formulas, and sort that.
 

miconian

Well-known Member
Joined
Aug 18, 2004
Messages
768
I don't have to do the sorting within the pivot table. The problem is that the raw data is going to be updated frequently. I need a solution that does not require the worksheet to be reformatted every time that happens.

Perhaps there is some way for the a non-pivot table (but still a table) to reflect the difference column's values, and that could be sorted, and it would also grow dynamically with updates? I have no idea how to do that, or if it's really possible.
 

GlennUK

Well-known Member
Joined
Jul 8, 2002
Messages
11,547
I don't have to do the sorting within the pivot table. The problem is that the raw data is going to be updated frequently. I need a solution that does not require the worksheet to be reformatted every time that happens.

Perhaps there is some way for the a non-pivot table (but still a table) to reflect the difference column's values, and that could be sorted, and it would also grow dynamically with updates? I have no idea how to do that, or if it's really possible.
I don't see how you'd get an automatic process without using VBA.
 

Watch MrExcel Video

Forum statistics

Threads
1,129,754
Messages
5,638,170
Members
417,011
Latest member
Amaden95

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top