+ Reply to Thread
Results 1 to 15 of 15

How to find all possible combinations of 2 identical sets of data without duplicates?

  1. #1
    Registered User
    Join Date
    04-18-2016
    Location
    New York, New York
    MS-Off Ver
    2010
    Posts
    9

    How to find all possible combinations of 2 identical sets of data without duplicates?

    So I have 4 columns in this table:

    Color1 Color 2 Color 3 Color 4

    Yellow Yellow Blue Blue

    Pink Pink Brown Brown

    White White Black Black

    SO my goal is to create all possible combinations without having duplicates. I was thinking of using Cartesian join, but I'm not sure if that will work with multiple tables. Anyone have a way to do this without VBA?
    End result looks something like this:
    Yellow Pink Blue Brown
    Yellow Pink Blue Brown
    Yellow Pink Blue Black
    Yellow Pink Brown Black
    ect..

  2. #2
    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: How to find all possible combinations of 2 identical sets of data without duplicates?

    Welcome to the board.

    You could use the workbook at https://app.box.com/s/47b28f19d794b25511be to generate the Cartesian product via formulas or VBA, and then filter to get the 36 distinct results:

    B
    C
    D
    E
    F
    G
    7
    Filter
    18
    Yellow Pink Blue Brown
    1
    F18: =--(SUMPRODUCT(1/COUNTIF(B18:E18,B18:E18)) = 4)
    19
    Yellow Pink Blue Black
    1
    20
    Yellow Pink Brown Blue
    1
    22
    Yellow Pink Brown Black
    1
    23
    Yellow Pink Black Blue
    1
    24
    Yellow Pink Black Brown
    1
    27
    Yellow White Blue Brown
    1
    28
    Yellow White Blue Black
    1
    29
    Yellow White Brown Blue
    1
    31
    Yellow White Brown Black
    1
    32
    Yellow White Black Blue
    1
    33
    Yellow White Black Brown
    1
    36
    Pink Yellow Blue Brown
    1
    37
    Pink Yellow Blue Black
    1
    38
    Pink Yellow Brown Blue
    1
    40
    Pink Yellow Brown Black
    1
    41
    Pink Yellow Black Blue
    1
    42
    Pink Yellow Black Brown
    1
    54
    Pink White Blue Brown
    1
    55
    Pink White Blue Black
    1
    56
    Pink White Brown Blue
    1
    58
    Pink White Brown Black
    1
    59
    Pink White Black Blue
    1
    60
    Pink White Black Brown
    1
    63
    White Yellow Blue Brown
    1
    64
    White Yellow Blue Black
    1
    65
    White Yellow Brown Blue
    1
    67
    White Yellow Brown Black
    1
    68
    White Yellow Black Blue
    1
    69
    White Yellow Black Brown
    1
    72
    White Pink Blue Brown
    1
    73
    White Pink Blue Black
    1
    74
    White Pink Brown Blue
    1
    76
    White Pink Brown Black
    1
    77
    White Pink Black Blue
    1
    78
    White Pink Black Brown
    1
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    04-18-2016
    Location
    New York, New York
    MS-Off Ver
    2010
    Posts
    9

    Re: How to find all possible combinations of 2 identical sets of data without duplicates?

    thanks! Now say I had 5 columns. Do you know how I could do that?

  4. #4
    Registered User
    Join Date
    04-18-2016
    Location
    New York, New York
    MS-Off Ver
    2010
    Posts
    9

    Re: How to find all possible combinations of 2 identical sets of data without duplicates?

    nvm I figured it out. Thank you so much!

  5. #5
    Registered User
    Join Date
    04-18-2016
    Location
    New York, New York
    MS-Off Ver
    2010
    Posts
    9

    Re: How to find all possible combinations of 2 identical sets of data without duplicates?

    Actually nvm I figured it out. However how did you filter it?

  6. #6
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,776

    Re: How to find all possible combinations of 2 identical sets of data without duplicates?

    Cheers,
    Paul Edstein
    [Fmr MS MVP - Word]

  7. #7
    Registered User
    Join Date
    04-18-2016
    Location
    New York, New York
    MS-Off Ver
    2010
    Posts
    9

    Re: How to find all possible combinations of 2 identical sets of data without duplicates?

    Thanks. But the other place I couldn't find an answer so I'm trying to find it here. Do you know how to make that filter column?

  8. #8
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,776

    Re: How to find all possible combinations of 2 identical sets of data without duplicates?

    Quote Originally Posted by Jmmcintosh21 View Post
    But the other place I couldn't find an answer
    Without wanting to place too fine a point on it, the gap of a mere 6 minutes between starting the two threads hardly justifies your assertion that the lack of response there motivated posting here.
    Quote Originally Posted by Jmmcintosh21 View Post
    so I'm trying to find it here.
    And that doesn't exempt you from the forum rules...

  9. #9
    Registered User
    Join Date
    04-18-2016
    Location
    New York, New York
    MS-Off Ver
    2010
    Posts
    9

    Re: How to find all possible combinations of 2 identical sets of data without duplicates?

    Ahh ok, well thanks for explaining that. New to forum and didn't know the rules.

  10. #10
    Registered User
    Join Date
    04-18-2016
    Location
    New York, New York
    MS-Off Ver
    2010
    Posts
    9

    Re: How to find all possible combinations of 2 identical sets of data without duplicates?

    Hey Shg do you think you could explain how you managed to filter the data?

  11. #11
    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: How to find all possible combinations of 2 identical sets of data without duplicates?

    You filter for 1.

    If there are more or fewer than 4 columns in the table, the 4 in the formula needs to be changed to agree.

  12. #12
    Registered User
    Join Date
    04-18-2016
    Location
    New York, New York
    MS-Off Ver
    2010
    Posts
    9

    Re: How to find all possible combinations of 2 identical sets of data without duplicates?

    Hmm, i'm still running into a bit of confusion. I tried to post an image of what I have so far. I'm confused on how you get that filter column to even appear and even more confused on how you added that '1' to it. :S Thanks for your help so far.

    exampleex.png
    Last edited by Jmmcintosh21; 04-19-2016 at 09:11 PM.

  13. #13
    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: How to find all possible combinations of 2 identical sets of data without duplicates?

    I generated the arrangments, and then added the formula in a convenient column. See attached.
    Attached Files Attached Files

  14. #14
    Registered User
    Join Date
    04-18-2016
    Location
    New York, New York
    MS-Off Ver
    2010
    Posts
    9

    Re: How to find all possible combinations of 2 identical sets of data without duplicates?

    Dude your a beast. I understand it now. Thanks so much. This may be a little much since its not the original question but I didn't realize that the same lines could appear in a different order.

    For example:
    yellow pink blue brown
    pink yellow brown blue

    Do you have any ideas to be able to pinpoint all of these. Maybe sorting or conditional formatting. Its ok if you don't know I was just curious. Thanks for all your help again. Really appreciate it.
    Last edited by Jmmcintosh21; 04-20-2016 at 03:31 PM.

  15. #15
    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: How to find all possible combinations of 2 identical sets of data without duplicates?

    So all you want is combinations of different colors? That's a totally different animal than a Cartesian product.

    Please think before answering.

+ 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. [SOLVED] Find duplicates between two data sets and display on seperate sheet
    By nicki_rae22 in forum Excel General
    Replies: 2
    Last Post: 03-04-2014, 02:40 PM
  2. Merging two similar sets of data without duplicates
    By mikaselm in forum Excel General
    Replies: 4
    Last Post: 09-26-2012, 05:14 PM
  3. Replies: 0
    Last Post: 06-28-2012, 05:04 AM
  4. Duplicates - 2 Sets of Unique Data
    By Lurchy24 in forum Excel General
    Replies: 2
    Last Post: 10-18-2011, 09:49 AM
  5. 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
  6. Replies: 1
    Last Post: 07-22-2010, 08:39 AM
  7. 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
  8. 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

Tags for this Thread

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