Can I take 2 columns of matching data to generate a matrix

fletcherj63

New Member
Joined
Sep 8, 2024
Messages
2
Office Version
  1. 365
Platform
  1. Windows
I'm analysing DNA matches and want to use a program that will cluster my matches. The program will accept an excel sheet with the data organised as shown on the right.
1725775571261.png

I can easily generate a table as shown on the left, where A matches B, C and D; B matches A and D; and C matches A. Is there anyway to generate the table on the right from the table on the left?
Thanks for any help.
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
Welcome to the Forum!

Here's one way:

ABCDEFGHI
1Match 1Match 2
2ABABCD
3ACA 111
4ADB11
5BAC1
6BDD11
7CA
8
Sheet1
Cell Formulas
RangeFormula
E2:H2E2=TRANSPOSE(D3#)
D3:D6D3=SORT(UNIQUE(TOCOL(A2:B7)))
E3:H6E3=IF(COUNTIFS(A2:A7,D3#,B2:B7,E2#)+COUNTIFS(B2:B7,D3#,A2:A7,E2#),1,"")
Dynamic array formulas.
 
Upvote 0
Solution
Welcome to the Forum!

Here's one way:

ABCDEFGHI
1Match 1Match 2
2ABABCD
3ACA 111
4ADB11
5BAC1
6BDD11
7CA
8
Sheet1
Cell Formulas
RangeFormula
E2:H2E2=TRANSPOSE(D3#)
D3:D6D3=SORT(UNIQUE(TOCOL(A2:B7)))
E3:H6E3=IF(COUNTIFS(A2:A7,D3#,B2:B7,E2#)+COUNTIFS(B2:B7,D3#,A2:A7,E2#),1,"")
Dynamic array formulas.
Thank you very much!!
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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