Permutations of Set of Numbers in a Column

chelseajonesy

New Member
Joined
Mar 13, 2014
Messages
4
I have searched all over the internet but am having trouble finding the answer to my problem. I would like to write a macro that will list the possible permutations of a column, in the column right next to it. For instance, see columns 1 and 2:

[TABLE="class: grid, width: 50"]
<tbody>[TR]
[TD]1[/TD]
[TD]1[/TD]
[TD]Permutation1[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]2[/TD]
[TD]Permutation1[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]3[/TD]
[TD]Permutation1[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]1[/TD]
[TD]Permutation2[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]3[/TD]
[TD]Permutation2[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]2[/TD]
[TD]Permutation2[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]2[/TD]
[TD]Permutation3[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]1[/TD]
[TD]Permutation3[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]3[/TD]
[TD]Permutation3[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]2[/TD]
[TD]Permutation4[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]3[/TD]
[TD]Permutation4[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]1[/TD]
[TD]Permutation4[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]3[/TD]
[TD]Permutation5[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]1[/TD]
[TD]Permutation5[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]2[/TD]
[TD]Permutation5[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]3[/TD]
[TD]Permutation6[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]2[/TD]
[TD]Permutation6[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]1[/TD]
[TD]Permutation6[/TD]
[/TR]
</tbody>[/TABLE]

Obviously column 3 is just labeling permutations, I just need a code for columns 1 and 2. Thanks in advance!!
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
What's the expected result in column C?
 
Upvote 0
I think I'm not being clear enough, my apologies. I do not expect an answer or any information in column c. I simply put in in the original post to label my permutations. Column c is useless to me in my spreadsheet, I only put it here to explain what I'm looking for.

I'm looking for a macro that will give the possible permutations from a range of values from a column (e.g "Column A"), into another column (e.g "Column B"), similar to what is listed above.
 
Upvote 0
There's a workbook at https://app.box.com/shared/f3puhccnqa that will do this:

[Table="width:, class:grid"][tr][td] [/td][td]
B​
[/td][td]
C​
[/td][/tr]
[tr][td]
2​
[/td][td]
Permutations of Combinations
[/td][td]
[/td][/tr]

[tr][td]
3​
[/td][td]
mMin​
[/td][td][/td][/tr]

[tr][td]
4​
[/td][td]
3​
[/td][td][/td][/tr]

[tr][td]
5​
[/td][td]
mMax​
[/td][td][/td][/tr]

[tr][td]
6​
[/td][td]
3​
[/td][td]
Space-delimited Input String​
[/td][/tr]

[tr][td]
7​
[/td][td]
m​
[/td][td]1 2 3[/td][/tr]

[tr][td]
8​
[/td][td]
3​
[/td][td]3 2 1[/td][/tr]

[tr][td]
9​
[/td][td]
3​
[/td][td]3 1 2[/td][/tr]

[tr][td]
10​
[/td][td]
3​
[/td][td]2 3 1[/td][/tr]

[tr][td]
11​
[/td][td]
3​
[/td][td]2 1 3[/td][/tr]

[tr][td]
12​
[/td][td]
3​
[/td][td]1 3 2[/td][/tr]

[tr][td]
13​
[/td][td]
3​
[/td][td]1 2 3[/td][/tr]
[/table]
 
Upvote 0
There's a workbook at https://app.box.com/shared/f3puhccnqa that will do this:

[TABLE="class: grid"]
<tbody>[TR]
[TD][/TD]
[TD]
B​
[/TD]
[TD]
C​
[/TD]
[/TR]
[TR]
[TD]
2​
[/TD]
[TD]
Permutations of Combinations
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
3​
[/TD]
[TD]
mMin​
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
4​
[/TD]
[TD]
3​
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
5​
[/TD]
[TD]
mMax​
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
6​
[/TD]
[TD]
3​
[/TD]
[TD]
Space-delimited Input String​
[/TD]
[/TR]
[TR]
[TD]
7​
[/TD]
[TD]
m​
[/TD]
[TD]1 2 3[/TD]
[/TR]
[TR]
[TD]
8​
[/TD]
[TD]
3​
[/TD]
[TD]3 2 1[/TD]
[/TR]
[TR]
[TD]
9​
[/TD]
[TD]
3​
[/TD]
[TD]3 1 2[/TD]
[/TR]
[TR]
[TD]
10​
[/TD]
[TD]
3​
[/TD]
[TD]2 3 1[/TD]
[/TR]
[TR]
[TD]
11​
[/TD]
[TD]
3​
[/TD]
[TD]2 1 3[/TD]
[/TR]
[TR]
[TD]
12​
[/TD]
[TD]
3​
[/TD]
[TD]1 3 2[/TD]
[/TR]
[TR]
[TD]
13​
[/TD]
[TD]
3​
[/TD]
[TD]1 2 3[/TD]
[/TR]
</tbody>[/TABLE]

I'm sorry this is not what i'm looking for. I would like for the numbers to appear separately listed down (in the column) rather than across (in a row). All answers I have found have been in a row. Which is why I have posted this thread.
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,871
Members
452,363
Latest member
merico17

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