CountIF ???? for exact pairs

J

Jack

Hi,

I try to find out how to count the number of occurences
of 2 columns. I want to count the number of pairs. Count
IF and only IF Cell A contain NYYankees and cell B
contain DJeter on the same line.
I take A:A and B:B because I have 10000 records. need only
the number of pair:
I tied this but it doesn't work for exact pair on the same
line.
COUNTIF(A:A,"NYYankees")+COUNTIF(B:B,"DJeter")


THanks,

Jack
 
J

JE McGimpsey

one way:

=SUMPRODUCT(--(A1:A1000="NYYankees"),--(B1:B1000="DJeter"))

SUMPRODUCT won't take entire rows, hence the A1:A1000 vs. A:A.

SUMPRODUCT also expects numeric arrays, which is what - coerces the
boolean TRUE/FALSEs to.
 

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

Top