Wednesday, March 24, 2010

Sum Top 5 numbers in the List:

Use the Excel SUM function and LARGE functions together, to add the largest numbers in the list.
If a few numbers are to be summed, e.g. top 3, you can type the numbers into the formula. For example:
=SUM(LARGE(A1:A7,{1,2,3}))
The result is 70+60+50 = 180
Note: The second 50 is not included in the result, even though it is tied for 3rd place.
If many top numbers are to be summed you can include the INDIRECT function in the formula with the Excel SUM function. In the INDIRECT function, use row numbers that represent the numbers you want to include. In this example, rows 1:10 are used, so the top 10 numbers in the referenced range will be summed.
1. Type the formula:
=SUM(LARGE(A1:A50,ROW(INDIRECT("1:10"))))
2. This is an array formula, and must be array-entered. To do this, hold the Ctrl and Shift keys, and press Enter
If a variable number of top numbers are to be summed you can include the INDIRECT function in the formula with the Excel SUM function, as shown above, and refer to a cell that holds the variable..
1. In cell C1, type the number of top cells, e.g. 10
2. Type the formula:
=SUM(LARGE(A1:A7,ROW(INDIRECT("1:"&C1))))
3. This is an array formula, and must be array-entered. To do this, hold the Ctrl and Shift keys, and press Enter

No comments: