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

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).
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,224,737
Messages
6,180,670
Members
452,993
Latest member
FDARYABEE

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