Finding the average of the top 10 values

CoogansBluff

Board Regular
Joined
Mar 7, 2021
Messages
61
Office Version
  1. 2013
Platform
  1. Windows
Column A has students' names for each time a student took a test.
Column B has their grades on the tests.
Some students took more tests than others, so the number of times a student's name appears in column A could vary from 1 to 10.
In column C, I'll have every student's name listed once.
In column D, I want a formula that would compute the students' final grade based on the following criteria - average of their best 5 test scores, but if less than 5 tests taken, it would be the average of however many tests they took. Take one test, make a 92, and that's your final grade.

What formula would I need for cell D1? One that I could copy and post down that column to determine the final grade for all students?
 
Try:

Book1
ABCDE
1NameGradeNameTop 5 AverageNumber of tests included
2Amy79Amy88.45
3Bob77Bob79.85
4Bob77Chris91.65
5Bob69Dan872
6Chris73Em621
7Dan75
8Amy100
9Bob61
10Chris95
11Bob63
12Chris88
13Em62
14Chris87
15Chris93
16Dan99
17Amy80
18Amy95
19Chris62
20Bob93
21Bob82
22Chris95
23Bob70
24Amy88
25Chris70
26Chris84
27
Sheet9
Cell Formulas
RangeFormula
D2:D6D2=AVERAGE(LARGE(IF(A$2:A$50=C2,B$2:B$50),ROW(INDIRECT("1:"&MIN(5,COUNTIF(A$2:A$50,C2))))))
E2:E6E2=MIN(5,COUNTIF(A$2:A$50,C2))
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
Solution
Brilliant, thanks! Really appreciate folks like yourself who spend time to actually create a spreadsheet with the solution. That made it so easy from my end. Can't thank you enough!
 
Upvote 0

Forum statistics

Threads
1,226,853
Messages
6,193,368
Members
453,792
Latest member
Vic001

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