
Tips.Net > ExcelTips Home > Formulas > Excluding Values from Averaging
Summary: Calculating an average of a group of numbers is easy. What if you want to exclude a couple of the numbers from the group you are averaging? Here’s the tools you need to develop a formula that will give you what you want. (This tip works with Microsoft Excel 97, Excel 2000, Excel 2002, Excel 2003, and Excel 2007.)
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.
If you try these formulas and they don't work, you should check to make sure that you have the Analysis ToolPak installed. The SMALL function is a part of that ToolPak.
Tip #2050 applies to Microsoft Excel versions: 97 2000 2002 2003 2007
Got the Time? If you work with either times or dates in Excel, you really need ExcelTips: Times and Dates. Everything you need to know about slicing, dicing, and generally working with times and dates.
No, not that type of date. If you need to do any types of work with calendar dates, Excel has the tools you need. Learn how to use those tools the easy way. (more information...)
Ask an Excel Question
Make a Comment
ExcelTips
Excel 2007 Tips
WordTips
Word 2007 Tips
Vital News Home
ExcelTips FAQ
ExcelTips Premium
Learn Access Now
Beauty Tips
Car Care Tips
Cleaning Tips
College Tips
Cooking Tips
Gardening Tips
Health Tips
Home Improvement
Money Tips
Pet Tips
Tips.Net Home
Advertise on the
ExcelTips Site