+ Reply to Thread
Results 1 to 7 of 7

List ALL possible combinations

  1. #1
    Registered User
    Join Date
    07-26-2013
    Location
    Dallas, Texas
    MS-Off Ver
    Excel 2010
    Posts
    20

    List ALL possible combinations

    In regards to 'y' combinations of 'n' objects; is there any quick/easy way for excel to generate and display a list of all possible combination pairings or matchings? NOTE: I don't mean display the total number of possible combinations 'y', but rather, I want to see WHAT all the possible combinations actually are.

    For example: If 'n' number of objects consisted of 3 red shirts, 2 blue shirts, and 1 yellow shirt, and I wanted to know what all the possible combinations are if I can only select 2 shirts at a time,... can excel create a list of all combos displaying in such a manner like: [Red shirt #2, Blue shirt #2], [Yellow, Red shirt #1], [Blue shirt #1, Blue shirt #2], etc... ? Is that possible?

    I believe this would be considered a 'Brute Force' technique.

  2. #2
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,396

    Re: List ALL possible combinations

    Will something like this cover it?

    Formula in B2 filled across and down.
    Formula: copy to clipboard
    Please Login or Register  to view this content.



    Row\Col
    A
    B
    C
    D
    E
    F
    G
    1
    Red 1 Red 2 Red 3 Blue 1 Blue 2 Yellow
    2
    Red 1
    3
    Red 2 Red 1 Red 2
    4
    Red 3 Red 1 Red 3 Red 2 Red 3
    5
    Blue 1 Red 1 Blue 1 Red 2 Blue 1 Red 3 Blue 1
    6
    Blue 2 Red 1 Blue 2 Red 2 Blue 2 Red 3 Blue 2 Blue 1 Blue 2
    7
    Yellow Red 1 Yellow Red 2 Yellow Red 3 Yellow Blue 1 Yellow Blue 2 Yellow
    Dave

  3. #3
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,396

    Re: List ALL possible combinations

    If you prefer a list use the above as a helper. Then array enter this monster (compliments of XOR LX) and fill down.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    If you aren’t familiar with array-entered formulas array enter means the formula must be committed from edit mode by simultaneously pressing and holding down Ctrl and Shift while hitting Enter.
    Attached Files Attached Files

  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: List ALL possible combinations

    There's a workbook at https://app.box.com/s/b9b9fc06beb63b9562f9 that will do this:

    B
    C
    2
    n
    3
    6
    4
    mMin
    5
    2
    6
    mMax
    7
    2
    8
    nComb
    9
    15
    10
    11
    m
    red#1 red#2 red#3 blu#1 blu#2 yel#1
    12
    2
    red#2 red#1
    13
    2
    red#3 red#1
    14
    2
    red#3 red#2
    15
    2
    blu#1 red#1
    16
    2
    blu#1 red#2
    17
    2
    blu#1 red#3
    18
    2
    blu#2 red#1
    19
    2
    blu#2 red#2
    20
    2
    blu#2 red#3
    21
    2
    blu#2 blu#1
    22
    2
    yel#1 red#1
    23
    2
    yel#1 red#2
    24
    2
    yel#1 red#3
    25
    2
    yel#1 blu#1
    26
    2
    yel#1 blu#2
    Entia non sunt multiplicanda sine necessitate

  5. #5
    Registered User
    Join Date
    07-26-2013
    Location
    Dallas, Texas
    MS-Off Ver
    Excel 2010
    Posts
    20

    Re: List ALL possible combinations

    Yes, that works great. Thank you!!

  6. #6
    Registered User
    Join Date
    07-26-2013
    Location
    Dallas, Texas
    MS-Off Ver
    Excel 2010
    Posts
    20

    Re: List ALL possible combinations

    Yes! This is exactly what I was looking for. Thanks!

    Question though:

    It appears that one would need to rely on a macro to accomplish this, as there seems to be no built-in functions or features in excel to do so... is that correct?

  7. #7
    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: List ALL possible combinations

    You're welcome.

    as there seems to be no built-in functions or features in excel to do so
    There are no built-in functions, but it can be done: https://app.box.com/shared/nqljsd3nlu
    Last edited by shg; 04-30-2016 at 12:06 PM.

+ 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. List combinations VBA
    By BarstoolProphet in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 09-07-2015, 07:32 PM
  2. List all combinations from 1 to 45
    By a1b2c3d4e5f6g7 in forum Excel General
    Replies: 4
    Last Post: 07-21-2014, 07:29 AM
  3. Need a list of combinations
    By Iduno in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-18-2013, 11:11 AM
  4. list possible combinations of 6 from 22
    By nlscarter in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-19-2013, 10:13 PM
  5. [SOLVED] List all combinations
    By olives in forum Excel Formulas & Functions
    Replies: 21
    Last Post: 02-12-2013, 01:23 AM
  6. List Possible Combinations
    By Rizzle in forum Excel General
    Replies: 10
    Last Post: 09-29-2010, 09:36 AM
  7. [SOLVED] List all possible combinations
    By Spencer Hutton in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-13-2005, 04:06 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