Sum top N values or top N values with criteria in Excel
This step-by-step tutorial demonstrates how to use the SUMPRODUCT function with the LARGE function to sum the top N values in a range and sum the top N values in a range with criteria in Excel.
How to get the sum of top n values in Excel?
How to get the sum of top n values with criteria in Excel?
How to get the sum of top n values in Excel?
As shown in the screenshot below, to sum the top 3 values and the top 6 values in range B5:B15, you can do the following steps.
Generic Formulas
=SUMPRODUCT(LARGE(data_range,{1,2,...,N}))
Arguments
How to use this formula?
Select a cell, copy or enter the formula below and press the Enter key to get the sum of top 3 values.
=SUMPRODUCT(LARGE(B5:B15,{1,2,3}))
To get the sum of top 6 values, apply the formula below.
=SUMPRODUCT(LARGE(B5:B15,{1,2,3,4,5,6}))
Note: To sum any top n values from a range, please change the {1,2,...N} according to your needs.
Explanation of the formula
=SUMPRODUCT(LARGE(B5:B15,{1,2,3}))
How to get the sum of top n values with criteria in Excel?
The SUMPRODUCT function with the LARGE function can also be applied to get the sum of top n values with criteria in Excel.
Look at the following example, to sum the top 3 amounts of KTE, you can do as follows.
Generic formula
=SUMPRODUCT(LARGE(data_range,{1,2,...,N}))
Arguments
How to use this formula?
Select a cell, copy or enter the formula below and press the Enter key to get the result.
=SUMPRODUCT(LARGE((B5:B15=F5)*(D5:D15),{1,2,3}))
Note: To sum any top n values, please change the {1,2,...N} according to your needs.
Explanation of this formula
=SUMPRODUCT(LARGE((B5:B15=F5)*(D5:D15),{1,2,3}))
Related functions
Excel SUMPRODUCT function
The Excel SUMPRODUCT function can be used to multiply two or more columns or arrays together, and then get the sum of products.
Excel LARGE function
The Excel LARGE function returns the k-th largest value in a data set.
Related formulas
Sum multiple columns if one criterion is met
This tutorial will guide you how to sum values in multiple columns based on the same criterion in Excel.
Sum the last N columns
To sum values in the last n columns, normally you may need to calculate the sum of each column and then add up the results to get the final sum. This tutorial provides a formula based on the INDEX function to help you easily get it done.
Sum values based on column or both column and row
This tutorial provides different formulas based on the SUMPRODUCT function to help you sum values based on a column header, and sum values based on both column and row criteria.
Sum values in last N days based on criteria
To sum values in last N days based on specific criteria in Excel, you can apply a formula based on the SUMIF and TODAY function.
The Best Office Productivity Tools
Kutools for Excel - Helps You To Stand Out From Crowd
Kutools for Excel Boasts Over 300 Features, Ensuring That What You Need is Just A Click Away...

Office Tab - Enable Tabbed Reading and Editing in Microsoft Office (include Excel)
- One second to switch between dozens of open documents!
- Reduce hundreds of mouse clicks for you every day, say goodbye to mouse hand.
- Increases your productivity by 50% when viewing and editing multiple documents.
- Brings Efficient Tabs to Office (include Excel), Just Like Chrome, Edge and Firefox.
