+ Reply to Thread
Results 1 to 6 of 6

How to get all possible combos from five columns

Hybrid View

  1. #1
    Registered User
    Join Date
    08-11-2015
    Location
    New York
    MS-Off Ver
    2010
    Posts
    4

    How to get all possible combos from five columns

    Hi Guys,

    I'm new here, so I hope I'm posting this in the right place. Basically what I'm trying to do is take 5 different columns, all of which have an "X" or an "O" flag, and determine all of the unique combinations. I'm pretty sure there are going to be 120 unique combinations (by using 5!). I did some searching online and found some various macros, but nothing that fit exactly what I'm trying to do. Below is rough outline of what I'm hoping to achieve:

    Column A Column B Column C Column D Column E
    O O O O X
    O O O X X
    O O X X X
    etc., etc., etc.

    Hope this makes sense - if anyone could point me in the right direction with figuring out this problem that would be much appreciated. Thanks.

  2. #2
    Forum Contributor
    Join Date
    07-13-2015
    Location
    Quebec, Canada
    MS-Off Ver
    2013
    Posts
    232

    Re: How to get all possible combos from five columns

    Actually, there are 2^5 = 32 combinations.
    (sorry I can't help more for now just wanted to point it out)

  3. #3
    Registered User
    Join Date
    08-11-2015
    Location
    New York
    MS-Off Ver
    2010
    Posts
    4

    Re: How to get all possible combos from five columns

    Ah okay. Originally I thought it was 5^2, and then someone else thought it was 5!, and I was messing around with some VBA that was yielding 120 results. Either way, do you know a way to generate/automate all of these combos?

  4. #4
    Forum Expert
    Join Date
    03-20-2015
    Location
    Primarily UK, sometimes NL
    MS-Off Ver
    Work: Office 365 / Home: Office 2010
    Posts
    2,405

    Re: How to get all possible combos from five columns

    No need for a macro, just continue to do the pattern you did, filling in one X, then two Xs, etc. You'll find there are 32 combinations (2^5 = 2*2*2*2*2).

    Edit - beaten to it.

    Regards,
    Aardigspook

    If your problem is solved, please go to 'Thread Tools' above your first post and 'Mark Thread as Solved'.
    You don't need to give me rep if I helped, but thanks are appreciated.
    Last edited by Aardigspook; 08-12-2015 at 09:10 AM. Reason: beaten to it

  5. #5
    Registered User
    Join Date
    08-11-2015
    Location
    New York
    MS-Off Ver
    2010
    Posts
    4

    Re: How to get all possible combos from five columns

    That's an option for sure, but I was hoping for a more expedited/scalable option. If I had to re-run a similar project but with 10 columns then writing out all of the combinations manually wouldn't really be feasible.

  6. #6
    Registered User
    Join Date
    08-11-2015
    Location
    New York
    MS-Off Ver
    2010
    Posts
    4

    Re: How to get all possible combos from five columns

    I was able to find the answer using the following site in case anyone is curious - http://stackoverflow.com/questions/1...ion-of-a-range

+ 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. Display all different combos
    By Vic_from_sweden in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-20-2015, 12:21 PM
  2. Replies: 0
    Last Post: 02-12-2014, 08:22 AM
  3. Working with dependent combos
    By s_samira_21 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-02-2013, 02:50 AM
  4. [SOLVED] HELP: Find repeating combos ?
    By Mr.Nob0OOdy in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-30-2012, 05:49 AM
  5. VLOOKUP and IF STATEMENT Combos
    By NCAA in forum Excel General
    Replies: 9
    Last Post: 04-12-2012, 05:11 PM
  6. combos and dates
    By Shorty in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-02-2006, 12:30 PM
  7. too many combos
    By VOG in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-13-2005, 01:05 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