ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   How do I count 2 columns of data that meet a certain criteria? (https://www.excelbanter.com/excel-discussion-misc-queries/110147-how-do-i-count-2-columns-data-meet-certain-criteria.html)

RonJon

How do I count 2 columns of data that meet a certain criteria?
 
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).

Ron Coderre

How do I count 2 columns of data that meet a certain criteria?
 
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


"RonJon" wrote:

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).


RonJon

How do I count 2 columns of data that meet a certain criteria?
 
That does it. Thanks

"Ron Coderre" wrote:

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


"RonJon" wrote:

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).



All times are GMT +1. The time now is 11:17 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com