1] Here's the formulae modification based on AliGW's file at post #.14, with revision highlighted in red color and suit for Excel below Office 365 version
H39:
=SUM(INDEX($C$2:$C$3378,N(IF(1,MATCH(LARGE(IF($B$2:$B$3378=$G39,$D$2:$D$3378),ROW($1:$50)),$D$2:$D$3378,0)))))
I39:
=SUM(LARGE(IF($B$2:$B$3378=$G39,$D$2:$D$3378),ROW($1:$50)))
All formulae to be in CSE array enter instead of just enter
2] The different results (Post #11 & Post #12) between Office 365 and lower Excel version in this example, reason maybe the worksheet is under Filter mode.
3] Please see attached file
Regards
Bosco