Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default combinatiion of 6 digit numbers from 0-49

kindly tell me how do i get the various combinations of six digit number from
0-49.The number should not be repeated in any of the combinations
  #2   Report Post  
Posted to microsoft.public.excel.misc
Max Max is offline
external usenet poster
 
Posts: 9,221
Default combinatiion of 6 digit numbers from 0-49

"Divya" wrote:
kindly tell me how do i get the various combinations of six digit number from
0-49.The number should not be repeated in any of the combinations


One way is to use Myrna Larson's power subroutine ..

Try this sample from my archives which contains an implementation:
http://www.savefile.com/files/518493
MyrnaLarson_Combination_Permutation.xls
(full details inside, ready to go <g)

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: 6
3. Enter/List the 50 items in A3 down, ie list in A3:A52: 0, 1, 2, ... 49
4. Select A1 (this 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:

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

Note that what you want generated is a "Pick 6 out of 50",
which works out to a staggering:
=COMBIN(50,6) = 15,890,700 combos

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

so almost the entire sheet would be populated
when you run your "Pick 6 out of 50"

The sub would certainly need time to complete its run/generation

For a start, suggest that you go easy on the number of combos, maybe run a
"Pick 2 out of 50" first, ie enter in A2: 2, instead of 6, then click the
button. You should see all 1225 combos [=COMBIN(50,2)] generated in Sheet2
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
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
Store numbers starting with zero as 2 digit numbers twisted1825 Excel Discussion (Misc queries) 8 January 11th 07 06:41 PM
15+ digit numbers LisaS Excel Worksheet Functions 3 October 4th 06 12:42 AM
what is the minimum numbers set for 4 digit numbers from 0000 to 9 Ambika Excel Discussion (Misc queries) 14 January 27th 06 10:50 PM
16 digit numbers Jaxz24 Excel Discussion (Misc queries) 3 August 17th 05 01:33 PM
16 DIGIT NUMBERS IN CELL WITHOUT LAST DIGIT BEING A ZERO jnkell Excel Worksheet Functions 2 December 18th 04 07:13 PM


All times are GMT +1. The time now is 02:52 PM.

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"