Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 18
Default Setting multiple conditions to return a figure from multiple cells

Hi,
A B
1 Male
2 Male 21/06/71
3 Female 08/11/68 #
4 Male 11/04/70
5 Female
6 Female 19/10/69 #

I want to count the number of females in A with a date against their name in
B and return as a number.
=Countif(A1:A6,"Female") returns 3. How can I tell excel to look at those 3
cells(without knowing their references) and count those with a date in the
adjacent cell ie 2?

Thank you

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 793
Default Setting multiple conditions to return a figure from multiple cells

In C3 enter the formula (after changing 100 to your last row)
=SUMPRODUCT(--(A1:A100="Female"),--(B1:B1000))
or
=SUMPRODUCT(--(A1:A100=A3),--(B1:B1000))

If you want to copy this down to other cells then change A to $A
"Sapper" wrote:

Hi,
A B
1 Male
2 Male 21/06/71
3 Female 08/11/68 #
4 Male 11/04/70
5 Female
6 Female 19/10/69 #

I want to count the number of females in A with a date against their name in
B and return as a number.
=Countif(A1:A6,"Female") returns 3. How can I tell excel to look at those 3
cells(without knowing their references) and count those with a date in the
adjacent cell ie 2?

Thank you

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 18
Default Setting multiple conditions to return a figure from multiple cells

Hi sheelo

Thanks for help. Using your first example I get an error message, using the
second I get a "value" message.
What is the significance of the dashes(--) in the formula?
What is the significance of using A3 instead of "Female" in the second
formula?
I clearly have a lot to learn but my books dont go deep enough into subject.

Sapper

"Sapper" wrote: my

Hi,
A B
1 Male
2 Male 21/06/71
3 Female 08/11/68 #
4 Male 11/04/70
5 Female
6 Female 19/10/69 #

I want to count the number of females in A with a date against their name in
B and return as a number.
=Countif(A1:A6,"Female") returns 3. How can I tell excel to look at those 3
cells(without knowing their references) and count those with a date in the
adjacent cell ie 2?

Thank you

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 793
Default Setting multiple conditions to return a figure from multiple c

Download and see the file...
http://wikisend.com/download/583754/Sample.xls

With your data A1:A100="Female" gives you
{False,False,True,False,False,True}

-- converts the logival values to 1 or 0
--(A1:A100="Female") becomes
{0,0,1,0,0,1}

When you use A3 instead of "Female" the formula can give you flexibility of
copying the formula to other rows... Of course you will have to change A1:A6
to $A1:$A6 to refer to the same range in all rows

=SUMPRODUCT(--(A1:A100="Female"),--(B1:B1000))

"Sapper" wrote:

Hi sheelo

Thanks for help. Using your first example I get an error message, using the
second I get a "value" message.
What is the significance of the dashes(--) in the formula?
What is the significance of using A3 instead of "Female" in the second
formula?
I clearly have a lot to learn but my books dont go deep enough into subject.

Sapper

"Sapper" wrote: my

Hi,
A B
1 Male
2 Male 21/06/71
3 Female 08/11/68 #
4 Male 11/04/70
5 Female
6 Female 19/10/69 #

I want to count the number of females in A with a date against their name in
B and return as a number.
=Countif(A1:A6,"Female") returns 3. How can I tell excel to look at those 3
cells(without knowing their references) and count those with a date in the
adjacent cell ie 2?

Thank you

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 18
Default Setting multiple conditions to return a figure from multiple c


Hi Sheeloo

I downloaded the sample, thank you.
I coudn't get the formula to work until I entered the date as text and then
it worked.
Many thanks for help
Sapper

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
setting multiple conditions in one cell jcrain Excel Worksheet Functions 2 July 24th 08 09:10 PM
return a result from multiple conditions. Christy Excel Worksheet Functions 4 July 9th 07 09:26 PM
How do I return a value based on multiple possible conditions? nevermore627 Excel Worksheet Functions 4 July 21st 06 01:14 AM
Multiple conditions and multiple return values Minerva Excel Worksheet Functions 3 February 16th 06 06:57 AM
Combining Text from multiple cells under multiple conditions KNS Excel Worksheet Functions 2 June 15th 05 11:00 PM


All times are GMT +1. The time now is 07:29 AM.

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"