Find max value of sumifs

mrblister

Board Regular
Joined
Nov 20, 2016
Messages
191
Office Version
  1. 2019
Platform
  1. Windows
[TABLE="class: grid, width: 256"]
<tbody>[TR]
[TD="width: 64"][/TD]
[TD="width: 64, align: left"]A[/TD]
[TD="width: 64, align: left"]B[/TD]
[TD="width: 64, align: left"]C[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD="align: left"]Name[/TD]
[TD="align: left"]Points[/TD]
[TD="align: left"]Current Leader[/TD]
[/TR]
[TR]
[TD="align: right"]2[/TD]
[TD="align: left"]Amy[/TD]
[TD="align: right"]10[/TD]
[TD="align: left"]Amy[/TD]
[/TR]
[TR]
[TD="align: right"]3[/TD]
[TD="align: left"]Bob[/TD]
[TD="align: right"]5[/TD]
[TD="align: left"]Amy[/TD]
[/TR]
[TR]
[TD="align: right"]4[/TD]
[TD="align: left"]Amy[/TD]
[TD="align: right"]2[/TD]
[TD="align: left"]Amy[/TD]
[/TR]
[TR]
[TD="align: right"]5[/TD]
[TD="align: left"]Caleb[/TD]
[TD="align: right"]15[/TD]
[TD="align: left"]Caleb[/TD]
[/TR]
[TR]
[TD="align: right"]6[/TD]
[TD="align: left"]Bob[/TD]
[TD="align: right"]10[/TD]
[TD="align: left"]Caleb[/TD]
[/TR]
[TR]
[TD="align: right"]7[/TD]
[TD="align: left"]Bob[/TD]
[TD="align: right"]1[/TD]
[TD="align: left"]Bob[/TD]
[/TR]
[TR]
[TD="align: right"]8[/TD]
[TD="align: left"]Amy[/TD]
[TD="align: right"]4[/TD]
[TD="align: left"]Bob[/TD]
[/TR]
[TR]
[TD="align: right"]9[/TD]
[TD="align: left"]Bob[/TD]
[TD="align: right"]1[/TD]
[TD="align: left"]Bob[/TD]
[/TR]
[TR]
[TD="align: right"]10[/TD]
[TD="align: left"]Amy[/TD]
[TD="align: right"]2[/TD]
[TD="align: left"]Amy[/TD]
[/TR]
</tbody>[/TABLE]

I'm trying to find a formula for column C, which outputs the person with the greatest accumulated score (accumulates moving down. E.g. C5 outputs the person with the highest score between rows 1 and 5). Notes:
  • If there is a tie (e.g. C6, C8), column C returns the incumbent name (the name higher on the list) OR can display "Tie"
  • I'd rather not use helper columns FOR NAMES if possible, as I have many names. But helper columns would be OK, just not for names.

Thanks!
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Try this in C2:

=INDEX($A$1:$A2,MATCH(MAX(SUMIF($A$1:$A2,$A$1:$A2,$B$1:$B2)),SUMIF($A$1:$A2,$A$1:$A2,$B$1:$B2),0))

confirm with Control+Shift+Enter, then drag down as needed.
 
Upvote 0
Hi,

Since it's accumulated scores going down column...

Use C2 formula copied down if you want to show "Tie" (Your sample row 6 where you show "Caleb" should be a Tie between Bob and Caleb ?)
Use D2 formula copied down if you Don't need to show "Tie", as in your posted sample.

Formulas normally entered:


Book1
ABCD
1NamePointsCurrent Leader
2Amy10AmyAmy
3Bob5AmyAmy
4Amy2AmyAmy
5Caleb15CalebCaleb
6Bob10TieCaleb
7Bob1BobBob
8Amy4TieBob
9Bob1BobBob
10Amy2AmyAmy
11Bob1TieAmy
Sheet626
Cell Formulas
RangeFormula
C2=IF(SUMIF(A$2:A2,A2,B$2:B2)=SUMIF(A$1:A1,A1,B$1:B1),"Tie",IF(SUMIF(A$2:A2,A2,B$2:B2)>SUMIF(A$1:A1,A1,B$1:B1),A2,C1))
D2=IF(SUMIF(A$2:A2,A2,B$2:B2)>SUMIF(A$1:A1,A1,B$1:B1),A2,C1)
 
Upvote 0

Forum statistics

Threads
1,223,910
Messages
6,175,316
Members
452,634
Latest member
cpostell

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