All possible combinations but sperate the combinations into two columns (No VBA)

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?

ABCD
AntAnt,Bear
BearAnt,Cat
CatAnt,Dog
DogAnt,Elephant
ElephantAnt,Frog
FrogAnt,Gorilla
GorillaBear,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
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).

Excel 2010
ABCDE
1Ant12AntBear
2Bear13AntCat
3Cat14AntDog
4Dog15AntElephant
5Elephant16AntFrog
6Frog17AntGorilla
7Gorilla23BearCat
824BearDog
925BearElephant
1026BearFrog
1127BearGorilla
1234CatDog
1335CatElephant
1436CatFrog
1537CatGorilla
1645DogElephant
1746DogFrog
1847DogGorilla
1956ElephantFrog
2057ElephantGorilla
2167FrogGorilla
Sheet4
Cell Formulas
RangeFormula
D1=IF(B1="","",INDEX(A:A,B1))
D2=IF(B2="","",INDEX(A:A,B2))
D3=IF(B3="","",INDEX(A:A,B3))
D4=IF(B4="","",INDEX(A:A,B4))
D5=IF(B5="","",INDEX(A:A,B5))
D6=IF(B6="","",INDEX(A:A,B6))
D7=IF(B7="","",INDEX(A:A,B7))
D8=IF(B8="","",INDEX(A:A,B8))
D9=IF(B9="","",INDEX(A:A,B9))
D10=IF(B10="","",INDEX(A:A,B10))
D11=IF(B11="","",INDEX(A:A,B11))
D12=IF(B12="","",INDEX(A:A,B12))
D13=IF(B13="","",INDEX(A:A,B13))
D14=IF(B14="","",INDEX(A:A,B14))
D15=IF(B15="","",INDEX(A:A,B15))
D16=IF(B16="","",INDEX(A:A,B16))
D17=IF(B17="","",INDEX(A:A,B17))
D18=IF(B18="","",INDEX(A:A,B18))
D19=IF(B19="","",INDEX(A:A,B19))
D20=IF(B20="","",INDEX(A:A,B20))
D21=IF(B21="","",INDEX(A:A,B21))
E1=IF(B1="","",INDEX(A:A,C1))
E2=IF(B2="","",INDEX(A:A,C2))
E3=IF(B3="","",INDEX(A:A,C3))
E4=IF(B4="","",INDEX(A:A,C4))
E5=IF(B5="","",INDEX(A:A,C5))
E6=IF(B6="","",INDEX(A:A,C6))
E7=IF(B7="","",INDEX(A:A,C7))
E8=IF(B8="","",INDEX(A:A,C8))
E9=IF(B9="","",INDEX(A:A,C9))
E10=IF(B10="","",INDEX(A:A,C10))
E11=IF(B11="","",INDEX(A:A,C11))
E12=IF(B12="","",INDEX(A:A,C12))
E13=IF(B13="","",INDEX(A:A,C13))
E14=IF(B14="","",INDEX(A:A,C14))
E15=IF(B15="","",INDEX(A:A,C15))
E16=IF(B16="","",INDEX(A:A,C16))
E17=IF(B17="","",INDEX(A:A,C17))
E18=IF(B18="","",INDEX(A:A,C18))
E19=IF(B19="","",INDEX(A:A,C19))
E20=IF(B20="","",INDEX(A:A,C20))
E21=IF(B21="","",INDEX(A:A,C21))
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,246
Members
452,623
Latest member
cliftonhandyman

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