Exclusive combination for 3 rows

cbprado

New Member
Joined
Oct 26, 2018
Messages
10
Hello,

Looking for a formula to generate all possible UNIQUE combination of the contents of 3 rows. I want to avoid results with the same content in different positions (such as aac, caa, aca should be appear only once, regardless of which)

Row1 Row2 Row3
a a a
b b b
c c c


anyone?
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
Given your 3 row example -- what output would you expect (please provide) from the formula?
 
Upvote 0
is that what you want?

[Table="width:, class:head"]
[tr=bgcolor:#FFFFFF][td=bgcolor:#70AD47]result[/td][/tr]

[tr=bgcolor:#FFFFFF][td=bgcolor:#E2EFDA]a a a[/td][/tr]

[tr=bgcolor:#FFFFFF][td]a a b[/td][/tr]

[tr=bgcolor:#FFFFFF][td=bgcolor:#E2EFDA]a a c[/td][/tr]

[tr=bgcolor:#FFFFFF][td]a b a[/td][/tr]

[tr=bgcolor:#FFFFFF][td=bgcolor:#E2EFDA]a b b[/td][/tr]

[tr=bgcolor:#FFFFFF][td]a b c[/td][/tr]

[tr=bgcolor:#FFFFFF][td=bgcolor:#E2EFDA]a c a[/td][/tr]

[tr=bgcolor:#FFFFFF][td]a c b[/td][/tr]

[tr=bgcolor:#FFFFFF][td=bgcolor:#E2EFDA]a c c[/td][/tr]

[tr=bgcolor:#FFFFFF][td]b a a[/td][/tr]

[tr=bgcolor:#FFFFFF][td=bgcolor:#E2EFDA]b a b[/td][/tr]

[tr=bgcolor:#FFFFFF][td]b a c[/td][/tr]

[tr=bgcolor:#FFFFFF][td=bgcolor:#E2EFDA]b b a[/td][/tr]

[tr=bgcolor:#FFFFFF][td]b b b[/td][/tr]

[tr=bgcolor:#FFFFFF][td=bgcolor:#E2EFDA]b b c[/td][/tr]

[tr=bgcolor:#FFFFFF][td]b c a[/td][/tr]

[tr=bgcolor:#FFFFFF][td=bgcolor:#E2EFDA]b c b[/td][/tr]

[tr=bgcolor:#FFFFFF][td]b c c[/td][/tr]

[tr=bgcolor:#FFFFFF][td=bgcolor:#E2EFDA]c a a[/td][/tr]

[tr=bgcolor:#FFFFFF][td]c a b[/td][/tr]

[tr=bgcolor:#FFFFFF][td=bgcolor:#E2EFDA]c a c[/td][/tr]

[tr=bgcolor:#FFFFFF][td]c b a[/td][/tr]

[tr=bgcolor:#FFFFFF][td=bgcolor:#E2EFDA]c b b[/td][/tr]

[tr=bgcolor:#FFFFFF][td]c b c[/td][/tr]

[tr=bgcolor:#FFFFFF][td=bgcolor:#E2EFDA]c c a[/td][/tr]

[tr=bgcolor:#FFFFFF][td]c c b[/td][/tr]

[tr=bgcolor:#FFFFFF][td=bgcolor:#E2EFDA]c c c[/td][/tr]
[/table]
 
Upvote 0
This is pretty much it, which I achieved with iferror.. what I need now is that the results supress combinations that are the same, but in different positions. Tha t to say that for the results below for instance, aac, aca, caa should appear only once (regardless of each one it is).
Imagine rolling 3 dices, if I get 1 2 1 or 2 1 1 or 1 1 2 in practical terms it´s the same result. this is where I need to get to ...

is that what you want?

[TABLE="class: head"]
<tbody>[TR="bgcolor: #FFFFFF"]
[TD="bgcolor: #70AD47"]result[/TD]
[/TR]
[TR="bgcolor: #FFFFFF"]
[TD="bgcolor: #E2EFDA"]a a a[/TD]
[/TR]
[TR="bgcolor: #FFFFFF"]
[TD]a a b[/TD]
[/TR]
[TR="bgcolor: #FFFFFF"]
[TD="bgcolor: #E2EFDA"]a a c[/TD]
[/TR]
[TR="bgcolor: #FFFFFF"]
[TD]a b a[/TD]
[/TR]
[TR="bgcolor: #FFFFFF"]
[TD="bgcolor: #E2EFDA"]a b b[/TD]
[/TR]
[TR="bgcolor: #FFFFFF"]
[TD]a b c[/TD]
[/TR]
[TR="bgcolor: #FFFFFF"]
[TD="bgcolor: #E2EFDA"]a c a[/TD]
[/TR]
[TR="bgcolor: #FFFFFF"]
[TD]a c b[/TD]
[/TR]
[TR="bgcolor: #FFFFFF"]
[TD="bgcolor: #E2EFDA"]a c c[/TD]
[/TR]
[TR="bgcolor: #FFFFFF"]
[TD]b a a[/TD]
[/TR]
[TR="bgcolor: #FFFFFF"]
[TD="bgcolor: #E2EFDA"]b a b[/TD]
[/TR]
[TR="bgcolor: #FFFFFF"]
[TD]b a c[/TD]
[/TR]
[TR="bgcolor: #FFFFFF"]
[TD="bgcolor: #E2EFDA"]b b a[/TD]
[/TR]
[TR="bgcolor: #FFFFFF"]
[TD]b b b[/TD]
[/TR]
[TR="bgcolor: #FFFFFF"]
[TD="bgcolor: #E2EFDA"]b b c[/TD]
[/TR]
[TR="bgcolor: #FFFFFF"]
[TD]b c a[/TD]
[/TR]
[TR="bgcolor: #FFFFFF"]
[TD="bgcolor: #E2EFDA"]b c b[/TD]
[/TR]
[TR="bgcolor: #FFFFFF"]
[TD]b c c[/TD]
[/TR]
[TR="bgcolor: #FFFFFF"]
[TD="bgcolor: #E2EFDA"]c a a[/TD]
[/TR]
[TR="bgcolor: #FFFFFF"]
[TD]c a b[/TD]
[/TR]
[TR="bgcolor: #FFFFFF"]
[TD="bgcolor: #E2EFDA"]c a c[/TD]
[/TR]
[TR="bgcolor: #FFFFFF"]
[TD]c b a[/TD]
[/TR]
[TR="bgcolor: #FFFFFF"]
[TD="bgcolor: #E2EFDA"]c b b[/TD]
[/TR]
[TR="bgcolor: #FFFFFF"]
[TD]c b c[/TD]
[/TR]
[TR="bgcolor: #FFFFFF"]
[TD="bgcolor: #E2EFDA"]c c a[/TD]
[/TR]
[TR="bgcolor: #FFFFFF"]
[TD]c c b[/TD]
[/TR]
[TR="bgcolor: #FFFFFF"]
[TD="bgcolor: #E2EFDA"]c c c[/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0
faster will be manually:

[Table="width:, class:head"]
[tr=bgcolor:#FFFFFF][td]abc[/td][/tr]

[tr=bgcolor:#FFFFFF][td]aaa[/td][/tr]

[tr=bgcolor:#FFFFFF][td]bbb[/td][/tr]

[tr=bgcolor:#FFFFFF][td]ccc[/td][/tr]

[tr=bgcolor:#FFFFFF][td]abb[/td][/tr]

[tr=bgcolor:#FFFFFF][td]acc[/td][/tr]

[tr=bgcolor:#FFFFFF][td]baa[/td][/tr]

[tr=bgcolor:#FFFFFF][td]bcc[/td][/tr]

[tr=bgcolor:#FFFFFF][td]caa[/td][/tr]

[tr=bgcolor:#FFFFFF][td]cbb[/td][/tr]
[/table]
 
Last edited:
Upvote 0
if there is no problem with PowerQuery here is an example excel file

[Table="width:, class:head"]
[tr=bgcolor:#FFFFFF][td=bgcolor:#5B9BD5]Column1[/td][td=bgcolor:#5B9BD5]Column1[/td][td=bgcolor:#5B9BD5]Column1[/td][td][/td][td=bgcolor:#70AD47]Sorted[/td][/tr]

[tr=bgcolor:#FFFFFF][td=bgcolor:#DDEBF7]a[/td][td=bgcolor:#DDEBF7]a[/td][td=bgcolor:#DDEBF7]a[/td][td][/td][td=bgcolor:#E2EFDA]a, a, a[/td][/tr]

[tr=bgcolor:#FFFFFF][td]b[/td][td]b[/td][td]b[/td][td][/td][td]a, a, b[/td][/tr]

[tr=bgcolor:#FFFFFF][td=bgcolor:#DDEBF7]c[/td][td=bgcolor:#DDEBF7]c[/td][td=bgcolor:#DDEBF7]c[/td][td][/td][td=bgcolor:#E2EFDA]a, a, c[/td][/tr]

[tr=bgcolor:#FFFFFF][td][/td][td][/td][td][/td][td][/td][td]a, b, b[/td][/tr]

[tr=bgcolor:#FFFFFF][td][/td][td][/td][td][/td][td][/td][td=bgcolor:#E2EFDA]a, b, c[/td][/tr]

[tr=bgcolor:#FFFFFF][td][/td][td][/td][td][/td][td][/td][td]a, c, c[/td][/tr]

[tr=bgcolor:#FFFFFF][td][/td][td][/td][td][/td][td][/td][td=bgcolor:#E2EFDA]b, b, b[/td][/tr]

[tr=bgcolor:#FFFFFF][td][/td][td][/td][td][/td][td][/td][td]b, b, c[/td][/tr]

[tr=bgcolor:#FFFFFF][td][/td][td][/td][td][/td][td][/td][td=bgcolor:#E2EFDA]b, c, c[/td][/tr]

[tr=bgcolor:#FFFFFF][td][/td][td][/td][td][/td][td][/td][td]c, c, c[/td][/tr]
[/table]
 
Last edited:
Upvote 0
Great aproach, thank you!

if there is no problem with PowerQuery here is an example excel file

[TABLE="class: head"]
<tbody>[TR="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FFFFFF]#FFFFFF[/URL] "]
[TD="bgcolor: #5B9BD5"][COLOR=[URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FFFFFF]#FFFFFF[/URL] ]Column1[/COLOR]
[/TD]
[TD="bgcolor: #5B9BD5"][COLOR=[URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FFFFFF]#FFFFFF[/URL] ]Column1[/COLOR]
[/TD]
[TD="bgcolor: #5B9BD5"][COLOR=[URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FFFFFF]#FFFFFF[/URL] ]Column1[/COLOR]
[/TD]
[TD][/TD]
[TD="bgcolor: #70AD47"][COLOR=[URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FFFFFF]#FFFFFF[/URL] ]Sorted[/COLOR]
[/TD]
[/TR]
[TR="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FFFFFF]#FFFFFF[/URL] "]
[TD="bgcolor: #DDEBF7"]a
[/TD]
[TD="bgcolor: #DDEBF7"]a
[/TD]
[TD="bgcolor: #DDEBF7"]a
[/TD]
[TD][/TD]
[TD="bgcolor: #E2EFDA"]a, a, a
[/TD]
[/TR]
[TR="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FFFFFF]#FFFFFF[/URL] "]
[TD]b
[/TD]
[TD]b
[/TD]
[TD]b
[/TD]
[TD][/TD]
[TD]a, a, b
[/TD]
[/TR]
[TR="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FFFFFF]#FFFFFF[/URL] "]
[TD="bgcolor: #DDEBF7"]c
[/TD]
[TD="bgcolor: #DDEBF7"]c
[/TD]
[TD="bgcolor: #DDEBF7"]c
[/TD]
[TD][/TD]
[TD="bgcolor: #E2EFDA"]a, a, c
[/TD]
[/TR]
[TR="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FFFFFF]#FFFFFF[/URL] "]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]a, b, b
[/TD]
[/TR]
[TR="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FFFFFF]#FFFFFF[/URL] "]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="bgcolor: #E2EFDA"]a, b, c
[/TD]
[/TR]
[TR="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FFFFFF]#FFFFFF[/URL] "]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]a, c, c
[/TD]
[/TR]
[TR="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FFFFFF]#FFFFFF[/URL] "]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="bgcolor: #E2EFDA"]b, b, b
[/TD]
[/TR]
[TR="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FFFFFF]#FFFFFF[/URL] "]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]b, b, c
[/TD]
[/TR]
[TR="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FFFFFF]#FFFFFF[/URL] "]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="bgcolor: #E2EFDA"]b, c, c
[/TD]
[/TR]
[TR="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FFFFFF]#FFFFFF[/URL] "]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]c, c, c
[/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0

Forum statistics

Threads
1,223,904
Messages
6,175,295
Members
452,632
Latest member
jladair

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