recursive function to get all possible combinations

kinetic

New Member
Joined
Nov 23, 2009
Messages
9
hello world.

i am trying to get all possible combinations of a single column array which all contain one master value.
$master_value = "Z"

$value_array[5] = ["A", "B", "C", "D", "Z"][FONT=&quot]so the possible combinations would be something like this (all would include the "master value")[/FONT]
Quote

Z,A
A,Z
Z,B
B,Z
Z,C
C,Z
Z,D
D,Z
Z,A,B
Z,B,A
A,Z,B
B,Z,A
B,A,Z
A,B,Z
Z,A,B,C
Z,B,C,A
Z,C,B,A

any help would be greatly appreciated!
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
Hi there.

Why not do it in 2 stages - first generate the combinations without the Z, then take each of these and add the Z in each position?
 
Upvote 0

Forum statistics

Threads
1,223,705
Messages
6,173,986
Members
452,541
Latest member
haasro02

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