+ Reply to Thread
Results 1 to 4 of 4

Create all possible combinations using 2 columm (Data 1, Data 2)

  1. #1
    Registered User
    Join Date
    05-07-2013
    Location
    Salinas, Puerto Rico
    MS-Off Ver
    Excel 2007
    Posts
    2

    Create all possible combinations using 2 columm (Data 1, Data 2)

    For example.....take this:

    Grouping Data 1 Data 2
    1 Male A
    1 Male B
    1 Male C
    1 Female D
    1 Female E
    1 Female F
    1 Female G
    1 Female H
    1 Female I
    2 Male J
    2 Male K
    2 Male L
    2 Male M
    2 Female N
    2 Female O


    and convert it to:

    Group Male Female
    1 A D
    1 A E
    1 A F
    1 A G
    1 A H
    1 A I
    1 B D
    1 B E
    1 B F
    1 B G
    1 B H
    1 B I
    1 C D
    1 C E
    1 C F
    1 C G
    1 C H
    1 C I
    2 J N
    2 J O
    2 K N
    2 K O
    2 L N
    2 L O
    2 M N
    2 M O

  2. #2
    Forum Expert
    Join Date
    06-09-2010
    Location
    Australia
    MS-Off Ver
    Excel 2013
    Posts
    1,714

    Re: Create all possible combinations using 2 columm (Data 1, Data 2)

    Hi
    try this macro

    it assumes that your input data (group, gender, ID) are in three adjacent columns

    select the data to parse (excluding column headings) and run the macro. It should copy your revised list into successive cells begining at cell G2

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    05-07-2013
    Location
    Salinas, Puerto Rico
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Create all possible combinations using 2 columm (Data 1, Data 2)

    Thanks NickC, your code was very close to produced the output I was hoping but I got incomplete combinations. Also, would it be possible to have output combinations parsed in three different columns?

    Grouping
    1 A D
    1 B D
    1 C D
    2 J N
    2 J O
    2 K N
    2 K O
    2 L N
    2 L O
    2 M N
    2 M O
    2
    2
    2
    2

  4. #4
    Forum Expert
    Join Date
    06-09-2010
    Location
    Australia
    MS-Off Ver
    Excel 2013
    Posts
    1,714

    Re: Create all possible combinations using 2 columm (Data 1, Data 2)

    Hi
    I'm not sure what you mean by "incomplete combinations", can you give more detail or upload an example spreadsheet?

    this version of the macro should put your data into adjacent columns

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Create 2 columns and populate variable data combinations
    By Pete123abc in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-18-2011, 12:35 PM
  2. [SOLVED] Create programmatically list of combinations for choices from data sets in excel vba
    By somethinglikeant in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-09-2010, 02:48 AM
  3. Create programmatically list of combinations for choices from data sets in excel vba
    By somethinglikeant in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-05-2006, 01:21 PM
  4. Create programmatically list of combinations for choices from data sets in excel vba
    By somethinglikeant in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-05-2006, 01:15 PM
  5. Replies: 0
    Last Post: 06-02-2006, 12:10 PM

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