+ Reply to Thread
Results 1 to 16 of 16

Unique Combinations from 4 Columns

  1. #1
    Registered User
    Join Date
    05-29-2013
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    37

    Unique Combinations from 4 Columns

    Hi

    I'm new to the forums, so I apologize if it sounds like I'm posting a question that's already been answered! I've scoured the entire website trying to look for a macro (or function) that will create unique combinations from a given list in adjacent columns.

    So basically, I have:

    A 1 F1 R1
    B 2 F2
    C F3
    D
    E

    And i'm trying to list all the information as (in the same worksheet and in different columns):

    A 1 F1 R1
    A 1 F2 R1
    A 1 F3 R1
    A 2 F1 R1
    A 2 F2 R1
    A 2 F3 R1
    B 1 F1 R1
    B 1 F2 R1
    B 1 F3 R1
    B 2 F1 R1
    B 2 F2 R1
    B 2 F3 R1
    ...etc.

    (added bonus for being able to toggle where the list is printed on the sheet)

    Please help!

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

    Re: Unique Combinations from 4 Columns

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

  3. #3
    Registered User
    Join Date
    05-29-2013
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    37

    Re: Unique Combinations from 4 Columns

    Hey shg, unfortunately the website is blocked at work. Is there another website or perhaps could you attach the file to your post?

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

    Re: Unique Combinations from 4 Columns

    Attached .
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    05-29-2013
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    37

    Re: Unique Combinations from 4 Columns

    you're the best.<3

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

    Re: Unique Combinations from 4 Columns

    You're welcome.

  7. #7
    Registered User
    Join Date
    02-25-2008
    Posts
    29

    Re: Unique Combinations from 4 Columns

    Hello There,

    Very good macros, by any chance if you have time can you modify it in order to skip the cells that are blanks because they are counted in the combination.
    The are cases here when some columns have blanks cells so the shouldn't be in the combination series .

    Thanks for support

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

    Re: Unique Combinations from 4 Columns

    It does not use blank cells; see the example that's there. Your cells aren't blank.

    There's a later version of the workbook at https://app.box.com/s/47b28f19d794b25511be
    Last edited by shg; 10-12-2013 at 03:10 PM.

  9. #9
    Registered User
    Join Date
    02-25-2008
    Posts
    29

    Re: Unique Combinations from 4 Columns

    Thanks for the new version, as it stands with 4 columns, yes indeed there is no blanks in the combinations, but if i add a new column, it takes in account the blanks from the columns
    The idea is that i need to use more then 4 columns to make combinations
    Last edited by teodormircea; 10-12-2013 at 04:38 PM.

  10. #10
    Registered User
    Join Date
    02-25-2008
    Posts
    29

    Re: Unique Combinations from 4 Columns

    Also very strange, i don't know if is from my version of excel, I add a new value to one of the columns,the macros is taking the blanks in the combinations.

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

    Re: Unique Combinations from 4 Columns

    Post your version that doesn't work.

  12. #12
    Registered User
    Join Date
    02-25-2008
    Posts
    29

    Re: Unique Combinations from 4 Columns

    Here the link to the results
    https://app.box.com/s/bh09cw8v8c2bf4xybkqw

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

    Re: Unique Combinations from 4 Columns

    I see the blanks as you posted it. I press Run and the blanks go away.

  14. #14
    Registered User
    Join Date
    02-25-2008
    Posts
    29

    Re: Unique Combinations from 4 Columns

    I use excel 2013. i will change to 2010

  15. #15
    Registered User
    Join Date
    02-25-2008
    Posts
    29

    Re: Unique Combinations from 4 Columns

    Well is doing the same thing, should something wring with the excel configuration

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

    Re: Unique Combinations from 4 Columns

    How is the data getting into those cells?

    What happens if you clear what appear to be the blank cells?

+ 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