+ Reply to Thread
Results 1 to 8 of 8

Display all combinations from a set of numbers

Hybrid View

  1. #1
    Registered User
    Join Date
    06-29-2005
    Posts
    77

    Display all combinations from a set of numbers

    Hi

    I have a simple question I think, just not sure how to go about it.

    Let's say I have a row of numbers:

    1 2 3 4 5 6 7 8 9 10 11 12 13 14

    and let's say I want to display on the spreadsheet all the possible combinations of 2 numbers:

    1-2, 1-3, 1-4, etc

    OR let's say I want to see all the possible combinations of 3 numbers:

    1-2-3, 1-2-4, 1-2-5, etc


    I have done this manually, but I am guessing there is a better way.


    Also

    Let's say I have 6 sets 5 numbers:

    10 12 13 17 18 19
    27 28 29 10 11 12
    30 31 32 33 34 35
    40 41 42 43 44 45
    50 51 52 53 54 55


    What sort of function can I use to show all the possible combinations, where
    each number stays in its own column?

    For example, the first combination of 6 would be:

    10 12 13 17 18 19

    then

    10 28 13 17 18 19

    then

    10 31 13 17 18 19

    etc, where the 10, 27, 30, 40, 50 stay in column 1, the 12, 28, 31, 41, 51 stay in column 2, etc.





    TIA!
    Last edited by tx12345; 07-10-2005 at 07:34 PM.

  2. #2
    Tom Ogilvy
    Guest

    Re: Display all combinations from a set of numbers

    Code by Myrna Larson that does this:

    http://tinyurl.com/cdjck

    --
    Regards,
    Tom Ogilvy

    "tx12345" <tx12345.1rz52a_1121033100.7693@excelforum-nospam.com> wrote in
    message news:tx12345.1rz52a_1121033100.7693@excelforum-nospam.com...
    >
    > Hi
    >
    > I have a simple question I think, just not sure how to go about it.
    >
    > Let's say I have a row of numbers:
    >
    > 1 2 3 4 5 6 7 8 9 10 11 12 13 14
    >
    > and let's say I want to display on the spreadsheet all the possible
    > combinations of 2 numbers:
    >
    > 1-2, 1-3, 1-4, etc
    >
    > OR let's say I want to see all the possible combinations of 3 numbers:
    >
    > 1-2-3, 1-2-4, 1-2-5, etc
    >
    >
    > I have done this manually, but I am guessing there is a better way.
    >
    > TIA!
    >
    >
    > --
    > tx12345
    > ------------------------------------------------------------------------
    > tx12345's Profile:

    http://www.excelforum.com/member.php...o&userid=24776
    > View this thread: http://www.excelforum.com/showthread...hreadid=385992
    >




  3. #3
    Registered User
    Join Date
    06-29-2005
    Posts
    77
    Thanks, but the code is bugged out. buffer issues and other things. I probably do not know how to use it.

  4. #4
    Max
    Guest

    Re: Display all combinations from a set of numbers

    > .. but the code is bugged out. buffer issues and other things ..

    No, definitely not. But you probably were hit by line wraps during copy >
    pasting, etc when you tried to implement ..

    So .. how about a nice, easy to use, working sample file with Myrna's
    subroutine implemented ? The "Download File" link is available at:
    http://flypicture.com?display=updone&id=qtr8kao=
    File: MyrnaLarson_Combination_Permutation.xls

    Right-click on "Download File" > Choose "Save Target As .." and save the
    file to your desired folder. Open the file from there (Do not open the file
    direct from the download link). You would need to enable macros, of course!
    --
    Rgds
    Max
    xl 97
    ---
    GMT+8, 1° 22' N 103° 45' E
    xdemechanik <at>yahoo<dot>com
    ----
    "tx12345" <tx12345.1rzrab_1121061906.2591@excelforum-nospam.com> wrote in
    message news:tx12345.1rzrab_1121061906.2591@excelforum-nospam.com...
    >
    > Thanks, but the code is bugged out. buffer issues and other things. I
    > probably do not know how to use it.
    >
    >
    > --
    > tx12345
    > ------------------------------------------------------------------------
    > tx12345's Profile:

    http://www.excelforum.com/member.php...o&userid=24776
    > View this thread: http://www.excelforum.com/showthread...hreadid=385992
    >




  5. #5
    Max
    Guest

    Re: Display all combinations from a set of numbers

    http://flypicture.com?display=updone&id=qtr8kao=

    The link given is good, but if you click directly, it may not work. Do a
    copy > paste of the entire line (including the "=" at the rightmost end of
    the line) into the address bar in the browser ..
    --
    Rgds
    Max
    xl 97
    ---
    GMT+8, 1° 22' N 103° 45' E
    xdemechanik <at>yahoo<dot>com
    ----



  6. #6
    Registered User
    Join Date
    06-29-2005
    Posts
    77
    Great file, thank you very much.

+ 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