Counting if a unique identifier corresponds to another unique identifier more than once

alekos7

New Member
Joined
Feb 16, 2017
Messages
5
I'm trying to determine how to count the number of times a text value in ID1 matches up with a text value in ID2, but the problem is that the values aren't necessarily unique. See below for some sample data:

COLUMN A (ID1): SLS.123, SLS.123, SLS.123, SLS.234, SLS.123, SLS.123, SLS.299, SLS.123, SLS.299, SLS.333

COLUMN B (ID2): GPS.111, GPS.222, GPS222, GPS.222, GPS.333, GPS.333, GPS.444, GPS.444, GPS.444, GPS.555

These are hypothetical text values and will not be arranged in any specific order. I'm basically trying to see how many matches a given text value from ID1 (i.e., SLS.123) has across unique values from ID2. Another way to think about this is how many times does SLS.123 have a unique relationship with each unique text value in ID2. Please note that ideally, I'd like to avoid counting duplicates. See below:

Example Output:
SLS.123 = 4

Because:
SLS.123 & GPS.111
SLS.123 & GPS.222
SLS.123 & GPS.333
SLS.123 & GPS.444

and
SLS.123 & GPS.222 (2) not counted
SLS.123 & GPS.333 (2) not counted

I've tried all sorts of iterations of COUNTS/COUNTIFS/SUM(IF(FREQUENCE, but nothing seems to work. Any help on this would be greatly appreciated!
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
ID1ID2SLS.123
SLS.123GPS.1114
SLS.123GPS.222
SLS.123GPS.222
SLS.234GPS.222
SLS.123GPS.333
SLS.123GPS.333
SLS.299GPS.444
SLS.123GPS.444
SLS.299GPS.444
SLS.333GPS.555

<tbody>
</tbody>

In D2 control+shift+enter, not just enter:

=SUM(IF(FREQUENCY(IF(1-($B$2:$B$11=""),IF($A$2:$A$11=D$1,MATCH($B$2:$B$11,$B$2:$B$11,0))),ROW($B$2:$B$11)-ROW($B$2)+1),1))
 
Upvote 0

Forum statistics

Threads
1,215,148
Messages
6,123,309
Members
449,095
Latest member
Chestertim

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top