Closed Thread
Results 1 to 6 of 6

listing all combinations

  1. #1
    Registered User
    Join Date
    04-12-2007
    Posts
    2

    listing all combinations

    if i had the letters A,B,C,D,E,F,G,H,I in cells A1 thru A9, how could i show all combinations of these nine letters (one letter per cell) in columns B thru J? this would include A, B, AB, ABC, ABCD, etc. per the formula for combinations without replacement, i know i should end up with 511 different combinations (thus, the solution will use 511 rows). any suggestions for how to do with without using macros?

  2. #2
    Valued Forum Contributor
    Join Date
    06-16-2006
    Location
    Sydney, Australia
    MS-Off Ver
    2013 64bit
    Posts
    1,394
    I will hazard at a guess - without macros = no can do. Why pray tell do you want to do this?

  3. #3
    Registered User
    Join Date
    04-12-2007
    Posts
    2

    writing code

    i need to write some code in a separate software program to cover all possible combinations of the 9 letters (each letter represents a different company in my analysis). and i normally use excel to layout the code before cutting and pasting back to the original software syntax screen.

    so if it can't be done without macros, does anyone have the macro code to do this? thanks in advance for any help.

  4. #4
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Smile

    Good evening pilot4fun

    You can do it using macros, but it isn't quick, and going up to 9 digits is going to take some time to calculate. I haven't got time to take you through a dedicated example, but have a lok at the file below.

    It started as a word game I was designing, but it ran too slow, so I eventually abandoned the idea. Basically, the file takes a six letter word from a list of 5,580 and scrambles it and the user has to guess the six letter word(s) and any other shorter words. Click on the Find Words button to kick off the routine you're interested in. This takes a few seconds for 6 letters and would take far longer for seven letters - eight or nine letters would be virtually unusable - maybe that's just 'cos I'm checking the spelling at the same time.

    HTH

    DominicB
    Last edited by dominicb; 08-19-2008 at 04:29 AM.
    Please familiarise yourself with the rules before posting. You can find them here.

  5. #5
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229
    This will put all the permiutations that you want in column A. If you want to pemute more or fewer letters, change letterCount. If you want the result column to be somewhere else, change printPlace. You should be aware that it puts "" in the 512th row.
    Please Login or Register  to view this content.
    Last edited by mikerickson; 04-16-2007 at 11:29 PM.

  6. #6
    Registered User
    Join Date
    05-28-2013
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    1

    Re: listing all combinations

    Thank you mikerickson! Using your code I was then able to convert the 511 combinations of A,B,C,D,E,F,G,H,I into words. THANK YOU!

    Quote Originally Posted by mikerickson View Post
    This will put all the permiutations that you want in column A. If you want to pemute more or fewer letters, change letterCount. If you want the result column to be somewhere else, change printPlace. You should be aware that it puts "" in the 512th row.
    Please Login or Register  to view this content.

Closed 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