+ Reply to Thread
Results 1 to 7 of 7

Get all combinations from 2 columns?

  1. #1
    Registered User
    Join Date
    09-21-2011
    Location
    Buenos Aires
    MS-Off Ver
    Excel 2003
    Posts
    2

    Get all combinations from 2 columns?

    Hi all,
    this is my first post here, hope someone can help me out.

    I have 2 colums with data

    Column A:
    AAA1
    AAA2
    AAA3
    AAA4

    Column B:
    BBB1
    BBB2
    BBB3
    BBB4
    BBB5
    BBB6

    You can get the idea, I need to have them combined in each row but still separated in 2 columns. Like this:

    Col A / Col B
    AAA1 / BBB1
    AAA1 / BBB2
    AAA1 / BBB3
    AAA1 / BBB4
    AAA1 / BBB5
    AAA1 / BBB6
    AAA2 / BBB1
    AAA2 / BBB2
    AAA2 / BBB3
    AAA2 / BBB4
    AAA2 / BBB5
    AAA2 / BBB6

    And so on. Thing is the real data is like 200 values in column A and 900 values in column B, so I cant do this manually.

    Ive attached a sample file so you can see exactly what Im looking.

    Thanks in advance!
    Attached Files Attached Files

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2505 Win 11
    Posts
    24,738

    Re: Get all combinations from 2 columns?

    This is a very quick and easy action for Access. If you have a copy of Access, you can make the values in each column a table and then create a query without joining the tables and the result is a cartesian solution which appears to be what you are looking for. You could also do this in Excel using MS Query.

    Alan
    Last edited by alansidman; 09-21-2011 at 04:41 PM.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Registered User
    Join Date
    09-21-2011
    Location
    Buenos Aires
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Get all combinations from 2 columns?

    Hi Alan, thanks for your answer. I dont know how to use access. Any other idea? Thanks!

  4. #4
    Registered User
    Join Date
    08-24-2011
    Location
    Bangalore
    MS-Off Ver
    Excel 2003
    Posts
    1

    Re: Get all combinations from 2 columns?

    Hope Help, find attached file
    Attached Files Attached Files

  5. #5
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2505 Win 11
    Posts
    24,738

    Re: Get all combinations from 2 columns?

    Here is a tutorial on MS Query. If you learn this, then the types of issues you are dealing with will go away very quickly.

    http://www.danflak.com/techtips/MS%20Query.pdf

    and here

    http://www.exceluser.com/explore/msquery1_1.htm

    Alan
    Last edited by alansidman; 09-22-2011 at 09:02 AM.

  6. #6
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2505 Win 11
    Posts
    24,738

    Re: Get all combinations from 2 columns?

    I created a step by step tutorial for you to follow to create what you want in MS Query. It is attached as a Word Document.
    Attached Files Attached Files

  7. #7
    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: Get all combinations from 2 columns?

    There's a workbook that does this at http://www.box.net/shared/ubd28tissi
    Entia non sunt multiplicanda sine necessitate

+ 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