How to combine cells in a simple combination (combinatorics) fashion

Acomuna

New Member
Joined
Jan 5, 2018
Messages
2
Hi guys!
I've looked for a way to do this in several foruns and website and found no clue...
Hope someone can help me! :biggrin:

Here is a sample of the data I have:


[TABLE="class: sheet0 gridlines"]
<tbody>[TR]
[TD="class: column0 style0 s row0"]Student1[/TD]
[TD="class: column1 style0 s row0"]Student2[/TD]
[TD="class: column2 style0 s row0"]Student3[/TD]
[TD="class: column3 row0"]Student4[/TD]
[/TR]
[TR="class: row0"]
[TD="class: column0 style0 s"]Nascimento MS[/TD]
[TD="class: column1 style0 s"] Espindola CF[/TD]
[TD="class: column2 style0 s"] do Prado C[/TD]
[TD="class: column3"][/TD]
[/TR]
[TR="class: row1"]
[TD="class: column0 style0 s"]Bhansali S[/TD]
[TD="class: column1 style0 s"]Nascimento MS[/TD]
[TD="class: column2 style0 s"] Dhawan V[/TD]
[TD="class: column3 style0 s"] Amarins MB[/TD]
[/TR]
[TR="class: row2"]
[TD="class: column0 style0 s"]Bozek T[/TD]
[TD="class: column1 style0 s"] Blazekovic A[/TD]
[TD="class: column2"][/TD]
[TD="class: column3"][/TD]
[/TR]
[TR="class: row3"]
[TD="class: column0 style0 s"]Thewjitcharoen Y[/TD]
[TD="class: column1 style0 s"]Nascimento MS[/TD]
[TD="class: column2 style0 s"]do Prado C[/TD]
[TD="class: column3 style0 s"] Nakasatien S[/TD]
[/TR]
[TR="class: row4"]
[TD="class: column0 style0 s"]Jonas MI[/TD]
[TD="class: column1 style0 s"]Bhansali S[/TD]
[TD="class: column2 style0 s"]Amarins MB[/TD]
[TD="class: column3"][/TD]
[/TR]
</tbody>[/TABLE]


I want an arrangement of these cells, outputting pairs that reflect how many times a particular student interacted in these groups.
In other words, it is a simple combination. For each group, there are n!/p!*(n-p)! possibilities of interaction, where "n" is the number of the students in each group (in the sample, ranging from 2 to 4) and "p" equals 2 (pairs of interaction).
Thus, the output would be something like this:



[TABLE="class: sheet0 gridlines"]
<tbody>[TR]
[TD="class: column0 style0 s row0"]Nascimento MS[/TD]
[TD="class: column1 style0 s row0"]Espindola CF[/TD]
[/TR]
[TR="class: row0"]
[TD="class: column0 style0 s"]Nascimento MS[/TD]
[TD="class: column1 style0 s"]do Prado C[/TD]
[/TR]
[TR="class: row1"]
[TD="class: column0 style0 s"]Espindola CF[/TD]
[TD="class: column1 style0 s"]do Prado C[/TD]
[/TR]
[TR]
[TD="class: column0 style0 s row1"]Bhansali S[/TD]
[TD="class: column1 style0 s row1"]Nascimento MS[/TD]
[/TR]
[TR]
[TD="class: column0 style0 s row1"]Bhansali S[/TD]
[TD="class: column1 style0 s row1"]Dhawan V[/TD]
[/TR]
[TR]
[TD="class: column0 style0 s row1"]Bhansali S[/TD]
[TD="class: column1 style0 s row1"]Amarins MB[/TD]
[/TR]
[TR]
[TD="class: column0 style0 s row1"]Nascimento MS[/TD]
[TD="class: column1 style0 s row1"]Dhawan V[/TD]
[/TR]
[TR]
[TD="class: column0 style0 s row1"]Nascimento MS[/TD]
[TD="class: column1 style0 s row1"]Amarins MB[/TD]
[/TR]
[TR]
[TD="class: column0 style0 s row1"]Dhawan V[/TD]
[TD="class: column1 style0 s row1"]Amarins MB[/TD]
[/TR]
[TR]
[TD="class: column0 style0 s row1"]Bozek T[/TD]
[TD="class: column1 style0 s row1"]Blazekovic A[/TD]
[/TR]
[TR]
[TD="class: column0 style0 s row1"]Thewjitcharoen Y[/TD]
[TD="class: column1 style0 s row1"]Nascimento MS[/TD]
[/TR]
[TR]
[TD="class: column0 style0 s row1"]Thewjitcharoen Y[/TD]
[TD="class: column1 style0 s row1"]do Prado C[/TD]
[/TR]
[TR]
[TD="class: column0 style0 s row1"]Thewjitcharoen Y[/TD]
[TD="class: column1 style0 s row1"]Nakasatien S[/TD]
[/TR]
[TR]
[TD="class: column0 style0 s row1"]Nascimento MS[/TD]
[TD="class: column1 style0 s row1"]do Prado C[/TD]
[/TR]
[TR]
[TD="class: column0 style0 s row1"]Nascimento MS[/TD]
[TD="class: column1 style0 s row1"]Nakasatien S[/TD]
[/TR]
[TR]
[TD="class: column0 style0 s row1"]do Prado C[/TD]
[TD="class: column1 style0 s row1"]Nakasatien S[/TD]
[/TR]
</tbody>[/TABLE]
<table class="wysiwyg_dashes wysiwyg_cms_table_sheet0 wysiwyg_cms_table_gridlines" verdana,="" arial,="" tahoma,="" calibri,="" geneva,="" sans-serif;"="" width=""><tbody></tbody></table>...and so on...


It is my first post, but I hope I made it clear enough. :rolleyes:
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
Would you please add the cross posted hyperlink locations to this thread
 
Upvote 0
Hi, mole999!
I meant that I searched for it everywhere, but I haven't asked this question anywhere. So it was not cross posted.
Thanks!
 
Upvote 0

Forum statistics

Threads
1,223,728
Messages
6,174,150
Members
452,548
Latest member
Enice Anaelle

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