Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default How to create a complete list of combinations from 5 options

I have a list of 5 possible options that I need to assemble into combinations
of 3 (order does not matter). I want to make sure the list is complete and
I'd rather not do it by hand. Can excel (or access) help me with this and how?

The order of the variables doesn't matter so 121 is the same to me as 112 or
211.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default How to create a complete list of combinations from 5 options

If you are pick 3 of 5 (no repeats):

1, 2, 3
1, 2, 4
1, 2, 5
1, 3, 4
1, 3, 5
1, 4, 5
2, 3, 4
2, 3, 5
2, 4, 5

--
Gary''s Student - gsnu200791


"Nevermore" wrote:

I have a list of 5 possible options that I need to assemble into combinations
of 3 (order does not matter). I want to make sure the list is complete and
I'd rather not do it by hand. Can excel (or access) help me with this and how?

The order of the variables doesn't matter so 121 is the same to me as 112 or
211.

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 762
Default How to create a complete list of combinations from 5 options

Nevermore -

Based on your description, I think you want the "number of combinations with
repetition" (according to the wikipedia entry for "combination").

So, for n=5 and k=3, the number of combinations with repetition is
(n+k-1)!/(k!*(n-1)!) = 7!/(3!*4!) = 35.

Now you know how many combinations you need to find so that "the list is
complete."

Maybe another poster will help so that you won't need to "do it by hand."

- Mike Middleton
http://www.DecisionToolworks.com
Decision Analysis Add-ins for Excel



"Nevermore" wrote in message
...
I have a list of 5 possible options that I need to assemble into
combinations
of 3 (order does not matter). I want to make sure the list is complete
and
I'd rather not do it by hand. Can excel (or access) help me with this and
how?

The order of the variables doesn't matter so 121 is the same to me as 112
or
211.



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default How to create a complete list of combinations from 5 options

The numbers can repeat which is where the list expands significantly. So I
can have 112 or 122 etc. Thats why I was looking for an automated solution.

"Gary''s Student" wrote:

If you are pick 3 of 5 (no repeats):

1, 2, 3
1, 2, 4
1, 2, 5
1, 3, 4
1, 3, 5
1, 4, 5
2, 3, 4
2, 3, 5
2, 4, 5

--
Gary''s Student - gsnu200791


"Nevermore" wrote:

I have a list of 5 possible options that I need to assemble into combinations
of 3 (order does not matter). I want to make sure the list is complete and
I'd rather not do it by hand. Can excel (or access) help me with this and how?

The order of the variables doesn't matter so 121 is the same to me as 112 or
211.

  #5   Report Post  
Posted to microsoft.public.excel.misc
Max Max is offline
external usenet poster
 
Posts: 9,221
Default How to create a complete list of combinations from 5 options

"Nevermore" wrote:
The numbers can repeat which is where the list expands significantly. So I
can have 112 or 122 etc. Thats why I was looking for an automated solution.


One easy play to generate the combinations
is to use Myrna Larson's power subroutine ..

Take away this implemented sample from my archives:
http://www.savefile.com/files/518493
MyrnaLarson_Combination_Permutation.xls
(full details inside, ready to run)

In the sample file,

In Sheet1,
1. Enter the letter C or P in A1
(C = combinations, P = permutations),
eg enter: C (in your case, it's combinations)

2. Enter the number of items involved per combo in A2,
eg enter: 3 (in your case, it's 3)

3. Enter/List the N items in A3 down (your "5 possible options")

4. Select A1 (this cell selection is required),
then click the button "ListPermutations" to run the sub ListPermutations

5. The results will be written to a new sheet (just to the left),
and wrap in a zig-zag manner until all combinations are exhausted:
*if it exceeds the rows limit of 65536 in xl97 to xl2003

--------
Go easy when you "ramp up" the generation
(increasing picks on increasing N values)

As a sanity check, for example:
a "Pick 6 out of 45" run will work out to a staggering:
=COMBIN(45,6) = 8,145,060 combinations
so almost half** an entire sheet would be populated

**A single sheet in xl97 to xl2003 houses:
=65536 rows x 256 cols = 16,777,216 cells

The sub would certainly need time to complete generation
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---


  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,180
Default How to create a complete list of combinations from 5 options

Assuming with Mike Middleton that you want
combinations with repetition, 35 in this case,
and you don't want to use a macro,
then try this tandem Pivot Table approach:
http://www.savefile.com/files/1610285
  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 57
Default How to create a complete list of combinations from 5 options



"Herbert Seidenberg" wrote:

Assuming with Mike Middleton that you want
combinations with repetition, 35 in this case,
and you don't want to use a macro,
then try this tandem Pivot Table approach:
http://www.savefile.com/files/1610285


I tried going to that URL but it says "file not found."
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I create a list of options with only one being selectable? Quincy Jones Excel Discussion (Misc queries) 1 April 8th 07 03:40 AM
I have 5 columns of data and want to create combinations based on Carbob Excel Discussion (Misc queries) 0 June 2nd 06 04:58 PM
Create possible combinations from three variables JoeD Excel Discussion (Misc queries) 3 April 20th 06 10:20 PM
create an automatic complete list from existing data in the sheet Etienne Excel Discussion (Misc queries) 2 February 8th 06 01:55 PM
Macro to add numbers to create combinations that equal certain amo Lauren qt314 Excel Discussion (Misc queries) 3 April 21st 05 05:57 PM


All times are GMT +1. The time now is 03:39 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"