Critical SUM UP!!!!!

excelindianfanclub

Board Regular
Joined
Oct 20, 2012
Messages
64
Column1TEAMSCORE
Kings Team2Kings Team154
Kings Team1Kings Team185
Alpha Team1Alpha Team182
Dragon Team1Dragon Team218
Altas Team1Altas Team234
Kings Team2Kings Team226
Alpha Team2Alpha Team232
Dragon Team2Dragon Team231
Kings Team3Kings Team223
Alpha Team3Alpha Team221
Altas Team2Altas Team209
Kings Team4Kings Team245
Kings Team5Kings Team184
Dragon Team3Dragon Team260
Altas Team3Altas Team238
Kings Team6Kings Team189
Altas Team4Altas Team260
Altas Team5Altas Team225
Altas Team6Altas Team254

<colgroup><col><col><col></colgroup><tbody>
</tbody>

My friend gave me a table consist of team name and score as shown above.My friend asked me to add the scores of team in three different manner
1)add first two values,three values,... of particular team say here add up first two scores of alpha team
2)add two particular values ..say add up second score and fifth score of Altas team
3)add from Kth score to Mth score... say add up scores from second to fourth score of kings team.

i made separate column(which is Column 1 here).used formula
E4&COUNTIF($E4:$E$5,E4) for a table consists of values from D4:F22.

i can't find solutions..i wasted 4 hours already.. please help me. thanks in advance.
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
The following assumes that A2:A20 contains the team, and B2:B20 contains the corresponding score...

1)add first two values,three values,... of particular team say here add up first two scores of alpha team

=SUM(IF(ROW(A2:A20)<=SMALL(IF(A2:A20="Alpha Team",ROW(A2:A20)),2),IF(A2:A20="Alpha Team",B2:B20)))

...confirmed with CONTROL+SHIFT+ENTER.

2)add two particular values ..say add up second score and fifth score of Altas team

=SUM(IF(ISNUMBER(MATCH(ROW(A2:A20),SMALL(IF(A2:A20="Atlas Team",ROW(A2:A20)),{2,5}),0)),B2:B20))

...confirmed with CONTROL+SHIFT+ENTER.

3)add from Kth score to Mth score... say add up scores from second to fourth score of kings team.

If, for example, you want to add from the 2nd to the 4th score, try...

=SUM(IF(ROW(A2:A20)>=SMALL(IF(A2:A20="Kings Team",ROW(A2:A20)),2),IF(ROW(A2:A20)<=SMALL(IF(A2:A20="Kings Team",ROW(A2:A20)),4),IF(A2:A20="Kings Team",B2:B20))))

or

=SUM(IF(ISNUMBER(MATCH(ROW(A2:A20),SMALL(IF(A2:A20="Kings Team",ROW(A2:A20)),{2,3,4}),0)),B2:B20))

Note that for the last formula, the array constant {2,3,4} determines that you want to add the 2nd, 3rd, and 4th scores. Change this accordingly.

Also, note that both formulas need to be confirmed with CONTROL+SHIFT+ENTER.
 
Last edited:
Upvote 0
dear Domenic

thanks for ur help.. i had a issue with the second case.. im able to make a cell reference for team name but unable to call cell reference for 2 and 5 in the formula provided by u (shown in red color).. how to overcome this issue. .. thanks in advance

=SUM(IF(ISNUMBER(MATCH(ROW(A2:A20),SMALL(IF(A2:A20="Atlas Team",ROW(A2:A20)),{2,5}),0)),B2:B20))
 
Upvote 0
If the cells are adjacent to each other, for example D2 contains 2 and E2 contains 5, try...

=SUM(IF(ISNUMBER(MATCH(ROW(A2:A20),SMALL(IF(A2:A20="Atlas Team",ROW(A2:A20)),D2:E2),0)),B2:B20))

If the cells are not adjacent to each other, for example D2 contains 2 and F2 contains 5, try...

=SUM(IF(ISNUMBER(MATCH(ROW(A2:A20),SMALL(IF(A2:A20="Atlas Team",ROW(A2:A20)),CHOOSE({1,2},D2,F2)),0)),B2:B20))

If you have more than two that you wish to sum and they are not in adjacent cells, for example 2nd (D2), 5th (F2), and 8th (H2), try...

=SUM(IF(ISNUMBER(MATCH(ROW(A2:A20),SMALL(IF(A2:A20="Atlas Team",ROW(A2:A20)),CHOOSE({1,2,3},D2,F2,H2)),0)),B2:B20))

Note that these formulas also need to be confirmed with CONTROL+SHIFT+ENTER.
 
Upvote 0

Forum statistics

Threads
1,221,558
Messages
6,160,485
Members
451,651
Latest member
Penapensil

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