How do I count 2 columns of data that meet a certain criteria?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have 2 columns of data. The first column has rows with either "b", "bhs",
"g" or "ghs". The second column has rows with age #'s (like 1, 2, 3, 5, 8,
etc). I can't figure out how to count for example the number of "b"'s and
"bhs"'s that are a particular age (say 5).
 
Try this:

With
A1:A30 (contains your codes: b, bhs, g, ghs, etc)
B1:B30 (contains ages: 1, 3, 5, etc)

This formula count the b's and bhs's that are age 5
C1: =SUMPRODUCT((A1:A30={"b","bhs"})*(B1:B30=5))

Is that something you can work with?
***********
Regards,
Ron

XL2002, WinXP
 
That does it. Thanks

Ron Coderre said:
Try this:

With
A1:A30 (contains your codes: b, bhs, g, ghs, etc)
B1:B30 (contains ages: 1, 3, 5, etc)

This formula count the b's and bhs's that are age 5
C1: =SUMPRODUCT((A1:A30={"b","bhs"})*(B1:B30=5))

Is that something you can work with?
***********
Regards,
Ron

XL2002, WinXP
 

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

Back
Top