Reputation: 93
I have a column for age and a column for gender. How can I get the number of people with ages between 0-18 and with a gender of "male"?
For example, with the following data, the formula should return "1":
Name | Age | Gender |
---|---|---|
Rick | 70 | male |
Morty | 14 | male |
Summer | 17 | female |
Beth | 34 | female |
Jerry | 35 | male |
Upvotes: 0
Views: 5956
Reputation: 7894
Assuming your age data is in column A:A
and gender in column B:B
:
=COUNTIFS(A:A,"<=18",B:B,"M")
(and I hope all age values are >0). Otherwise:
=COUNTIFS(A:A,"<=18",A:A,">=0",B:B,"M")
Upvotes: 2