Pivot table, sort rows

zinah

Active Member
Joined
Nov 28, 2018
Messages
368
Office Version
  1. 365
Platform
  1. Windows
Hi,

I have below sample data and what I need to know, is there any way that I can sort descending and get the result (same as expected result table) rather than me dragging and dropping the team manually to make it descending order?

Test File_Pivot Sort.xlsx
ABCDEFGHIJKL
1transaction_dateproduct_idcustomer_idquantity
219970101Team A34494
319970105NA24112Original pivotThe expected result
419970107Team A24222Row LabelsCount of product_idRow LabelsCount of product_id
519970110Team B24424Team A43Team A43
619970110Team A31873318318
719970111Team C12712214214
819970112Team C73243410410
919970112Team A902125151
1019970114Team B64903NA5Team B38
1119970117NA4784443314
1219970119Team B378321414
1319970121Team C131043127
1419970121Team A23274Team B3852
1519970125Team B3849531411
1619970129Team B75253414Team C6
1719970201Team A107042733
1819970201Team A499835251
1919970203Team C207831121
2019970205Team A15493Team C641
2119970212NA7727333NA5
2219970212Team A211035143
2319970213Team C67932121
2419970216Team B766424131
2519970216Team A89373Grand Total92Grand Total92
2619970219Team B78132
2719970219Team A11543
2819970219Team C82435
2919970219Team A86062
3019970220Team B34262
3119970225NA48584
3219970310Team A84273
3319970311Team B57922
3419970313Team B50604
3519970313Team A25253
3619970313Team A25883
3719970313Team A32712
3819970315NA67084
3919970315Team A7712
4019970318Team A17202
4119970320Team B49093
4219970324Team B36634
4319970329Team B12893
4419970329Team B81084
4519970329Team A24415
4619970403Team B80534
4719970407Team A65292
4819970410Team A42203
4919970412Team B9534
5019970413Team B60014
5119970413Team A11682
5219970414Team B2743
5319970414Team B27573
5419970417Team B9014
5519970417Team B26254
5619970427Team B16463
5719970502Team A94402
5819970503Team A37733
5919970505Team B24264
6019970505Team A55423
6119970507Team B95814
6219970508Team A72983
6319970509Team A303
6419970514Team B76074
6519970515Team B63813
6619970517Team A49584
6719970519Team A99444
6819970521Team B61454
6919970521Team B74363
7019970521Team B79023
7119970522Team B97472
7219970526Team A91022
7319970529Team A4304
7419970603Team B7603
7519970604Team A5473
7619970604Team A18382
7719970605Team A53532
7819970605Team A59233
7919970607Team A42793
8019970610Team A16752
8119970611Team A86474
8219970614Team B56233
8319970616Team B34972
8419970616Team A93242
8519970617Team B71904
8619970617Team A78354
8719970618Team A51533
8819970621Team B44335
8919970621Team B97102
9019970621Team A44334
9119970623Team B82921
9219970627Team A6634
9319970628Team B40633
94
95
Sheet1
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
Sort Row labels twice:
1. on product id
2. on quantity

1625937811793.png
 
Upvote 0
Solution

Forum statistics

Threads
1,224,823
Messages
6,181,185
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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