generate all possible combinations of several lists

anao_

New Member
Joined
Aug 5, 2014
Messages
2
Hi,

I am trying to make all the combinations of the list below, given a certain criteria

List (Input)[TABLE="width: 427"]
<tbody>[TR]
[/TR]
[TR]
[TD][TABLE="width: 489"]
<tbody>[TR]
[TD][/TD]
[TD]Failure of 1 production line[/TD]
[TD]Failure of 2 production line[/TD]
[TD]Failure of 3 production line[/TD]
[/TR]
[TR]
[TD]Factory 1[/TD]
[TD]A1[/TD]
[TD]B1[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Factory 2[/TD]
[TD]A2[/TD]
[TD]B2[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Factory 3[/TD]
[TD]A3[/TD]
[TD]B3[/TD]
[TD]C3[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[/TR]
[TR]
[TD]The ouputs should be all the potential combinations from 1 production to all the 9 failing. The trick here is that I can't have combinations of any of the items in the B column (and following), if the item in the same row from the previous column is not envolved. For example, I want to exclude combinations that include B1 and do not include A1 (A2+B1 for example).

The output should look like this:
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

Output

[TABLE="width: 427"]
<tbody>[TR]
[TD]Combinations of 1
[/TD]
[TD]Combinations of 2[/TD]
[TD]Combinations of 3[/TD]
[TD]Combinations of ...[/TD]
[/TR]
[TR]
[TD]A1[/TD]
[TD]A1+B1[/TD]
[TD]A1+B1+A2[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]A2[/TD]
[TD]A1+A2[/TD]
[TD]A1+A2+A3[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]A3[/TD]
[TD]A1+A3[/TD]
[TD]A1+A2+B2[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]A2+B2[/TD]
[TD]...[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]A3+B3[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

And give the condition above, these would not be valid outputs:

[TABLE="width: 363"]
<tbody>[TR]
[TD]Combinations of 1
[/TD]
[TD]Combinations of 2[/TD]
[TD]Combinations of 3[/TD]
[/TR]
[TR]
[TD]B1[/TD]
[TD]A1+B2[/TD]
[TD]B1+B2+B3[/TD]
[/TR]
[TR]
[TD]B2[/TD]
[TD]A1+C3[/TD]
[TD]A1+B2+A3[/TD]
[/TR]
[TR]
[TD]B3[/TD]
[TD]...[/TD]
[TD]...[/TD]
[/TR]
[TR]
[TD]C3[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

Many thanks in advance! Please let me know if this is not clear!

Best,
anao_
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.

Forum statistics

Threads
1,223,231
Messages
6,170,884
Members
452,364
Latest member
springate

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