Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default average with conditions

Hi everyone. I've a spreadsheet with one column (eg. A1:A100)
containing a range of values (ages) and another column (B1:B100) a
value of either 1 or 2 (representing males vs females). How can a find
the average of the cells A1:A100 that have a value of 1 in column B;
ie. the average age of the males only

Any suggestions? Thanks.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default average with conditions

=average(if(b1:b100)=1,a1:a100))

This is an array formula. Hit ctrl-shift-enter instead of enter. If you do it
correctly, excel will wrap curly brackets {} around your formula. (don't type
them yourself.)

Adjust the range to match--but you can't use the whole column.

vinnie123 wrote:

Hi everyone. I've a spreadsheet with one column (eg. A1:A100)
containing a range of values (ages) and another column (B1:B100) a
value of either 1 or 2 (representing males vs females). How can a find
the average of the cells A1:A100 that have a value of 1 in column B;
ie. the average age of the males only

Any suggestions? Thanks.


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
s s is offline
external usenet poster
 
Posts: 36
Default average with conditions

Hi,
is there anyone who can tell me how to solve the same problem but with 2
conditions.. i want the average of say column F, when 2 conditions are
fullfilled, in column A and C.
I tried
=AVERAGE(IF((A2:A22="X")+(C2:C22="Y"),F2:F22))
with ctrl shift enter, but i cant make it work...

thanks,
S
"Dave Peterson" wrote:

=average(if(b1:b100)=1,a1:a100))

This is an array formula. Hit ctrl-shift-enter instead of enter. If you do it
correctly, excel will wrap curly brackets {} around your formula. (don't type
them yourself.)

Adjust the range to match--but you can't use the whole column.

vinnie123 wrote:

Hi everyone. I've a spreadsheet with one column (eg. A1:A100)
containing a range of values (ages) and another column (B1:B100) a
value of either 1 or 2 (representing males vs females). How can a find
the average of the cells A1:A100 that have a value of 1 in column B;
ie. the average age of the males only

Any suggestions? Thanks.


--

Dave Peterson

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default average with conditions

And you have more responses at your other post.

vinnie123 wrote:

Hi everyone. I've a spreadsheet with one column (eg. A1:A100)
containing a range of values (ages) and another column (B1:B100) a
value of either 1 or 2 (representing males vs females). How can a find
the average of the cells A1:A100 that have a value of 1 in column B;
ie. the average age of the males only

Any suggestions? Thanks.


--

Dave Peterson
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 with Conditions Curtis[_2_] Excel Worksheet Functions 1 May 13th 10 04:34 PM
Average with Conditions Curtis[_2_] Excel Worksheet Functions 3 April 10th 10 03:01 AM
Average with Conditions Curtis[_2_] Excel Worksheet Functions 3 March 18th 10 05:31 PM
AVERAGE with conditions mr_concrete Excel Worksheet Functions 3 February 7th 07 08:23 PM
average on 2 conditions Ted Metro Excel Worksheet Functions 6 January 7th 05 08:23 PM


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