Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365. If you are using an earlier version (Excel 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Excel, click here: Excluding Values from Averaging.

Excluding Values from Averaging

Written by Allen Wyatt (last updated February 21, 2024)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365


7

You've seen it on the Olympics and in other sporting events: The average score for an athlete is determined by throwing out the highest score and the lowest score, and then averaging the rest. You may have a need to do similar types of averages. For instance, you may be a teacher and need to exclude the two lowest assignment scores before calculating an average.

To perform this type of averaging, all you need to remember is that an average is calculated by summing all the values in a range and then dividing that sum by the number of items in that range. The SUM function easily provides the sum, and the COUNT function can be used to find out the number of items in the range. How to exclude the two lowest values in the range? You can use the SMALL function.

Consider the following formula, which assumes you want to find an adjusted average of the range A10:A14:

=(SUM(A10:A14)-SMALL(A10:A14,1)-SMALL(A10:A14,2))/(COUNT(A10:A14)-2)

The SMALL function is used to determine the two lowest values in the range, and these are subtracted from the overall sum of the range. The resulting value is then divided by the COUNT of values in the range. Note, as well, that the COUNT value is decreased by 2 to compensate for the fact you are ignoring the two lowest values.

Another way to calculate the same average is to use an array formula. The following one does the trick:

=AVERAGE(IF(A10:A14>SMALL(A10:A14,2),A10:A14))

Since this is an array formula, you need to enter it by pressing Ctrl+Shift+Enter instead of just pressing Enter. This formula still relies on the use of the SMALL function, but it also uses the actual AVERAGE function to return a result. Since this is an array formula, it examines each of the values in the array (the range) and only considers them for use in the average if they are larger than the second smallest value in the array.

While the array formula is shorter than the longer regular formula, there is one caveat to keep in mind: The array formula will produce an undesired result if there is a two-way "tie" in the second-lowest value in the range, or a three-way tie in the lowest value. For instance, if the values being averaged are 3, 2, 10, 3, and 7, then the array formula will produce an average of 8.5. Why? Because only the values 10 and 7 are above the second-lowest value, and the average of those two is 8.5. If you use the longer formula, first presented above, then the average returned is 6.666667, which is the average of 10, 3, and 7.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (10697) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365. You can find a version of this tip for the older menu interface of Excel here: Excluding Values from Averaging.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Backing Up Quick Access Toolbars

The Quick Access Toolbar is a place where you can easily put your customizations. If you want to back up that toolbar ...

Discover More

Dealing with Small Time Values

It is no secret that you can store time values in an Excel worksheet. But do you really know how small of a time value ...

Discover More

Rounding Up to the Next Half

When processing data it is not unusual to need to round that data in some way. For instance, you may need to round a ...

Discover More

Save Time and Supercharge Excel! Automate virtually any routine task and save yourself hours, days, maybe even weeks. Then, learn how to make Excel do things you thought were simply impossible! Mastering advanced Excel macros has never been easier. Check out Excel 2010 VBA and Macros today!

More ExcelTips (ribbon)

An Average that Excludes Zero Values

Excel allows you to use functions and formulas to analyze your data. One way you can analyze your data is to use the ...

Discover More

Averaging a Non-Contiguous Range

Figuring out how to average data that is in a contiguous range of cells is easy. When the data is spread over a group of ...

Discover More

Determining a Simple Moving Average

A moving average can be a great way to analyze a series of data points that you've collected over time. Setting up a ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is 2 + 2?

2024-02-22 03:43:35

Mike J

@Kiwerry

Oops! No, there isn't. I did read it but it obviously didn't really register properly - so my error.

Mind you, I still think it's strange that the tip should even offer, indeed end with, a solution and then explain that it doesn't work. Especially, as the tip states "Another way to calculate the same average is to use an array formula. The following one does the trick:"


2024-02-21 14:31:48

Kiwerry

@Mike J: Is there any difference between your comment and the caveat in the last paragraph of the tip?


2024-02-21 05:52:21

Mike J

I don't think the second formula in this tip works as intended.

Consider the 'athlete' had scores of 10,9,5,5,3.

The first formula correctly drops two lowest scores, and returns 8

The second formula drops all the scores equal to or less than the second lowest, and returns 9.5


2020-06-01 11:57:29

Peter Atherton

Dimitris
You might be better with two functions one to calculate the average and call the sum function.
Function sumNLarge(ByVal ref, n)
Dim i As Long, counter As Long
counter = ref.Count
For i = 1 To n + 1
sumNLarge = sumNLarge + WorksheetFunction.Large(ref, i)
Next i
End Function

Function nLARGEMEAN2(ByVal ref, n)
Dim counter As Long
counter = ref.Count - n + 1
nLARGEMEAN2 = sumNLarge(ref, n) / counter
End Function

Regarding excluding the top and bottom values in Allen's post better is:
=(SUM(A1:A14)-(SUM(MIN(A1:A14)+MAX(A1:A14))))/(COUNT(A1:A14)-2)


2020-06-01 09:45:56

Peter Atherton

Dimitris
Try this
=(SUM(A1:A20)-SUM(SMALL(A1:A20,{1,2,3,4,5,6,7,8,9})))/(COUNT(A1:A20)-9)

This UDF is easier to enter:
Function nLargeSUM(ByVal ref, n As Long)
Dim tmp As Double, i As Long, counter
counter = ref.Count - n
nLargeSUM = WorksheetFunction.Sum(ref)
For i = 1 To n
tmp = tmp + WorksheetFunction.Small(ref, i)
Next
nLargeSUM = (nLargeSUM - tmp) / counter
End Function

Just enter the range and the number to exclude e.g =nLARGESUM(A1:A20,9)


2020-06-01 09:38:49

Peter Atherton

Dimitris
Try this
=(SUM(A1:A20)-SUM(SMALL(A1:A20,{1,2,3,4,5,6,7,8,9})))/(COUNT(A1:A20)-9)

This UDF is easier to enter:
Function nLargeSUM(ByVal ref, n As Long)
Dim tmp As Double, i As Long, counter
counter = ref.Count - n
nLargeSUM = WorksheetFunction.Sum(ref)
For i = 1 To n
tmp = tmp + WorksheetFunction.Small(ref, i)
Next
nLargeSUM = (nLargeSUM - tmp) / counter
End Function

Just enter the range and the number to exclude e.g =nLARGESUM(A1:A20,9)


2020-05-31 02:35:42

Dimitris

In column A I have the numbers 1-2-3-4-5-6-7-8-9-10-11-12-13-14-15-16-17-18-19-20

if i want to exclude the 9 lowest values ( 1,2,3,4,5,6,7,8,9) what formula solve my problem;
Ih the formula =(SUM(A1:A20)-SMALL(A1:A20,1)-SMALL(A1:A20,2))/(COUNT(A1:A20)-2)
what i must shange;


This Site

Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.