ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Count Instances of value in two columns (https://www.excelbanter.com/excel-worksheet-functions/163200-count-instances-value-two-columns.html)

KN

Count Instances of value in two columns
 
Hi,

I am trying to count the occurrences of a word in two columns. For
example if column A has the value "YES" and column B also has the
value "YES" then I want to count that as one instance of meeting the
condition that both columns must be YES in order to count the instance
in a third column. So the value of column C would be "1".

I can easily do this for one column using the COUNTIF function as
follows:

=COUNTIF(App_Inventory!A1:A10, "YES")

Thanks
KN


Peo Sjoblom

Count Instances of value in two columns
 
=SUMPRODUCT(--(A2:A100="Yes"),--(B2:B100="Yes"))


--


Regards,


Peo Sjoblom



"KN" wrote in message
oups.com...
Hi,

I am trying to count the occurrences of a word in two columns. For
example if column A has the value "YES" and column B also has the
value "YES" then I want to count that as one instance of meeting the
condition that both columns must be YES in order to count the instance
in a third column. So the value of column C would be "1".

I can easily do this for one column using the COUNTIF function as
follows:

=COUNTIF(App_Inventory!A1:A10, "YES")

Thanks
KN




BIG D

Count Instances of value in two columns
 
On Oct 23, 9:42 am, KN wrote:
Hi,

I am trying to count the occurrences of a word in two columns. For
example if column A has the value "YES" and column B also has the
value "YES" then I want to count that as one instance of meeting the
condition that both columns must be YES in order to count the instance
in a third column. So the value of column C would be "1".

I can easily do this for one column using the COUNTIF function as
follows:

=COUNTIF(App_Inventory!A1:A10, "YES")

Thanks
KN


TRY THIS IN COLUMN C
=IF(A4="yes",IF(B4="yes",1,0),0)




All times are GMT +1. The time now is 06:20 AM.

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