Excel Formula to Average the Top 5 Values in a Range

📅 Sep 27, 2026 📝 Sarah Miller

Manually identifying and averaging your highest-performing data points can be incredibly tedious and prone to human error. When evaluating standard funding sources or departmental revenue streams, analysts often waste valuable time sorting and filtering large spreadsheets.

Fortunately, a dynamic Excel formula grants immediate analytical clarity by automating this calculation, with the stipulation that the dataset must contain at least five numeric entries to prevent formula errors. This method provides reliable, real-time insights for concrete examples like tracking Q3 sales performance or educational scholarship distributions.

Below, we will outline the exact step-by-step formula combining the AVERAGE and LARGE functions to streamline your financial reporting.

Excel Formula to Average the Top 5 Values in a Range

In data analysis, we often need to filter out the noise and focus on top-tier performance. Whether you are calculating the average of a student's best five exam scores, determining the average of your top five sales months, or analyzing the peak performance of web traffic days, focusing on the highest values is a common requirement.

In Microsoft Excel, there is no single "AVERAGE_TOP_N" function. However, by combining two of Excel's most powerful functions-AVERAGE and LARGE-you can easily build a dynamic formula to achieve this. This guide will walk you through the standard formula, show you how to make it dynamic, and explore how to handle common edge cases like duplicate values, empty cells, and ranges with fewer than five entries.

The Core Concept: Understanding LARGE and AVERAGE

To understand how to average the top five values in a range, we first need to understand the individual building blocks of the formula: the AVERAGE function and the LARGE function.

  • The AVERAGE Function: This is one of Excel's most fundamental formulas. It takes a set of numbers and calculates their arithmetic mean. For example, =AVERAGE(10, 20, 30) returns 20.
  • The LARGE Function: This function returns the k-th largest value in a data set. The syntax is =LARGE(array, k). For example, if your range A1:A10 contains the numbers 1 through 10, =LARGE(A1:A10, 1) will return 10 (the largest value), and =LARGE(A1:A10, 2) will return 9 (the second-largest value).

By nesting the LARGE function inside the AVERAGE function, we can extract the top five numbers as a mini-dataset (or array) and immediately calculate their average.

The Standard Formula (Static Array)

The most common and straightforward way to average the top five values in a range (for example, B2:B15) is to use an array constant inside the LARGE function. Here is the formula:

=AVERAGE(LARGE(B2:B15, {1,2,3,4,5}))

How It Works Step-by-Step

To understand why this formula works, let's break down how Excel evaluates it behind the scenes:

  1. The Array Constant: The curly braces {1,2,3,4,5} tell Excel to treat these numbers as an array (a list of values).
  2. Evaluating LARGE: Instead of returning a single number, the LARGE function evaluates the range B2:B15 five times-once for each position specified in our array constant. It finds the 1st, 2nd, 3rd, 4th, and 5th largest numbers in that range.
  3. Creating the Intermediate List: If the top five values in your range are 95, 90, 88, 85, and 80, the LARGE function evaluates to:
    =AVERAGE({95, 90, 88, 85, 80})
  4. Calculating the Average: Finally, the AVERAGE function takes this list of five numbers and calculates their mean, which in this case is 87.6.
Note for Older Excel Versions: If you are using Excel 2019 or older, you may need to enter this formula as a legacy array formula by pressing Ctrl + Shift + Enter instead of just Enter. If done correctly, Excel will wrap the entire formula in curly braces in the formula bar. If you are using Excel 365 or Excel 2021, the modern dynamic array engine handles this automatically with a simple Enter.

Making the Formula Dynamic (Excel 365 & 2021)

While the static array method works perfectly, it is not very flexible. If you suddenly decide you want to average the top 3 or top 10 values instead of the top 5, you have to manually edit the formula and rewrite the array constant (e.g., changing {1,2,3,4,5} to {1,2,3}).

In modern versions of Excel, you can use the SEQUENCE function to make this number dynamic. Let's say you write the number of values you want to average (e.g., 5) in cell D2. You can write the formula like this:

=AVERAGE(LARGE(B2:B15, SEQUENCE(D2)))

The SEQUENCE(D2) function generates an array of numbers from 1 to the value in D2. If D2 contains 5, it generates {1; 2; 3; 4; 5}. This allows you to change the "N" in your "Average Top N" calculation instantly by simply typing a new number in cell D2.

The Retro-Compatible Dynamic Workaround

If you are working in an older version of Excel that does not support the SEQUENCE function, you can achieve a similar dynamic result using a combination of the ROW and INDIRECT functions:

=AVERAGE(LARGE(B2:B15, ROW(INDIRECT("1:"&D2))))

Remember to press Ctrl + Shift + Enter when entering this in older Excel versions.

Handling Edge Cases and Errors

In real-world spreadsheets, data is rarely perfect. Let's look at how to handle common data anomalies that can break your formula.

1. What if there are fewer than 5 values in the range?

If your range B2:B15 only contains three numbers, the LARGE function will attempt to find the 4th and 5th largest values, fail, and return a #NUM! error. This will cause the entire formula to fail.

To prevent this, you can build a safety net using the COUNT function to determine how many numbers are actually in the range, and use the MIN function to ensure you never request more values than exist. Here is the robust formula for Excel 365:

=AVERAGE(LARGE(B2:B15, SEQUENCE(MIN(5, COUNT(B2:B15)))))

In this formula, if there are only 3 numbers in the range, COUNT(B2:B15) returns 3. The MIN(5, 3) evaluates to 3. Thus, SEQUENCE generates {1; 2; 3}, and the formula safely averages those three available numbers without crashing.

2. Handling Duplicate Values (Ties)

It is important to understand how Excel's LARGE function handles duplicates. If your dataset contains the numbers {100, 100, 90, 80, 70, 60}, the top 5 values are evaluated as:

  • 1st largest: 100
  • 2nd largest: 100
  • 3rd largest: 90
  • 4th largest: 80
  • 5th largest: 70

Excel does not skip duplicate values; it treats each instance of a duplicate number as a unique entry in the ranking. This is typically the desired behavior in business metrics and grading. If a salesperson lands two separate $100,000 deals, both should count toward their top performances.

A Practical Example Walkthrough

Let's look at a concrete example. Imagine you run a small sales team and want to calculate the average of the top 5 sales figures for the quarter. Here is your dataset:

Salesperson Quarterly Revenue ($)
Alice12,000
Bob15,500
Charlie9,000
Diana22,000
Evan18,000
Fiona14,000
George25,000

To calculate the average of the top 5 sales in this table (which is in range B2:B8), we write:

=AVERAGE(LARGE(B2:B8, {1,2,3,4,5}))

Let's trace the execution:

  1. The five largest values are identified: 25,000 (George), 22,000 (Diana), 18,000 (Evan), 15,500 (Bob), and 14,000 (Fiona).
  2. The values are fed into the average function: =AVERAGE(25000, 22000, 18000, 15500, 14000).
  3. The calculation results in 18,900.

Summary of Formulas

Depending on your version of Excel and your specific dataset needs, choose the formula that best fits your environment:

Use Case Formula Excel Compatibility
Standard (Top 5) =AVERAGE(LARGE(Range, {1,2,3,4,5})) All Versions (CSE required in 2019 and older)
Dynamic Top N (Cell reference) =AVERAGE(LARGE(Range, SEQUENCE(N_Cell))) Excel 365 / Excel 2021 / Excel Web
Dynamic Top N (Older Excel) =AVERAGE(LARGE(Range, ROW(INDIRECT("1:"&N_Cell)))) All Versions (requires Ctrl+Shift+Enter)
Error-Proof (Handles fewer than N values) =AVERAGE(LARGE(Range, SEQUENCE(MIN(N, COUNT(Range))))) Excel 365 / Excel 2021

By mastering these combinations of AVERAGE, LARGE, and SEQUENCE, you can build clean, robust, and highly dynamic models in Excel to track top performance over any range of data.

Disclaimer:
The documents and templates provided on this page are for informational and illustrative purposes only. They do not constitute professional, legal, or financial advice, and should not be relied upon as such. Because individual circumstances and regulatory requirements vary, these materials may not be suitable for your specific needs. We recommend consulting with a qualified professional before adapting or using any of these examples for official or commercial purposes.