Cellwise Start free

Excel guide · 5 min read

How to average the top N values in Excel

Quick answerUse =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.

ABCDEFGHI
1StudentQuiz 1Quiz 2Quiz 3Quiz 4Quiz 5Best N3
2Maya Chen7892859260
3Owen Brooks88749581
4Zara Ahmed70Absent65
5Leo Fischer090847988
6Ines Duarte8585857291

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.

=AVERAGE(LARGE(B2:F2,{1,2,3}))

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.

=AVERAGE(LARGE(B2:F2,SEQUENCE($I$1)))

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.

=TAKE(SORT(B2:F2,,-1,TRUE),,3)

Result: spills 1 row × 3 columns

929285

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.

=AVERAGE(LARGE(B4:F4,SEQUENCE(MIN($I$1,COUNT(B4:F4)))))

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.

=AVERAGEIF(B6:F6,">="&LARGE(B6:F6,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).

=AVERAGE(LARGE(B5:F5,SEQUENCE(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

Related guides

Updated