+ Reply to Thread
Results 1 to 11 of 11

List Possible Combinations

  1. #1
    Registered User
    Join Date
    09-08-2010
    Location
    Manly, Australia
    MS-Off Ver
    Excel 2007
    Posts
    7

    List Possible Combinations

    Hi Guys
    I am trying to list all possible combinations of x,y,z x=1-1000 y=1-1000 z=1-500, I have seen several discussions along the same lines though can’t seem to find anything that will really work, I’m not very proficient with macro's ect but if that’s the only way it can be done I can have another go. Any help you can give would be greatly appreciated
    Thanks

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Possible Combinations

    Welcome to the forum.

    That's 500M combinations. What would you do if you had this 2GB file that you couldn't do without it?
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    09-08-2010
    Location
    Manly, Australia
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: List Possible Combinations

    Thanks for such a fast reply, i thought it was 500 million combinations, basicaly i want to put the all the combinations of x,y, and z through a formula firstly to see if there are any duplications, can excel handle somthing that large ?
    Again thanks for your help
    Chris

  4. #4
    Forum Expert darkyam's Avatar
    Join Date
    03-05-2008
    Location
    Houston, TX
    MS-Off Ver
    2013
    Posts
    2,191

    Re: List Possible Combinations

    What do you mean about any duplications? All combinations would be listed once, so there would be no duplicates. Excel can handle something that size, but it will take forever.
    Life is about perseverance. Remember: today's mighty oak tree is just yesterday's nut that held its ground.

    If you like a post, please rate it with the scales icon (top right).
    If you feel really indebted, please consider a donation to charity, such as Feed the Children or Habitat for Humanity.

  5. #5
    Registered User
    Join Date
    09-08-2010
    Location
    Manly, Australia
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: List Possible Combinations

    I want to know to know if there would be any duplications in the output of the formula, how long is forever ? and how can i do it ?
    Cheers

  6. #6
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885

    Re: List Possible Combinations

    500M is 500 million.

    Excel 2003 has 65,536 rows by 256 columns. Therefore each sheet could only hold 16,777,216 combinations. You would need 30 worksheets to hold them all.

    Excel 2007 has 1,048,576 rows by 16,384 columns. Each sheet can hold over 17 billion combinations, so it would work.

    While ludicrous, here's the code that will list them all in rows 1 to 1 million, spanning 500 columns. It took my laptop 1 minute 24 seconds to get through the first million, so if you multiply that out by 500 you get 42000 seconds, or 11 hours and 40 minutes. Go get a cup of tea or something.
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    09-08-2010
    Location
    Manly, Australia
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: List Possible Combinations

    Hey Paul
    Thanks for your help mate, your a legend, is there any way i can use the individual numbers within the cells ? im trying to put x,y,z into =normdist to see if there are any duplications, in theory there shuldnt be, but there are anomalies like when x and y and the same number
    Again thanks for all your help
    Chris

  8. #8
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885

    Re: List Possible Combinations

    What do you mean duplications? This will create a list of every possible combination of the three sets of numbers. If you mean will there be an instance of "1, 23, 450" and "450, 23,1" then yes, there will be duplicates. There won't be two instances of "1, 23, 450" though.

    Of course it can be done (making three cells instead of one for every number), but will it do any good given my previous statement?

  9. #9
    Registered User
    Join Date
    09-08-2010
    Location
    Manly, Australia
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: List Possible Combinations

    its more the output of the formula that im interested in rather than the output of the code e.g the =normdist(1,1,4,true) is 0.5 and =normdist(1,1,20,true) is also 0.5 i would like to know if there are going to be any other anomalies like this also answers like 8.53E-81 are also common, if we could put x,y,z running down a1,b1,c1 would be much more effective as i could possibly look at where these anomalies occur and re arange the formula =normdist(z,y,x,true) where apropriate.
    Thanks
    Chris

  10. #10
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885

    Re: List Possible Combinations

    To split each combination into three cells across (e.g. A1, B1, C1; A2, B2, C2) use:
    Please Login or Register  to view this content.
    Once it gets to row 1 million it will go back to the top and resume in columns D/E/F, then move to G/H/I when the previous 3 columns are filled to 1 million rows.

    The end result will be 1,500 columns x 1,000,000 rows of pure insanity. On my PC it would take about 12 hours to run, and who knows if it would blow up due to memory constraints or not. I'm not going to test it for beyond the 3-minute run I just did. Good luck!

  11. #11
    Registered User
    Join Date
    09-08-2010
    Location
    Manly, Australia
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: List Possible Combinations

    Cheers dude your a legend, probably gonna half the values, should still give me what i want.
    Thanks for all your help man
    Chris

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1