CountIF ???? for exact pairs

  • Thread starter Thread starter Jack
  • Start date Start date
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
 
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.
 
Back
Top