+ Reply to Thread
Results 1 to 8 of 8

COMBINATIONS different group sizes

  1. #1
    Registered User
    Join Date
    04-30-2009
    Location
    Spain
    MS-Off Ver
    Excel 2010
    Posts
    88

    COMBINATIONS different group sizes

    Hi, I'm trying to develop a macro that generates all the possible outcomes of 5 variables intervals combined between them, Could you help me with this?

    1.The first problem I see is that the COMBINAT formula of excel works only for a constant number of alternatives for each variable but the number of elements in every interval is different for the different variables. Is the max number of alternatives in my example correct?

    2. Could you help me to write the code to avoid repeating the outputs? By now roughly I have the following:

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by dvb_24; 07-23-2009 at 10:39 AM. Reason: code tags

  2. #2
    Registered User
    Join Date
    04-30-2009
    Location
    Spain
    MS-Off Ver
    Excel 2010
    Posts
    88

    Re: COMBINATIONS different group sizes

    Can anyone at least give me an orientation of what I'm doing wrong?

  3. #3
    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 different group sizes

    1. Yes, it is, but the formulas could be simplified.

    In F3 and down, =IF(E3="", "", (D3-C3)/E3 + 1)

    In F8, =PRODUCT(F3:F7)

    2. What is the code supposed to do?

    Please take a few minutes to read the forum rules, and then edit your post to add code tags.
    Entia non sunt multiplicanda sine necessitate

  4. #4
    Registered User
    Join Date
    04-30-2009
    Location
    Spain
    MS-Off Ver
    Excel 2010
    Posts
    88

    Re: COMBINATIONS different group sizes

    Thanks for replying, my aim is to write all the possible combinations between the 5 variables intervals.

    For example, if v1 interval were from 0.8 to 0.85 with a step of 0.05 and v2 were from 18 to 10 with a step of 1 then

    0.8 0.8 0.85 0.85
    18 19 18 19

    Those will be all possible combinations on both intervals

    Let me know if I didn't explain that properly.

  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 different group sizes

    dvb, please change the QUOTE tags to CODE tags.

  6. #6
    Registered User
    Join Date
    04-30-2009
    Location
    Spain
    MS-Off Ver
    Excel 2010
    Posts
    88

    Re: COMBINATIONS different group sizes

    Done! sorry about that

    is my example clear enough?

  7. #7
    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 different group sizes

    Do this do what you want?
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    04-30-2009
    Location
    Spain
    MS-Off Ver
    Excel 2010
    Posts
    88

    Re: COMBINATIONS different group sizes

    Yes it does thanks but, is there any way to do it with code?

+ 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