Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 3
Default COMBIN and listing - Help Required Please.

I am looking for some assistance to achieve the following which I
would prefer if possible to be able to carry out by using formula
functions rather than macros which are not my forte.

I have used the COMBIN formula to achieve the figures I require,

eg: COMBIN(6,3) to give me 20

what I need is a formula that will actually list the 20 unique
combinations,

ie:

1 2 3
1 2 4
1 2 5
1 2 6
2 3 4
2 3 5

etc. etc.

I have many of these of varying figures to carry out and to enter them
by hand would be laborious and open to human error.

I would appreciate any help or advise.

Thank you in advance,

Terry.
  #2   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 11,501
Default COMBIN and listing - Help Required Please.

Terry,

I don't know of a formula that will do it but this macro. Right click the
sheet tab, view code and paste this in.

Put your numbers in column A start ing in A1 and run the code. The
combinations will be output to column B.

Sub combinations()
last = Cells(Rows.Count, "A").End(xlUp).Row
For I = 1 To last - 2
For J = I + 1 To last - 1
For K = J + 1 To last
Cells(L + 1, 2) = Cells(I, 1) & Cells(J, 1) & Cells(K, 1)
L = L + 1
Next
Next
Next
End Sub

Mike

"Terry" wrote:

I am looking for some assistance to achieve the following which I
would prefer if possible to be able to carry out by using formula
functions rather than macros which are not my forte.

I have used the COMBIN formula to achieve the figures I require,

eg: COMBIN(6,3) to give me 20

what I need is a formula that will actually list the 20 unique
combinations,

ie:

1 2 3
1 2 4
1 2 5
1 2 6
2 3 4
2 3 5

etc. etc.

I have many of these of varying figures to carry out and to enter them
by hand would be laborious and open to human error.

I would appreciate any help or advise.

Thank you in advance,

Terry.

  #3   Report Post  
Posted to microsoft.public.excel.newusers
Max Max is offline
external usenet poster
 
Posts: 9,221
Default COMBIN and listing - Help Required Please.

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

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), ie
enter: C
2. Enter the number of items involved per combo in A2, ie enter: 3
3. Enter/List the 6 items in A3 down, ie list in A3:A8 :1, 2, ... 6
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 appear
like below, in a zig-zag manner* until all combos are exhausted:
*if it exceeds the rows limit of 65536 in xl97 to xl2003

1, 2, 3
1, 2, 4
1, 2, 5
1, 2, 6
....
4, 5, 6

Go easy when you *ramp* up the generation ...
eg a "Pick 6 out of 45" run works 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
---
"Terry" wrote in message
...
I am looking for some assistance to achieve the following which I
would prefer if possible to be able to carry out by using formula
functions rather than macros which are not my forte.

I have used the COMBIN formula to achieve the figures I require,

eg: COMBIN(6,3) to give me 20

what I need is a formula that will actually list the 20 unique
combinations,

ie:

1 2 3
1 2 4
1 2 5
1 2 6
2 3 4
2 3 5

etc. etc.

I have many of these of varying figures to carry out and to enter them
by hand would be laborious and open to human error.

I would appreciate any help or advise.

Thank you in advance,

Terry.



  #4   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 3
Default COMBIN and listing - Help Required Please.

Mike & Max

Thank you both very much for your help and your fast
responses. I have decided to use the option supplied by Max as it will
be easier for me to use as my ability with Excel is quite limited.
This does not of course detract from my gratitude to you both for your
efforts.

Regards,

Terry.





  #5   Report Post  
Posted to microsoft.public.excel.newusers
Max Max is offline
external usenet poster
 
Posts: 9,221
Default COMBIN and listing - Help Required Please.

Welcome, nice of you to post back here.
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"Terry" wrote in message
...
Mike & Max

Thank you both very much for your help and your fast
responses. I have decided to use the option supplied by Max as it will
be easier for me to use as my ability with Excel is quite limited.
This does not of course detract from my gratitude to you both for your
efforts.

Regards,

Terry.







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 to combin rows. Johnny Excel Discussion (Misc queries) 2 November 27th 07 08:34 PM
Combin Andreas Excel Worksheet Functions 25 July 25th 06 05:59 AM
=combin function Jerry Kinder New Users to Excel 3 February 25th 06 01:53 AM
=combin function Jerry Kinder New Users to Excel 2 February 24th 06 09:47 PM
Questions on combin and permut mac_see Excel Worksheet Functions 5 March 15th 05 07:28 PM


All times are GMT +1. The time now is 05:58 AM.

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

About Us

"It's about Microsoft Excel"