+ Reply to Thread
Results 1 to 4 of 4

Generate a table of all possible combinations

  1. #1
    Registered User
    Join Date
    04-09-2013
    Location
    NJ
    MS-Off Ver
    2010
    Posts
    2

    Generate a table of all possible combinations

    I'm wondering how to do this in Excel.

    I have a table with changing values. Lets say its 3 rows by 6 columns.

    Joe Jill Jim Jack Jess Jake
    Sally Sue Steve Stu Sam Scott
    Alan Adam Alex Archie Ana Arthur

    I'd now like to use this as data to generate all possible combinations of 6, with the caveat of keeping the same column position.

    So we already have 3 combinations, as above, but the next few might look like
    Joe, Sue, Jim, Jack, Jess, Jake
    Joe, Jill, Steve, Jack, Jess, Jake
    Joe, Jill, Jim, Stu, Jess, Jake
    .....
    Joe, Sue, Steve, Jack, Jess, Jake
    ....
    Sally, Jill, Steve, Stu, Sam, Scott
    ....
    Joe, Sue, Jim, Archie, Sam, Arthur
    etc, etc.

    The column position always needs to stay the same.
    So Sally always appears first, and Sue always appears 2nd, Jess always appears 5th, Arthur always appears 6th.

    Any ideas on how to do this in Excel?

    If coding this, I'd load up an array then progress through the rows for each column. Any other methods? Trying to make the method non-programmer friendly for later modification by non-IT folks. (so I don't have to own it.)

    Many thanks,

    Val

  2. #2
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Generate a table of all possible combinations

    Hi

    How about

    Please Login or Register  to view this content.
    rylo

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

    Re: Generate a table of all possible combinations

    There's a workbook with examples of how to do this with either formulas or VBA at https://www.box.com/s/47b28f19d794b25511be
    Entia non sunt multiplicanda sine necessitate

  4. #4
    Registered User
    Join Date
    04-09-2013
    Location
    NJ
    MS-Off Ver
    2010
    Posts
    2

    Re: Generate a table of all possible combinations

    Awesome, thanks!

+ 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