can't sort pivot table column

Tripleseas

Board Regular
Joined
Jul 12, 2022
Messages
87
Office Version
  1. 2013
Platform
  1. Windows
Hello,
i have created a pivot table from a data set. then I added a variation between the year 2022 and 2023 as shown below.
In my report, i want to sort the variation ( number) from the biggest negative to the biggest positive.
but when i use sorting, it just sort the volume column and not the variation column. i just can't seem to get it work.
is there any solution to this please. thank you


variation.xlsx
ABCDEFGHIJK
2
3AnnéeValeurs
420222023
5CodeNumberVolumeVariation VolumeVariation NumberNumberVolumeVariation VolumeVariation NumberRESULT WANTED
610102,6045,757,08600-2,604-5,757,086-5,757,086
799997,1487,687,8938,6399,179,0291,4911,491,137-2,239,470
890029,5568,355,9667,9356,116,496-1,621-2,239,4701,491,137
9900018,775129,516,44336,132173,285,05817,35743,768,61543,768,615
1099000060,633131,437,28960,633131,437,289131,437,289
Feuil2
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
What happens if you click on any of the "values" in Column I eg I6. right click and select Sort then Smallest to Largest ?
 
Upvote 0
What happens if you click on any of the "values" in Column I eg I6. right click and select Sort then Smallest to Largest ?
Hey,
when i sort the variation column ( column I) from smallest to biggest , what is sorted is the column G ( volume) and not the variation column.
 
Upvote 0
I think you are clicking either the column or the heading, click on 1 of the numbers in the column
 
Upvote 0
OK I see what you mean.

If you are happy for the output to look a little different to what you currently have and are ok to hard code the years then you can use Calculated Items to sort by the difference.

• Click on any of the Year fields in the heading ie Année, 2022 or 2023
• in PivotTable Analyze > Fields, Items & Sets > Calculated Item
Create an item using Année by clicking on 2023 then minus then 2022 to give you ='2023'-'2022'
Give it a name. The name will show as if it was a Year in your pivot heading.
• You will now have an additional "Year" called in my case Difference in your pivot table.
If you click in that column and apply a sort it should give the desired result.

1680845861056.png


Output

20230407 PIvot Table Sort Diff Field Tripleseas.xlsm
HIJKLMNOP
37AnnéeValues
3820222023DifferenceTotal NumberTotal Volume
39Code Number Volume Number Volume Number Volume
40101026045,757,086.280-2604( 5,757,086.28)0
41900295568,355,966.2879356,116,496.24-1621( 2,239,470.04)1587012,232,992.48
42999971487,687,892.5086399,179,029.0014911,491,136.501727818,358,058.00
43900018775129,516,442.9636132173,285,057.741735743,768,614.7872264346,570,115.48
449900060633131,437,288.7760633131,437,288.77121266262,874,577.54
45Grand Total38083151,317,388.02113339320,017,871.7575256168,700,483.73226678640,035,743.50
Sheet1
 
Upvote 0

Forum statistics

Threads
1,224,817
Messages
6,181,147
Members
453,021
Latest member
Justyna P

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
Back
Top