Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / October 2007

Tip: Looking for answers? Try searching our database.

Count Instances of value in two columns

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
KN - 23 Oct 2007 15:43 GMT
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 - 23 Oct 2007 15:49 GMT
Please refrain from multiposting, you have an answer in you other post

Signature

Regards,

Peo Sjoblom

> Hi,
>
[quoted text clipped - 11 lines]
> Thanks
> KN
Bernard Liengme - 23 Oct 2007 15:58 GMT
To count the number of times YES appears in A1:B1
=COUNTIF(A1:B1,"YES")
If you want to display 1 when both have YES and zero otherwise
=ROUNDDOWN(COUNTIF(A1:B1,"YES")/2,0)

If you want to know how many pairs of YESs appear in A1:B10
=SUMPRODUCT(--(A1:A10="YES"),--(B1:B10="YES"))
best wishes
Signature

Bernard V Liengme
Microsoft Excel MVP
www.stfx.ca/people/bliengme
remove caps from email

> Hi,
>
[quoted text clipped - 11 lines]
> Thanks
> KN
Alexander Wolff - 23 Oct 2007 18:57 GMT
> 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".

C1: =--(A1="YES")*(B1="YES") or
C1: {=--AND(A1:B1="YES")} as a good one if dealing with >2 "YES" columns
Signature

Moin+Gruss Alexander - MVP für MS Excel - www.xxcl.de - mso2000sp3 --7-2


Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.