Pivot Table Challenge - Arrays?

actjfc

Active Member
Joined
Jun 28, 2003
Messages
416
Excel friends,

The Pivot Below has more than 10,000 Codes. I need to find a formula or a way to get a list that looks like the summary on top.

The Description is the one corresponding to the maximum on the Total Column. I understand it can be done with Arrays. It will be a very elegant solution. I am curious if it can be solved by adding auxiliary columns to the Pivot Table Source. I appreciate any help! Thanks!



Excel 2019 (Windows) 64 bit
BCD
4CodeDescriptionSum(Total)
51234Description 1440,813
623457Description a97,756
7
8Total Expenses
9CodeDescriptionTotal
101234Description 1417,306
11Description 27,931
12Description 34,336
13Description 44,229
14Description 51,120
15Description 6927
16Description 7860
17Description 8839
18Description 9796
19Description 10599
20Description 11395
21Description 12358
22Description 13278
23Description 14245
24Description 15192
25Description 16158
26Description 1773
27Description 1869
28Description 1967
29Description 2039
30Description 210
31Description 220
32Description 230
33Description 240
341234 Total440,813
3523457Description a31,350
36Description b17,529
37Description c14,065
38Description d8,112
39Description e5,824
40Description f5,473
41Description g3,764
42Description h3,428
43Description i2,162
44Description j2,117
45Description k1,972
46Description l1,962
4723457 Total97,756
Sheet1
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
Friends,

I was able to get a solution to my problem, and I want to share it with you, I repeated all rows in the Pivot, and used a combination of Index, Maxifs, and match, look at the formulas below, no need of arrays:


Excel 2016 (Windows) 64 bit
BCD
4CodeDescriptionTotal
51234Description 1440,813
623457Description a97,756
Sheet1
Cell Formulas
RangeFormula
C5=INDEX($C$10:$C$47,MATCH(MAXIFS($D$10:$D$47,$B$10:$B$47,B5),$D$10:$D$47,0),1)
C6=INDEX($C$10:$C$47,MATCH(MAXIFS($D$10:$D$47,$B$10:$B$47,B6),$D$10:$D$47,0),1)
D5=INDEX($D$10:$D$47,MATCH(MAXIFS($D$10:$D$47,$B$10:$B$47,B5&" Total"),$D$10:$D$47,0),1)
D6=INDEX($D$10:$D$47,MATCH(MAXIFS($D$10:$D$47,$B$10:$B$47,B6&" Total"),$D$10:$D$47,0),1)



If you find a different solution, please post it!

Thanks!
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,830
Messages
6,121,831
Members
449,051
Latest member
excelquestion515

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