Tracking all combinations

mac_see

Active Member
Joined
Oct 15, 2002
Messages
419
This is a tough one. I hope I will be able to explain the scnerio. Ok.. Let me try.

I have ten workers "A", "B", "C", "D", "E", "F", "G", "H", "I", "J" and "K". I have kept them in the range A1:A11

I want to create groups. Each group will consist of 4 workers. Every worker should get an opportunity to work with all the other workers.

Example:
"A", "B", "C" & "D"
"A", "C", "D" & "E"
"A", "B", "D" & "E"
"A", "B", "C" & "E"

and so on...................

Can this be done by using a formula.... Tracking all combinations would be very difficult to do it manually.

Maxi
 

Excel Facts

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

I think that scenerio is different where there were three columns. But I have only one column and 10 rows.

Maxi
 
Upvote 0
I would also like to know how many possibilities (Groups) can be created from the given data.

Thanx
Maxi
 
Upvote 0
I think I am not clear with my question

For example:

If I have five workers "A", "B", "C", "D" & "E" and if I want to create groups or two workers each, then there would be 10 possibilities:

AB, AC, AD, AE, BC, BD, BE, CD, CE & DE

Now If I have ten workers "A", "B", "C", "D", "E", "F", "G", "H", "I", "J" and "K" and if I want to create groups. Each group will consist of 4 workers. Every worker should get an opportunity to work with all the other workers.

How many possiblities would get created and how?

Maxi
 
Upvote 0
Hi:


You might try this code taken from an earlier post (Jay Petrulus), I am not sure you can do this easily with formulas...

Sub Combinations()
Dim n As Integer, m As Integer, numcomb
numcomb = 0
n = InputBox("Number of items?", "Combinations")
m = InputBox("Taken how many at a time?", "Combinations")
Application.ScreenUpdating = False
Comb2 n, m, 1, ""
End Sub

'Generate combinations of integers k..n taken m at a time, recursively
Private Function Comb2(ByVal n As Integer, ByVal m As Integer, _
ByVal k As Integer, ByVal s As String)
If m > n - k + 1 Then Exit Function
If m = 0 Then
ActiveCell = s
ActiveCell.Offset(1, 0).Select
Exit Function
End If
Comb2 n, m - 1, k + 1, s & k & " "
Comb2 n, m, k + 1, s
End Function


I quickly tested the resultes and on 10 possible and selecting 4 I obtained a combination of 210 possible...I believe that is correct combinations.

hope this helps
plettieri
 
Upvote 0
Hi:

Just a footnote on how to get the total required

=COMBIN(10,4) equals the 210 required.

plettieri
 
Upvote 0
" I am not sure you can do this easily with formulas... "

Very right. Excel won't calculate above factorial 170
 
Upvote 0

Forum statistics

Threads
1,215,750
Messages
6,126,663
Members
449,326
Latest member
asp123

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