Sum values only once when value listed more than once

Nebula2121

New Member
Joined
Apr 1, 2016
Messages
32
ABC
1NameValueResult
2Apple57
3Broccoli1012
4Broccoli10
5Apple20
6Broccoli10
7Pear50

<tbody>
</tbody>

How do I set up an excel formula for the desired result in Column C? I would like the sum of value for each name to show up once and only have the largest 2 result present. I can do this easily with a pivot, but can't figure out the formula. Thanks!
 
Last edited:

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
Try:

ABC
1NameValueResult
2Apple57
3Broccoli1012
4Broccoli1
5Apple2
6Broccoli1
7Pear5

<colgroup><col style="width: 25pxpx"><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet6

Array Formulas
CellFormula
C2{=IF(COUNTIF($A$1:$A1,A2)>0,"",IF(SUMIF($A$2:$A$7,A2,$B$2:$B$7)>=LARGE(SUMIF($A$2:$A$7,$A$2:$A$7,$B$2:$B$7)*IF(MATCH($A$2:$A$7,$A$2:$A$7,0)=ROW($A$2:$A$7)-ROW($A$2)+1,1,0),2),SUMIF($A$2:$A$7,A2,$B$2:$B$7),""))}

<thead>
</thead><tbody>
</tbody>
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
Note: Do not try and enter the {} manually yourself

<tbody>
</tbody>
 
Upvote 0

Forum statistics

Threads
1,214,591
Messages
6,120,427
Members
448,961
Latest member
nzskater

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