Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10
Default excel summing N largest values by condition

Hello there,

I'm struggling with an array formula that will return the SUM of the
Top 20 values in a list that meet a given criteria.

E.g. SUM the Top 20 instances of Dog.


Condition Field Data Field
Dog 5000
Dog 4954
Cat 4221
Dog 3465
Etc.


I can happily return the overall Top 20 using the following array
formula:

{=SUM(LARGE(Data,ROW(INDIRECT("1:20"))))}

However i'm stumped on how to add a condition to the formula.


Hope someone can help...
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 364
Default excel summing N largest values by condition

wrote in message
...
Hello there,

I'm struggling with an array formula that will return the SUM of the
Top 20 values in a list that meet a given criteria.

E.g. SUM the Top 20 instances of Dog.


Condition Field Data Field
Dog 5000
Dog 4954
Cat 4221
Dog 3465
Etc.


I can happily return the overall Top 20 using the following array
formula:

{=SUM(LARGE(Data,ROW(INDIRECT("1:20"))))}

However i'm stumped on how to add a condition to the formula.


Hope someone can help...


Try something like
=SUM(LARGE((A1:A100="dog")*(B1:B100),ROW(1:20)))
array-entered.


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,593
Default excel summing N largest values by condition

=SUM(LARGE(IF(A2:A37="Dog",B2:B37),ROW(INDIRECT("1 :"&MIN(20,COUNTIF(A:A,"Dog"))))))

which is an array formula, it should be committed with Ctrl-Shift-Enter, not
just Enter.
Excel will automatically enclose the formula in braces (curly brackets), do
not try to do this manually.
When editing the formula, it must again be array-entered.

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

wrote in message
...
Hello there,

I'm struggling with an array formula that will return the SUM of the
Top 20 values in a list that meet a given criteria.

E.g. SUM the Top 20 instances of Dog.


Condition Field Data Field
Dog 5000
Dog 4954
Cat 4221
Dog 3465
Etc.


I can happily return the overall Top 20 using the following array
formula:

{=SUM(LARGE(Data,ROW(INDIRECT("1:20"))))}

However i'm stumped on how to add a condition to the formula.


Hope someone can help...



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default excel summing N largest values by condition

Hi Stuart:

If you already have a good method to get the top 20 from a column, then in C1:

=IF(A1="dog",B1,-9999) and copy down. Then get the top 20 from column C
--
Gary''s Student - gsnu2007a


" wrote:

Hello there,

I'm struggling with an array formula that will return the SUM of the
Top 20 values in a list that meet a given criteria.

E.g. SUM the Top 20 instances of Dog.


Condition Field Data Field
Dog 5000
Dog 4954
Cat 4221
Dog 3465
Etc.


I can happily return the overall Top 20 using the following array
formula:

{=SUM(LARGE(Data,ROW(INDIRECT("1:20"))))}

However i'm stumped on how to add a condition to the formula.


Hope someone can help...

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10
Default excel summing N largest values by condition

Thanks Stephen,

This works a treat...

{=SUM(LARGE((A1:A100="Dog")*(B1:B100),ROW(INDIRECT ("1:20"))))}

Unfortunately stumps me an the next permutation which is:

SUM the VALUE data
WHERE condition = Dog
AND
VOLUME is in Top 20


Condition Field Volume Field Value Field
Dog 5000 99.99
Dog 4954 126.98
Cat 4221 44.76


Don't suppose you've any ideas?




On 23 Nov, 12:13, "Stephen" <none wrote:
wrote in message

...





Hello there,


I'm struggling with an array formula that will return the SUM of the
Top 20 values in a list that meet a given criteria.


E.g. SUM the Top 20 instances of Dog.


Condition Field Data Field
Dog 5000
Dog 4954
Cat 4221
Dog 3465
Etc.


I can happily return the overall Top 20 using the following array
formula:


{=SUM(LARGE(Data,ROW(INDIRECT("1:20"))))}


However i'm stumped on how to add a condition to the formula.


Hope someone can help...


Try something like
=SUM(LARGE((A1:A100="dog")*(B1:B100),ROW(1:20)))
array-entered.- Hide quoted text -

- Show quoted text -




  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 751
Default excel summing N largest values by condition

Try the following array formula:

=SUM(IF((A1:A100="A")*(RANK(B1:B100,B1:B100)<5),C1 :C100))

Does this work?
Kostis Vezerides

On Nov 23, 3:23 pm, wrote:
Thanks Stephen,

This works a treat...

{=SUM(LARGE((A1:A100="Dog")*(B1:B100),ROW(INDIRECT ("1:20"))))}

Unfortunately stumps me an the next permutation which is:

SUM the VALUE data
WHERE condition = Dog
AND
VOLUME is in Top 20

Condition Field Volume Field Value Field
Dog 5000 99.99
Dog 4954 126.98
Cat 4221 44.76

Don't suppose you've any ideas?

On 23 Nov, 12:13, "Stephen" <none wrote:



wrote in message


...


Hello there,


I'm struggling with an array formula that will return the SUM of the
Top 20 values in a list that meet a given criteria.


E.g. SUM the Top 20 instances of Dog.


Condition Field Data Field
Dog 5000
Dog 4954
Cat 4221
Dog 3465
Etc.


I can happily return the overall Top 20 using the following array
formula:


{=SUM(LARGE(Data,ROW(INDIRECT("1:20"))))}


However i'm stumped on how to add a condition to the formula.


Hope someone can help...


Try something like
=SUM(LARGE((A1:A100="dog")*(B1:B100),ROW(1:20)))
array-entered.- Hide quoted text -


- Show quoted text -- Hide quoted text -


- Show quoted text -


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
Add largest Values damorrison Excel Discussion (Misc queries) 2 September 2nd 06 04:14 PM
Sum largest numbers based on condition Daniel Bonallack Excel Worksheet Functions 6 August 15th 06 08:23 PM
find largest values, then return corresponding row values. neurotypical Excel Discussion (Misc queries) 7 May 24th 06 10:27 PM
Select Largest 5 in A, AVG values in B Phillycheese5 Excel Worksheet Functions 4 December 19th 05 11:45 PM
Summing an array based on text condition RestlessAde Excel Discussion (Misc queries) 3 April 21st 05 05:44 PM


All times are GMT +1. The time now is 04:41 PM.

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

About Us

"It's about Microsoft Excel"