razstec
razstec

Reputation: 93

Formula to count number of people of a certain age range and gender

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

Answers (1)

ttaaoossuu
ttaaoossuu

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

Related Questions