+ Reply to Thread
Results 1 to 9 of 9

Combinations of 4 variables with 3 values each

  1. #1
    Registered User
    Join Date
    09-20-2010
    Location
    Davis, Calif.
    MS-Off Ver
    Excel 2007
    Posts
    2

    Combinations of 4 variables with 3 values each

    Hi, I'm pretty new to Excel and am trying to find a way to automatically generate all possible combinations (order not important) of 4 variables (A, B, C, D) with 3 values (1, 2, 3) each.

    So there are only 12 possible variable+values:

    A1, A2, A3, B1, B2, B3, C1, C2, C3, D1, D2, D3


    Each combination must have one instance of each variable.

    For example:

    A1, B2, C3, D1
    A2, B3, C1, D3

    I think there are 81 different combinations, and I want to put them in 81 rows and then drag a formula down the next column to apply to each row.

    Thanks in advance for any help....
    Last edited by ponjovi; 09-20-2010 at 12:45 PM.

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,058

    Re: Combinations of 4 variables with 3 values each

    Here, see this:
    Attached Files Attached Files
    Never use Merged Cells in Excel

  3. #3
    Registered User
    Join Date
    09-20-2010
    Location
    Davis, Calif.
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Combinations of 4 variables with 3 values each

    zbor, just what I needed, thanks!

    I don't understand the formula off the bat, but I will see if I can try to learn what you did.
    Last edited by ponjovi; 09-20-2010 at 10:00 AM.

  4. #4
    Registered User
    Join Date
    08-09-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    1

    Re: Combinations of 4 variables with 3 values each

    Awesome!

    Now, if I wanted to have variables C & D have 6 values each, how would I change the formula?

  5. #5
    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: Combinations of 4 variables with 3 values each

    There's a workbook that will do this at https://www.box.com/s/47b28f19d794b25511be
    Entia non sunt multiplicanda sine necessitate

  6. #6
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,167

    Re: Combinations of 4 variables with 3 values each

    Davidaw,

    Welcome to the Forum, unfortunately:

    Your post does not comply with Rule 2 of our Forum RULES. Don't post a question in the thread of another member -- start your own thread. If you feel it's particularly relevant, provide a link to the other thread. It makes sense to have a new thread for your question because a thread with numerous replies can be off putting & difficult to pick out relevant replies.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  7. #7
    Registered User
    Join Date
    02-24-2021
    Location
    Pakistan
    MS-Off Ver
    2016
    Posts
    2

    Re: Combinations of 4 variables with 3 values each

    Can anyone tell me the formula to generate this combination? The excel provided has fixed values like A B C D What if the varaibles are diffenr?

  8. #8
    Registered User
    Join Date
    02-24-2021
    Location
    Pakistan
    MS-Off Ver
    2016
    Posts
    2

    Re: Combinations of 4 variables with 3 values each

    Hi can you post a formula that can help with this? Because the file you shared is for fixed variables.

  9. #9
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,049

    Re: Combinations of 4 variables with 3 values each

    Quote Originally Posted by the-heart-wants View Post
    Can anyone tell me the formula to generate this combination? The excel provided has fixed values like A B C D What if the varaibles are diffenr?
    Administrative Note:

    Welcome to the forum.

    We are happy to help, however whilst you feel your request is similar to this thread, experience has shown that things soon get confusing when answers refer to particular cells/ranges/sheets which are unique to your post and not relevant to the original.

    Please see Forum Rule #4 about hijacking and start a new thread for your query.

    If you are not familiar with how to start a new thread see the FAQ: How to start a new thread
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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