Excel guide · 5 min read
How to average the top N values in Excel
=AVERAGE(LARGE(B2:F2,{1,2,3})) to average the three highest values. LARGE returns the 1st, 2nd and 3rd largest numbers and AVERAGE averages them. For the lowest values use SMALL instead, and for a number of values kept in a cell use =AVERAGE(LARGE(B2:F2,SEQUENCE($I$1))) in Excel 365 or 2021.Sample data
Every result on this page was calculated from this sheet by the same spreadsheet engine the Cellwise app uses.
| A | B | C | D | E | F | G | H | I | |
|---|---|---|---|---|---|---|---|---|---|
| 1 | Student | Quiz 1 | Quiz 2 | Quiz 3 | Quiz 4 | Quiz 5 | Best N | 3 | |
| 2 | Maya Chen | 78 | 92 | 85 | 92 | 60 | |||
| 3 | Owen Brooks | 88 | 74 | 95 | 81 | ||||
| 4 | Zara Ahmed | 70 | Absent | 65 | |||||
| 5 | Leo Fischer | 0 | 90 | 84 | 79 | 88 | |||
| 6 | Ines Duarte | 85 | 85 | 85 | 72 | 91 |
Download this sheet as an Excel practice file (.xlsx)
AVERAGE with LARGE and an array constant
The sheet is a quiz gradebook where each student's grade is the average of their best 3 of 5 quizzes. LARGE(range,k) returns the k-th largest number. Give it the array constant {1,2,3} and it returns the three largest at once, which AVERAGE then averages. This works in every Excel version and needs no Ctrl+Shift+Enter, because the constant is typed into the formula.
It reads across a row just as well as down a column, so fill it down to grade every student. Wrap it in ROUND(...,1) if the gradebook shows one decimal.
Result: 89.666666667
89.67 for Maya: her best three are 92, 92 and 85. The 78 and the 60 are dropped.
Keep N in a cell (Excel 365 and 2021)
Hard-coding {1,2,3} means editing every formula when the rule changes to best 4. Put N in a cell (I1 here) and build the list of ranks with SEQUENCE: SEQUENCE(3) is {1;2;3}. Lock the cell with $ so it stays put when you fill down.
In Excel 2019 and earlier there is no SEQUENCE. The classic replacement is ROW(INDIRECT("1:"&$I$1)) inside LARGE, confirmed with Ctrl+Shift+Enter. It works, but INDIRECT is volatile, so on a big gradebook prefer typing the constant.
Result: 89.666666667
89.67, the same as the {1,2,3} version, because I1 holds 3. Change I1 to 4 and every row recalculates.
Show which values were kept: SORT and TAKE (Excel 365)
When a student asks which quizzes counted, show the kept scores next to the grade. SORT(B2:F2,,-1,TRUE) sorts the row largest first (TRUE sorts across columns), and TAKE(...,,3) keeps the first three columns. Use $I$1 instead of the 3 to follow the N cell.
Wrap the same thing in AVERAGE for the grade: =AVERAGE(TAKE(SORT(B2:F2,,-1,TRUE),,3)) returns 89.67 for Maya, matching the LARGE version. For a column of data, drop the column arguments: TAKE(SORT(B2:B20,,-1),3) keeps the first three rows. TAKE is in Excel 365 and Excel 2024, not in Excel 2021, so stick with LARGE in files that travel.
Result: spills 1 row × 3 columns
| 92 | 92 | 85 |
92, 92 and 85 spill across three cells: Maya's three best scores, the ones her grade is built from.
Fewer than N values: avoid #NUM!
Zara has only two numeric scores. The "Absent" is text and LARGE ignores it, and so is an empty cell. Asking for the 3rd largest of two numbers gives #NUM!, and AVERAGE passes the error on. This is the error people hit most, usually for a new student or a short first month.
Decide what the rule should be. To average whatever is there, cap N at the number of values with MIN(N,COUNT(range)). To flag the row instead, use =IFERROR(AVERAGE(LARGE(B4:F4,{1,2,3})),"Not enough scores"). A blank counts as no score, but a typed 0 is a real score: if missed quizzes must count as zero, type 0 in them rather than leaving them empty.
Result: 67.5
67.5: Zara's 70 and 65. With a plain {1,2,3} the same row gives #NUM!.
Ties: LARGE counts duplicates, AVERAGEIF does not stop at N
Ines scored 85 three times. LARGE treats each 85 as its own value, so her top 2 are 91 and 85, and =AVERAGE(LARGE(B6:F6,{1,2})) gives 88. That is what "best 2 scores" means, and it is always exactly N values.
A common shortcut is to average everything at or above the N-th largest: =AVERAGEIF(B6:F6,">="&LARGE(B6:F6,2)). With ties at the cut-off it averages more than N values. Here it takes 91 and all three 85s, which is 4 values, not 2.
Result: 86.5
86.5, not 88: four scores pass the ">=85" test. Use AVERAGE with LARGE when you need exactly N values.
Bottom N, and dropping the lowest score
SMALL is the mirror of LARGE: =AVERAGE(SMALL(B5:F5,{1,2})) averages the two lowest values, useful for finding the weakest results. Zeros are numbers, so Leo's 0 counts. To leave zeros out, filter them first: =AVERAGE(SMALL(IF(B5:F5>0,B5:F5),{1,2})), entered with Ctrl+Shift+Enter in Excel 2019 and earlier.
"Drop the lowest score" is the same as averaging the top N where N is the count minus one, and it adapts when a student has fewer quizzes. In any version you can also write it as =(SUM(B5:F5)-MIN(B5:F5))/(COUNT(B5:F5)-1).
Result: 85.25
85.25 for Leo: his 0 is dropped and 90, 88, 84 and 79 are averaged. The SUM minus MIN version gives the same 85.25.
Which method to pick
A fixed rule like best 3 in any Excel version: AVERAGE(LARGE(range,{1,2,3})). A rule people change, in Excel 365 or 2021: SEQUENCE with N in a cell, capped with MIN and COUNT if some rows are short. Drop the lowest: SUM minus MIN, divided by COUNT minus one. To see which values were kept, list them with LARGE(range,SEQUENCE(N)) in Excel 365, or sort a copy. Skip the AVERAGEIF shortcut whenever ties are possible, which is any time scores are whole numbers.
Common mistakes
#NUM! on some rows
The row has fewer numbers than N. Use SEQUENCE(MIN(N,COUNT(range))) or wrap the formula in IFERROR with a clear message.
Blank cells instead of zeros for missed work
LARGE and AVERAGE skip blanks, so a missed quiz does not pull the average down. If it should count, type 0.
Numbers stored as text
Scores imported as text are ignored like "Absent", so a student seems to have fewer quizzes. Check with =COUNT(B2:F2) and convert them with Data > Text to Columns > Finish.
Including the N cell or a total column in the range
If the range reaches into a column holding N or a running total, that number can become one of the "top" values. Keep the range to the data cells only.
FAQ
How do I average the top 3 values in Excel?
Use =AVERAGE(LARGE(A2:A20,{1,2,3})). LARGE returns the three highest numbers and AVERAGE averages them. It works in every version of Excel.
How do I average the top 10% of values in Excel?
Work out N first, for example =ROUNDUP(COUNT(A2:A50)*10%,0), then use it with SEQUENCE: =AVERAGE(LARGE(A2:A50,SEQUENCE(N))). Round up so a small list still averages at least one value.
How do I average the lowest N values in Excel?
Use SMALL instead of LARGE: =AVERAGE(SMALL(A2:A20,{1,2,3})) averages the three smallest numbers. Zeros count as numbers.
How do I drop the lowest score and average the rest?
Use =(SUM(B2:F2)-MIN(B2:F2))/(COUNT(B2:F2)-1). It removes one lowest score, even if two scores tie for lowest.
Why does my top N average give #NUM!?
LARGE was asked for a position past the number of numeric values, for example the 3rd largest of two numbers. Text and blank cells do not count. Cap N with MIN(N,COUNT(range)).
Functions used
AVERAGEMean of numbersLARGEk-th largestSMALLk-th smallestSEQUENCENumbered list, spillsMINSmallest numberCOUNTCounts numbersIFERRORFallback when a formula errorsAVERAGEIFAverages cells that matchSUMAdds numbersSORTSorts a range, spillsTAKEFirst or last rows, spills
Related guides
- How to find the top 5 values in Excel
- How to calculate an average in Excel
- Average excluding zeros (and blanks) in Excel
- How to use AVERAGEIF and AVERAGEIFS in Excel
- How to make a gradebook in Excel
- Excel formulas cheat sheet: the 25 everyone should know
Updated