Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 174
Default Top 5 Sumif function?

Here's an example

=SUM(LARGE(IF(A1:A10="x",B1:B10),{1,2,3,4,5}))

sums the top 5 values in B1:B10 where A1:A10 ="x"

Note this will only sum 5 values even if there are ties

If you may have less than 5 values where the criteria is met then to sum the
top 5 or all if there are less than 5 then you could try

=IF(COUNTIF(A1:A10,"x"),SUM(LARGE(IF(A1:A10="x",B1 :B10),ROW(INDIRECT("1:"&MIN(5,COUNTIF(A1:A10,"x")) )))),0)

confirmed with CTRL+SHIFT+ENTER



"bestrugger" wrote:

I'm looking to add only the top 5 in a list of n records. Is that possible?
Something to the extent of

=sumifTOP(range, criteria, addrange,top#)

Doable? or something similar

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using the TODAY() function in a SUMIF function JPB Excel Worksheet Functions 4 July 27th 06 04:01 PM
Can I add and IF function to a SUMIF function? adscrim Excel Worksheet Functions 4 January 21st 06 12:32 PM
SUMIF Function Inside SUMPRODUCT Function Abdul Waheed Excel Worksheet Functions 17 September 19th 05 04:24 PM
SumIF function ACDenver Excel Discussion (Misc queries) 2 August 17th 05 09:47 PM
SUMIF function yak10 Excel Worksheet Functions 0 February 12th 05 05:12 PM


All times are GMT +1. The time now is 10:50 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"