Thread: Counting pairs
View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Harlan Grove[_2_] Harlan Grove[_2_] is offline
external usenet poster
 
Posts: 1,231
Default Counting pairs

"Piotrek" wrote...
....
But that's not exactly what I look for.
Your function for, e.g. Aaa, Xxx, Aaa, Xxx, Aaa, Yyy, Bbb, Xxx shows "3"
although it should give "2", because we have just 2 pairs of Aaa and Xxx.


=SUMPRODUCT(EXACT(A1:A7,"Aaa")*EXACT(A2:A8,"Xxx"))

assuming you want case-sensitive string comparisons.