SUM Top x Large Values

Jon von der Heyden

MrExcel MVP, Moderator
Joined
Apr 6, 2004
Messages
10,907
Office Version
  1. 365
Platform
  1. Windows
Hi,

I have a table of numbers (sales), and I am able to add up the top say 10 sales like so:

=SUM(LARGE(A:A,{1;2;3;4;5;6;7;8;9;10}))

How would I do the same for say the largest 100 values. I don't want to create an array constant {1;2......;100}. Using RANK doesn't either deliver desired results because some sales are for the same amount so adding top 100 ranking sales will include more than 100 sales (hope that makes sense).

I can achieve with a pivot table to provide a list of top 100 but I am looking for formula solution if possible.

I appreciate any help given. :)

Jon
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
Brilliant solution Barry, as always. :biggrin:

I was unsure about the use of INDIRECT and I seem the get the same result without the INDIRECT. I'm just being curious, why have you chosen INDIRECT?

Many thanks, much appreciated.
Jon
 
Upvote 0
Ah very clever!!! I knew there would be a good reason for it! :biggrin:

One more question if I may please. I thought array formula would not allow for whole columns (A:A), yet this works perfectly. What is the rule around use of whole columns in array formula?
 
Upvote 0
Sum Exactly N Largest.xls
ABCDEFGH
1
2Sum Exactly N Largest
3NNth ValueWith INDIRECTNo INDIRECT
420420102102
525
632
725
817
920
10
11
12
Sheet1


With INDIRECT...

G4:

=SUMPRODUCT(LARGE(A:A,ROW(INDIRECT("1:"&E4))))

Without INDIRECT (almost twice faster)...

F4:

=LARGE(A:A,E4)

H4:

=SUMIF(A:A,">"&F4)+(E4-COUNTIF(A:A,">"&F4))*F4
 
Upvote 0
Nice! Makes good sense, thanks Aladin. :biggrin:

Still curious about use of whole colums though. :confused:

Thanks all for the inputs. Problem is solved!

Jon
 
Upvote 0
I still don't geddit, being thick... :(

Is it not evaluating the entire whole column A:A and sourcing the top 100 values, and as such is working on the whole column?
 
Upvote 0
Ah, now I see, The SUM is only working with the top 100 values retrieved and as such not using the whole column.

Sorry, I geddit now! :) Thanks Rich...
 
Upvote 0

Forum statistics

Threads
1,215,334
Messages
6,124,325
Members
449,154
Latest member
pollardxlsm

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top