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: Adding Up Tops and Bottoms.

Adding Up Tops and Bottoms

Written by Allen Wyatt (last updated October 6, 2021)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365


4

As you are collecting data for your Excel project, you may have a need to add up the top N number of values in a range or the bottom N number of values. For instance, you may be keeping track of golfing scores and need to add up only the top three scores or the bottom three scores out of a series of scores.

As with most any Excel problem, there are several ways you can go about implementing a solution. For instance, you could sort the scores so that they are in ascending or descending order. You would then have the top or bottom scores in a set place where you could always sum them.

There is an easier way, however. You can use the LARGE and SMALL functions, which do the job very nicely. For instance, say you have the scores in cells C5 through C25. All you need to do is put the following formula in a cell in order to add up the top three scores:

=LARGE(C5:C25,1)+LARGE(C5:C25,2)+LARGE(C5:C25,3)

The function returns the Nth largest value from the specified range. As shown in the formula, the largest, second largest, and third largest values are returned and added together. You can similarly use the SMALL function to sum the three lowest scores:

=SMALL(C5:C25,1)+SMALL(C5:C25,2)+SMALL(C5:C25,3)

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (12595) 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: Adding Up Tops and Bottoms.

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

Searching for Special Characters

When using the Find and Replace feature of Word, you can search for more than plain text. You can also search for ...

Discover More

Copying Data between Worksheets Using a Macro

Macros can be used for all sorts of data processing needs. One need that is fairly common is the need to copy data from ...

Discover More

Setting Up an Array with Fields

One of the more esoteric ways to display data is with an "array," which is like a miniature inline table. This tip ...

Discover More

Solve Real Business Problems Master business modeling and analysis techniques with Excel and transform data into bottom-line results. This hands-on, scenario-focused guide shows you how to use the latest Excel tools to integrate data from multiple tables. Check out Microsoft Excel 2013 Data Analysis and Business Modeling today!

More ExcelTips (ribbon)

Filling References to Another Workbook

When you create references to cells in other workbooks, Excel, by default, makes the references absolute. This makes it ...

Discover More

Strange Formula Conversions

When you are getting the hang of how to put together formulas in Excel, you might run into a situation where you open a ...

Discover More

Determining a Name for a Week Number

You could use Excel to collect data that is useful in your business. For instance, you might use it to collect ...

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?

2021-10-06 12:49:28

robert

Hey Guys! Do not forget we are talking about Golf Scores here (as the intro suggests), so the top so the top scores are the lowest scores. Just sayin'


2021-10-06 10:46:56

Mike Hodkinson

Now array formulas are available you could always try

=SUM(FILTER(C5:C25,C5:C25>=LARGE(C5:C25,3)))


2018-04-04 10:28:06

Alex B

Using the same range as above and totalling the 3 largest, another option would be to use something like this
=SUMIFS($C$5:$C$25,$C$5:$C$25,">=" &AGGREGATE(14,4,$C$5:$C$25,3))
In this case you could also instead of hard coding the “3” as in 3rd largest, point that at a cell and parameter drive how many of the largest values you wanted to include.
Instead of the 14 use 15 if you want the smallest and reverse the sign to be .<=

Other options:-
- Later versions of excel let you filter on Top or Bottom "n" - combine this with and aggregate visible rows to total the n largest or smallest
- Use a pivot table using its Top & Bottom options

@Allen Gunter
I think you might have the sign the wrong way around in your formula, to get the 3 largest values in the example in the tip, your formula would need to be
= IF(C5>=LARGE($C$5:$C$25,3),C5,"") - this hard coding the 3 as you pointed out you would parameter drive this. The sign is >= not <


2018-03-31 20:36:27

Allen Gunter

I'm always looking for ways to add flexibility to any formulas I create, and the following idea occurred to me for situations where you want to be able to look at the sum of the largest "x" or smallest "y" values where "x" and "y" might change. Add a column to the data with a formula like IF(A4<LARGE($A$4:$A$550,LrgVlu),A4,"") and a similar column with SmlVlu in place of LrgVlu and sum each column. LrgVlu and SmlVlu would be named one cell ranges that could be changed to reflect the number of values you want to add.


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.