how to COUNTIF with more than one

D

David V

forgive my lack of knowledge on computers, but i made a
list of people with ages, gender, religion, interest,
and so on.
this is how i inserted the info:
person gender religion age
1 m cath 55
2 m cath 44
3 f cath 68
4 m prot 89
5 f budd 45
6 f budd 60
7 f cath 49
i learnt that to count all males, i use countif 1:7, "M".
now is there a way to count all the people between the age
of 50 to 55? i know how to count all people under 55 using
<55, but how to do it in a selective range, like 50><55?
or what multipe tasks can i put? i first tried countif,
1:7, "50,51,52,53,54,55" or "50:55" without success.

thank you in advance, cheers.
(it is a list of 400+ people, me too i wished it was only
7 person, easier to count...)

thank you in advance for your help. cheers.
 
D

Dan E

=COUNTIF(D1:D7,">=50") - COUNTIF(D1:D7,">55")

Counts all people 50 and above, subracts all people above 55
giving you all the people 50 to 55

Dan E
 
J

jr

I think using the following is more preferable because it
can be used to glean numbers of people that criteria on
multiple variables.
Assume gender, religion and age are in A1:A9, B1:B9,
C1:C9, respectively. This formula will count the number
of people that match ALL the criteria. In your example,
one person matches cath male between 50 and 60. Namely,
person 1.

=SUMPRODUCT(((A1:A9)="m")*((B1:B9)="cath")*((C1:C9>50))*
((C1:C9<60)))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top