+ Reply to Thread
Results 1 to 4 of 4

Stuck again!!

  1. #1
    Registered User
    Join Date
    01-17-2007
    Posts
    12

    Stuck again!!

    Hi ya'll,
    I'm having a bit of a problem with trying to make up a formula for my project... what I need is this..

    Take a number say 198, in cell A1 for example..
    I need a formula which will list all the possible 6 number group combinations utilizing the number range 1 thru 56 for the first 5 groups and the number range 1 thru 46 for the 6th number group which when added up will total
    198, examples:

    22 33 35 40 53 15 = 198
    or
    5 9 15 21 32 9 = 91
    Numbers in the first 5 number groups can't repeat, they all use the same number range 1-56. The last number group has it's own number range of
    1-46, so it's possible for numbers to repeat here. Know there are many combinations/possibilities but if someone could come up with a formula for this I'd appreciate it, tks.

    griz

  2. #2
    Forum Contributor
    Join Date
    03-13-2005
    Posts
    6,195
    Quote Originally Posted by grizrowe
    Hi ya'll,
    I'm having a bit of a problem with trying to make up a formula for my project... what I need is this..

    Take a number say 198, in cell A1 for example..
    I need a formula which will list all the possible 6 number group combinations utilizing the number range 1 thru 56 for the first 5 groups and the number range 1 thru 46 for the 6th number group which when added up will total
    198, examples:

    22 33 35 40 53 15 = 198
    or
    5 9 15 21 32 9 = 91
    Numbers in the first 5 number groups can't repeat, they all use the same number range 1-56. The last number group has it's own number range of
    1-46, so it's possible for numbers to repeat here. Know there are many combinations/possibilities but if someone could come up with a formula for this I'd appreciate it, tks.

    griz
    Hi,

    the site
    http://www.dailydoseofexcel.com/arch...sum-to-target/
    should provide a starting point for solving your problem.

    hth
    ---
    Si fractum non sit, noli id reficere.

  3. #3
    Registered User
    Join Date
    01-17-2007
    Posts
    12
    I found this macro on the net which does something similar to what I need to not quite. can someone look at his macro and modify it to do what I need?
    Please Login or Register  to view this content.
    Last edited by Bryan Hessey; 02-20-2007 at 07:06 PM.

  4. #4
    Forum Contributor
    Join Date
    03-13-2005
    Posts
    6,195
    Quote Originally Posted by grizrowe
    I found this macro on the net which does something similar to what I need to not quite. can someone look at his macro and modify it to do what I need?
    Please Login or Register  to view this content.
    I have no idea what that does, but what you appear to need is 6 loops,
    the first loop from 1 to 56
    within that the second loop 1 to 56
    .. within that the third loop 1 to 56
    ... within that the fourth loop 1 to 56
    .... within that trhe fifth loop 1 to 56
    ..... within that the sixth loop 1 to 46

    and if your loop counters add up to 198 then store those counters on a row (first counter in column B etc with Range("B"& RowCount).value = ctr1, Range("C"& RowCount).value = ctr2, etc) and then up the row count by 1.

    Should be easy enough to modify as per the macro,

    hth
    ---

+ 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