andrew_milonavic
Board Regular
- Joined
- Nov 16, 2016
- Messages
- 98
Hi,
Awhile ago @wideboydixon helped me and built a formula to combine all possible combinations without duplicates or reverse order duplicates.
Previous thread: https://www.mrexcel.com/forum/excel...-single-column-without-vba-2.html#post4750264
Is it possible to separate the combinations into two columns, D and E instead of just D?
<thead>
</thead><tbody>
[TD="align: center"]1[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]2[/TD]
[TD="align: center"]2[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]3[/TD]
[TD="align: center"]3[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]4[/TD]
[TD="align: center"]4[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]5[/TD]
[TD="align: center"]5[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]6[/TD]
[TD="align: center"]6[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]7[/TD]
[TD="align: center"]7[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]3[/TD]
[TD="align: center"]8[/TD]
[TD="align: right"][/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]4[/TD]
[TD="align: center"]9[/TD]
[TD="align: right"][/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]5[/TD]
[TD="align: center"]10[/TD]
[TD="align: right"][/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]6[/TD]
[TD="align: center"]11[/TD]
[TD="align: right"][/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]7[/TD]
[TD="align: center"]12[/TD]
[TD="align: right"][/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]4[/TD]
[TD="align: center"]13[/TD]
[TD="align: right"][/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]5[/TD]
[TD="align: center"]14[/TD]
[TD="align: right"][/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]6[/TD]
[TD="align: center"]15[/TD]
[TD="align: right"][/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]7[/TD]
[TD="align: center"]16[/TD]
[TD="align: right"][/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]5[/TD]
[TD="align: center"]17[/TD]
[TD="align: right"][/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]6[/TD]
[TD="align: center"]18[/TD]
[TD="align: right"][/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]7[/TD]
[TD="align: center"]19[/TD]
[TD="align: right"][/TD]
[TD="align: right"]5[/TD]
[TD="align: right"]6[/TD]
[TD="align: center"]20[/TD]
[TD="align: right"][/TD]
[TD="align: right"]5[/TD]
[TD="align: right"]7[/TD]
[TD="align: center"]21[/TD]
[TD="align: right"][/TD]
[TD="align: right"]6[/TD]
[TD="align: right"]7[/TD]
</tbody>
<thead>
[TH="width: 10px"]Cell[/TH]
[TH="align: left"]Formula[/TH]
</thead><tbody>
[TH="width: 10px, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]B1[/TH]
[TD="align: left"]=IF( COUNTA(A:A)>1,1,"" )[/TD]
[TH="width: 10px, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]C1[/TH]
[TD="align: left"]=IF( COUNTA(A:A)>1,2,"" )[/TD]
[TH="width: 10px, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]D1[/TH]
[TD="align: left"]=IF( B1="","",INDEX(A:A,B1)&","&INDEX(A:A,C1) )[/TD]
[TH="width: 10px, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]B2[/TH]
[TD="align: left"]=IF( ROW()>COUNTA(A:A)*(COUNTA(A:A)-1)/2,"",IF(C1=COUNTA(A:A),B1+1,B1) )[/TD]
[TH="width: 10px, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]C2[/TH]
[TD="align: left"]=IF( ROW()>COUNTA(A:A)*(COUNTA(A:A)-1)/2,"",IF(C1=COUNTA(A:A),B2+1,C1+1) )
[/TD]
</tbody>
Thanks
Andrew
Awhile ago @wideboydixon helped me and built a formula to combine all possible combinations without duplicates or reverse order duplicates.
Previous thread: https://www.mrexcel.com/forum/excel...-single-column-without-vba-2.html#post4750264
Is it possible to separate the combinations into two columns, D and E instead of just D?
A | B | C | D | |
---|---|---|---|---|
Ant | Ant,Bear | |||
Bear | Ant,Cat | |||
Cat | Ant,Dog | |||
Dog | Ant,Elephant | |||
Elephant | Ant,Frog | |||
Frog | Ant,Gorilla | |||
Gorilla | Bear,Cat | |||
Bear,Dog | ||||
Bear,Elephant | ||||
Bear,Frog | ||||
Bear,Gorilla | ||||
Cat,Dog | ||||
Cat,Elephant | ||||
Cat,Frog | ||||
Cat,Gorilla | ||||
Dog,Elephant | ||||
Dog,Frog | ||||
Dog,Gorilla | ||||
Elephant,Frog | ||||
Elephant,Gorilla | ||||
Frog,Gorilla |
<thead>
</thead><tbody>
[TD="align: center"]1[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]2[/TD]
[TD="align: center"]2[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]3[/TD]
[TD="align: center"]3[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]4[/TD]
[TD="align: center"]4[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]5[/TD]
[TD="align: center"]5[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]6[/TD]
[TD="align: center"]6[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]7[/TD]
[TD="align: center"]7[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]3[/TD]
[TD="align: center"]8[/TD]
[TD="align: right"][/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]4[/TD]
[TD="align: center"]9[/TD]
[TD="align: right"][/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]5[/TD]
[TD="align: center"]10[/TD]
[TD="align: right"][/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]6[/TD]
[TD="align: center"]11[/TD]
[TD="align: right"][/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]7[/TD]
[TD="align: center"]12[/TD]
[TD="align: right"][/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]4[/TD]
[TD="align: center"]13[/TD]
[TD="align: right"][/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]5[/TD]
[TD="align: center"]14[/TD]
[TD="align: right"][/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]6[/TD]
[TD="align: center"]15[/TD]
[TD="align: right"][/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]7[/TD]
[TD="align: center"]16[/TD]
[TD="align: right"][/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]5[/TD]
[TD="align: center"]17[/TD]
[TD="align: right"][/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]6[/TD]
[TD="align: center"]18[/TD]
[TD="align: right"][/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]7[/TD]
[TD="align: center"]19[/TD]
[TD="align: right"][/TD]
[TD="align: right"]5[/TD]
[TD="align: right"]6[/TD]
[TD="align: center"]20[/TD]
[TD="align: right"][/TD]
[TD="align: right"]5[/TD]
[TD="align: right"]7[/TD]
[TD="align: center"]21[/TD]
[TD="align: right"][/TD]
[TD="align: right"]6[/TD]
[TD="align: right"]7[/TD]
</tbody>
<thead>
[TH="width: 10px"]Cell[/TH]
[TH="align: left"]Formula[/TH]
</thead><tbody>
[TH="width: 10px, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]B1[/TH]
[TD="align: left"]=IF( COUNTA(A:A)>1,1,"" )[/TD]
[TH="width: 10px, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]C1[/TH]
[TD="align: left"]=IF( COUNTA(A:A)>1,2,"" )[/TD]
[TH="width: 10px, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]D1[/TH]
[TD="align: left"]=IF( B1="","",INDEX(A:A,B1)&","&INDEX(A:A,C1) )[/TD]
[TH="width: 10px, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]B2[/TH]
[TD="align: left"]=IF( ROW()>COUNTA(A:A)*(COUNTA(A:A)-1)/2,"",IF(C1=COUNTA(A:A),B1+1,B1) )[/TD]
[TH="width: 10px, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]C2[/TH]
[TD="align: left"]=IF( ROW()>COUNTA(A:A)*(COUNTA(A:A)-1)/2,"",IF(C1=COUNTA(A:A),B2+1,C1+1) )
[/TD]
</tbody>
Thanks
Andrew