Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default averaging values according to (very) complex conditions

Please help! There must be a way to make excel do this:

I'm trying to compute a formula to average values only if they mee
certain criteria.
I am working on outputs generated by Superlab Pro. The data are from a
experiment where trials are randomised.

I need Excel to average all values from, say column A providing tha
they correspond to condition x in column B (so average all the value
which are in a row that contains the term x in column B) , AN
condition y in column C AND condition z in column D.

The key problem is that I can't know in advance which rows will contai
the term x, y or z, so I wonder if there is a way to specify "any o
the rows which contain a specific term" or something similar....

I would be extrememly grateful for any advice. This would make my lif
so much easier.

Thanks,
Lior

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default averaging values according to (very) complex conditions

=SUMPRODUCT((A1:A100)*(B1:B100="myValue"))/COUNTIF(B1:B100,"myValue")

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"liory " wrote in message
...
Please help! There must be a way to make excel do this:

I'm trying to compute a formula to average values only if they meet
certain criteria.
I am working on outputs generated by Superlab Pro. The data are from an
experiment where trials are randomised.

I need Excel to average all values from, say column A providing that
they correspond to condition x in column B (so average all the values
which are in a row that contains the term x in column B) , AND
condition y in column C AND condition z in column D.

The key problem is that I can't know in advance which rows will contain
the term x, y or z, so I wonder if there is a way to specify "any of
the rows which contain a specific term" or something similar....

I would be extrememly grateful for any advice. This would make my life
so much easier.

Thanks,
Liory


---
Message posted from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default averaging values according to (very) complex conditions

For only one condition, Faster would be:

=Sumif(B1:B100,"myValue",A1:A100)/COUNTIF(B1:B100,"myValue")

--
Regards,
Tom Ogilvy

"liory " wrote in message
...
Please help! There must be a way to make excel do this:

I'm trying to compute a formula to average values only if they meet
certain criteria.
I am working on outputs generated by Superlab Pro. The data are from an
experiment where trials are randomised.

I need Excel to average all values from, say column A providing that
they correspond to condition x in column B (so average all the values
which are in a row that contains the term x in column B) , AND
condition y in column C AND condition z in column D.

The key problem is that I can't know in advance which rows will contain
the term x, y or z, so I wonder if there is a way to specify "any of
the rows which contain a specific term" or something similar....

I would be extrememly grateful for any advice. This would make my life
so much easier.

Thanks,
Liory


---
Message posted from http://www.ExcelForum.com/



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 136
Default averaging values according to (very) complex conditions

Try the array formula:

=SUMPRODUCT(A1:A10,((B1:B10="x")*(C1:C10="y")*(D1: D10="z")))/SUM((B1:B10="x")*(C1:C10="y")*(D1:D10="z"))

enter with control+shift+enter to add braces around the whole.


liory < wrote:
Please help! There must be a way to make excel do this:

I'm trying to compute a formula to average values only if they meet
certain criteria.
I am working on outputs generated by Superlab Pro. The data are from an
experiment where trials are randomised.

I need Excel to average all values from, say column A providing that
they correspond to condition x in column B (so average all the values
which are in a row that contains the term x in column B) , AND
condition y in column C AND condition z in column D.

The key problem is that I can't know in advance which rows will contain
the term x, y or z, so I wonder if there is a way to specify "any of
the rows which contain a specific term" or something similar....

I would be extrememly grateful for any advice. This would make my life
so much easier.

Thanks,
Liory


---
Message posted from http://www.ExcelForum.com/

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default averaging values according to (very) complex conditions

JWolf's formula works.
Many many thanks!

--
Message posted from http://www.ExcelForum.com

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
complex color fill conditions- if statements or complex formula? lilly8008 Excel Discussion (Misc queries) 1 December 18th 09 04:57 AM
complex averaging belvy123 Excel Discussion (Misc queries) 0 February 26th 07 09:06 PM
More Complex averaging belvy123 Excel Discussion (Misc queries) 2 February 21st 07 09:40 PM
complex averaging bj Excel Discussion (Misc queries) 0 February 21st 07 02:25 PM
complex averaging Tom Ogilvy Excel Discussion (Misc queries) 0 February 21st 07 02:23 PM


All times are GMT +1. The time now is 12:02 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"