Summing top 5 marks in excel excluding those marked 'F'

baidya91

Board Regular
Joined
Jun 1, 2016
Messages
147
Given below is the list of 6 marks with various grades. Now how can I sum top 5 marks excluding that marked "F" in excel?



















51B45C63B+46C52B59F

<tbody>
</tbody>
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
You don't say how your sheet is laid out, but maybe something like this:

Excel 2012
ABCDEFGHIJKL
1Score1Grade1Score2Grade2Score3Grade3Score4Grade4Score5Grade5Score6Grade6
251B45C63B+46C52B59F
3
4257

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

Array Formulas
CellFormula
A4{=SUM(LARGE(IF(MOD(COLUMN(B2:L2),2)=0,IF(B2:L2<>"F",A2:K2)),{1,2,3,4,5}))}

<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
You don't say how your sheet is laid out, but maybe something like this:

Excel 2012
ABCDEFGHIJKL
1Score1Grade1Score2Grade2Score3Grade3Score4Grade4Score5Grade5Score6Grade6
251B45C63B+46C52B59F
3
4257

<tbody>
</tbody>
Sheet1

Array Formulas
CellFormula
A4{=SUM(LARGE(IF(MOD(COLUMN(B2:L2),2)=0,IF(B2:L2<>"F",A2:K2)),{1,2,3,4,5}))}

<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>

Thanks in advance, Sir.


But this formula does not apply in case of the following where there is no grade as "F":

48C51B77A45C78A 60B+

<tbody>
</tbody>


Please find a solution
 
Upvote 0
Thanks in advance, Sir.


But this formula does not apply in case of the following where there is no grade as "F":

48C51B77A45C78A60B+

<tbody>
</tbody>


Please find a solution

if you only get an error when there is no F present =iferror(SUM(LARGE(IF(MOD(COLUMN(B2:L2),2)=0,IF(B2:L2<>"F",A2:K2)),{1,2,3,4,5})),SUM(LARGE(IF(MOD(COLUMN(B2:L2),2)=0)

Hopefully that should work
 
Upvote 0
Hi,

Try this
Entered with Ctrl+Shift+Enter

A5 =SUM(LARGE(IFERROR(--(MOD(COLUMN(A2:R2),2) <> 0)*--(B2:S2 <> "F")*A2:R2,0),{1,2,3,4,5}))


ABCDEFGHIJKLMNOPQR
1ScoreGradeScoreGradeScoreGradeScoreGradeScoreGradeScoreGradeScoreGradeScoreGradeScoreGrade
251B45C63B+46C52B54F66C
3
4
5278

<colgroup><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col></colgroup><tbody>
</tbody>
 
Upvote 0
Please sir, i mean a formula that works both with grade "f" and without grade "f". But the one you have given does not apply in case of

48C51B77A45C78A 60B+

<tbody>
</tbody>

<tbody>
</tbody>
 
Last edited:
Upvote 0
Hi,

Try this
Entered with Ctrl+Shift+Enter

A5 =SUM(LARGE(IFERROR(--(MOD(COLUMN(A2:R2),2) <> 0)*--(B2:S2 <> "F")*A2:R2,0),{1,2,3,4,5}))


ABCDEFGHIJKLMNOPQR
1ScoreGradeScoreGradeScoreGradeScoreGradeScoreGradeScoreGradeScoreGradeScoreGradeScoreGrade
251B45C63B+46C52B54F66C
3
4
5278

<tbody>
</tbody>
51B45C63B+46C52B 59F
61B+48C64B+61B+66B+ 55B
48C51B77A45C78A 60B+

<colgroup><col><col><col><col><col><col><col span="2"><col><col><col><col><col><col><col><col><col span="2"><col><col><col span="2"><col span="2"><col span="4"><col span="2"><col span="2"></colgroup><tbody>
</tbody>

IN THE ABOVE THREE CASES YOUR FORMULA WORKS FINE WITH THE FIRST TWO CASES BUT IT DOES NOT WORK WITH THE THIRD ONE.

I HAVE TRIED BUT THE RESULT IT GIVES 330 IN PLACE OF 314. SO PLEASE SEE TO THAT.
 
Upvote 0
Hi,

Please note that the grade column is always in a even column and the score in odd column.

Entered with Ctrl+Shift+Enter and drag down

A6 =SUM(LARGE(IFERROR(--(MOD(COLUMN($A2:$P2),2) <> 0)*--($B2:$P2 <> "F")*$A2:$P2,0),{1,2,3,4,5}))

1ABCDEFHIJKLMNOPQ
251B45C63B+46C52B59F
361B+48C64B+61B+66B+55B
448C51B77A45C78A60B+
5
6257
7307
8314

<colgroup><col><col><col><col><col><col><col><col><col><col><col><col span="4"><col><col></colgroup><tbody>
</tbody>


<colgroup><col><col><col><col><col><col><col><col><col><col><col><col span="4"><col><col></colgroup><tbody>
</tbody>
 
Upvote 0

Forum statistics

Threads
1,214,643
Messages
6,120,702
Members
448,980
Latest member
CarlosWin

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