ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Count with multiple column criteria (https://www.excelbanter.com/excel-discussion-misc-queries/172910-count-multiple-column-criteria.html)

Joe M.

Count with multiple column criteria
 
I am trying to count the occurance of criteria in more than one column. A
simple example:
A B
1 Red Y
2 Red N
3 Red Y
4 Red N
5 Red N
6 Green Y
7 Green N

I would like to count the number of times column A ="Red" and the associated
cell in column B="Y". The result should be 2.

Thanks,
Joe M.

Tim879

Count with multiple column criteria
 
Try this (assuming your spreadsheet is set up as noted below)
=SUMPRODUCT(($A$1:$A$7="Red")*($B$1:$B$7="Y"))



On Jan 14, 11:13 am, Joe M. wrote:
I am trying to count the occurance of criteria in more than one column. A
simple example:
A B
1 Red Y
2 Red N
3 Red Y
4 Red N
5 Red N
6 Green Y
7 Green N

I would like to count the number of times column A ="Red" and the associated
cell in column B="Y". The result should be 2.

Thanks,
Joe M.



Teethless mama

Count with multiple column criteria
 
=SUMPRODUCT(--(A1:A100="Red"),--(B1:B100="Y"))


"Joe M." wrote:

I am trying to count the occurance of criteria in more than one column. A
simple example:
A B
1 Red Y
2 Red N
3 Red Y
4 Red N
5 Red N
6 Green Y
7 Green N

I would like to count the number of times column A ="Red" and the associated
cell in column B="Y". The result should be 2.

Thanks,
Joe M.



All times are GMT +1. The time now is 08:24 PM.

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