Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Ted Metro
 
Posts: n/a
Default average on 2 conditions

suppose cells are a1:b4 have following values

east 5
west 7
north 6
east 3

so you can do an average like =average(if(a1:a4="east",b1:b4)) and that will
equal a value of 4 -- (5+3)/2

What if you wanted to calculate the average of numbers in a1:a4 where it
equaled 2 conditions - either east or west. So that would be 5 -- (5+3+7)/3.

How would the second formula be written to average numbers where either of
two conditions are met?
  #2   Report Post  
Frank Kabel
 
Posts: n/a
Default

Hi
use
=average(if((a1:a4="east")+(A1:A4="west"),b1:b4))

See:
http://www.dicks-blog.com/archives/2...las/trackback/

--
Regards
Frank Kabel
Frankfurt, Germany
"Ted Metro" schrieb im Newsbeitrag
...
suppose cells are a1:b4 have following values

east 5
west 7
north 6
east 3

so you can do an average like =average(if(a1:a4="east",b1:b4)) and that
will
equal a value of 4 -- (5+3)/2

What if you wanted to calculate the average of numbers in a1:a4 where it
equaled 2 conditions - either east or west. So that would be 5 --
(5+3+7)/3.

How would the second formula be written to average numbers where either of
two conditions are met?



  #3   Report Post  
Venky
 
Posts: n/a
Default

Does this formula work in specific versions of Excel. I tried reproducing
this case in Excel 2002. It didnt work. Using
=average(if(a1:a4="east",b1:b4)) gives me the result as 5.25 which is the
average of all the values put together and not 4.

Thanks

Venky

"Frank Kabel" wrote:

Hi
use
=average(if((a1:a4="east")+(A1:A4="west"),b1:b4))

See:
http://www.dicks-blog.com/archives/2...las/trackback/

--
Regards
Frank Kabel
Frankfurt, Germany
"Ted Metro" schrieb im Newsbeitrag
...
suppose cells are a1:b4 have following values

east 5
west 7
north 6
east 3

so you can do an average like =average(if(a1:a4="east",b1:b4)) and that
will
equal a value of 4 -- (5+3)/2

What if you wanted to calculate the average of numbers in a1:a4 where it
equaled 2 conditions - either east or west. So that would be 5 --
(5+3+7)/3.

How would the second formula be written to average numbers where either of
two conditions are met?




  #4   Report Post  
Aladin Akyurek
 
Posts: n/a
Default

You need to confirm such formulas with control+shift+enter instead of
just with enter.

Venky wrote:
Does this formula work in specific versions of Excel. I tried reproducing
this case in Excel 2002. It didnt work. Using
=average(if(a1:a4="east",b1:b4)) gives me the result as 5.25 which is the
average of all the values put together and not 4.

Thanks

Venky

"Frank Kabel" wrote:


Hi
use
=average(if((a1:a4="east")+(A1:A4="west"),b1:b4) )

See:
http://www.dicks-blog.com/archives/2...las/trackback/

--
Regards
Frank Kabel
Frankfurt, Germany
"Ted Metro" schrieb im Newsbeitrag
...

suppose cells are a1:b4 have following values

east 5
west 7
north 6
east 3

so you can do an average like =average(if(a1:a4="east",b1:b4)) and that
will
equal a value of 4 -- (5+3)/2

What if you wanted to calculate the average of numbers in a1:a4 where it
equaled 2 conditions - either east or west. So that would be 5 --
(5+3+7)/3.

How would the second formula be written to average numbers where either of
two conditions are met?




  #5   Report Post  
Venky
 
Posts: n/a
Default

Thanks Aladin, That did work. Could you tell me why do we need to valdiate
using
control+shift+enter and not enter. Just curious to know


"Aladin Akyurek" wrote:

You need to confirm such formulas with control+shift+enter instead of
just with enter.

Venky wrote:
Does this formula work in specific versions of Excel. I tried reproducing
this case in Excel 2002. It didnt work. Using
=average(if(a1:a4="east",b1:b4)) gives me the result as 5.25 which is the
average of all the values put together and not 4.

Thanks

Venky

"Frank Kabel" wrote:


Hi
use
=average(if((a1:a4="east")+(A1:A4="west"),b1:b4) )

See:
http://www.dicks-blog.com/archives/2...las/trackback/

--
Regards
Frank Kabel
Frankfurt, Germany
"Ted Metro" schrieb im Newsbeitrag
...

suppose cells are a1:b4 have following values

east 5
west 7
north 6
east 3

so you can do an average like =average(if(a1:a4="east",b1:b4)) and that
will
equal a value of 4 -- (5+3)/2

What if you wanted to calculate the average of numbers in a1:a4 where it
equaled 2 conditions - either east or west. So that would be 5 --
(5+3+7)/3.

How would the second formula be written to average numbers where either of
two conditions are met?






  #6   Report Post  
Aladin Akyurek
 
Posts: n/a
Default

Control+shift+enter signals Excel that the formula in question should be
treated as an array-formula. The Help file contains material pertaining
to such formulas. Moreover, you might want to consult some of the
write-ups regarding such formulas:

www.emailoffice.com/excel/arrays-bobumlas.html
www.cpearson.com/excel/array.htm


Venky wrote:
Thanks Aladin, That did work. Could you tell me why do we need to valdiate
using
control+shift+enter and not enter. Just curious to know


"Aladin Akyurek" wrote:


You need to confirm such formulas with control+shift+enter instead of
just with enter.

Venky wrote:

Does this formula work in specific versions of Excel. I tried reproducing
this case in Excel 2002. It didnt work. Using
=average(if(a1:a4="east",b1:b4)) gives me the result as 5.25 which is the
average of all the values put together and not 4.

Thanks

Venky

"Frank Kabel" wrote:



Hi
use
=average(if((a1:a4="east")+(A1:A4="west"),b1:b 4))

See:
http://www.dicks-blog.com/archives/2...las/trackback/

--
Regards
Frank Kabel
Frankfurt, Germany
"Ted Metro" schrieb im Newsbeitrag
...


suppose cells are a1:b4 have following values

east 5
west 7
north 6
east 3

so you can do an average like =average(if(a1:a4="east",b1:b4)) and that
will
equal a value of 4 -- (5+3)/2

What if you wanted to calculate the average of numbers in a1:a4 where it
equaled 2 conditions - either east or west. So that would be 5 --
(5+3+7)/3.

How would the second formula be written to average numbers where either of
two conditions are met?



  #7   Report Post  
Venky
 
Posts: n/a
Default

Dear Aladin

Thanks So much for the information. This was more than helpful




"Aladin Akyurek" wrote:

Control+shift+enter signals Excel that the formula in question should be
treated as an array-formula. The Help file contains material pertaining
to such formulas. Moreover, you might want to consult some of the
write-ups regarding such formulas:

www.emailoffice.com/excel/arrays-bobumlas.html
www.cpearson.com/excel/array.htm


Venky wrote:
Thanks Aladin, That did work. Could you tell me why do we need to valdiate
using
control+shift+enter and not enter. Just curious to know


"Aladin Akyurek" wrote:


You need to confirm such formulas with control+shift+enter instead of
just with enter.

Venky wrote:

Does this formula work in specific versions of Excel. I tried reproducing
this case in Excel 2002. It didnt work. Using
=average(if(a1:a4="east",b1:b4)) gives me the result as 5.25 which is the
average of all the values put together and not 4.

Thanks

Venky

"Frank Kabel" wrote:



Hi
use
=average(if((a1:a4="east")+(A1:A4="west"),b1:b 4))

See:
http://www.dicks-blog.com/archives/2...las/trackback/

--
Regards
Frank Kabel
Frankfurt, Germany
"Ted Metro" schrieb im Newsbeitrag
...


suppose cells are a1:b4 have following values

east 5
west 7
north 6
east 3

so you can do an average like =average(if(a1:a4="east",b1:b4)) and that
will
equal a value of 4 -- (5+3)/2

What if you wanted to calculate the average of numbers in a1:a4 where it
equaled 2 conditions - either east or west. So that would be 5 --
(5+3+7)/3.

How would the second formula be written to average numbers where either of
two conditions are met?




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
Average Reggie Excel Worksheet Functions 2 December 29th 04 10:26 PM
Getting a average from a survey rickvin Excel Worksheet Functions 3 December 13th 04 10:11 PM
calculate average hours and minutes llstephens Excel Worksheet Functions 4 November 30th 04 03:47 PM
calculate average hours worked llstephens Excel Worksheet Functions 1 November 24th 04 02:37 PM
average, array and offsets Darin1979 Excel Worksheet Functions 0 November 17th 04 04:21 PM


All times are GMT +1. The time now is 04:31 AM.

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"