You could maybe try something like:
=SUM(IF(FREQUENCY(MATCH(IF(A$2:A$2010=A2,B$2:B$2010,0),IF(A$2:A$2010=A2,B$2:B$2010,0),0),MATCH(IF(A$2:A$2010=A2,B$2:B$2010,0),IF(A$2:A$2010=A2,B$2:B$2010,0),0))>0,1))-1
in C2 and copy down but it might take a while to calculate.
It's an array formula so needs to be confirmed with ctrl+shift+enter
Bookmarks