+ Reply to Thread
Results 1 to 8 of 8

Combination Sum

  1. #1
    Registered User
    Join Date
    11-14-2010
    Location
    Kelowna, Canada
    MS-Off Ver
    Excel 2007
    Posts
    7

    Combination Sum

    Hi,

    I'm not sure if excel is powerful enough for this but I need to find a particular combination of numbers that add up to 188,280 from a table of numbers. I can't do this manually as I tried 5 options, even though it seems like a better option :P

    If excel isn't the best thing, I'll need something else.
    Attached Files Attached Files
    Last edited by Murellus; 11-14-2010 at 12:43 PM.

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Simple Function Question

    Murellus - Welcome to the Board please note however that your original title falls foul of Rule 1 of the Board's RULES
    Given this is your first post I have on this occasion modified the title for you.

    Regards the question see below for an overview of the issue (and possibly solution pending requirements):

    http://www.excelforum.com/tips-and-t...tion-sums.html

  3. #3
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,241

    Re: Combination Sum

    Hi Murellus,

    It looks like there are a few answers. I created a random number generator and let it run until it worked. See code and formulas in the attached.
    Attached Files Attached Files
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  4. #4
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,241

    Re: Combination Sum

    Wow, I'm glad I didn't read DonkeyOte answer that pointed to shg answer that made this problem sound hard.

    I would have never tried a random number generator if I thought there was no answer.

  5. #5
    Registered User
    Join Date
    11-14-2010
    Location
    Kelowna, Canada
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Combination Sum

    Thanks for the responses. Ok I see why this is tough now. I've tried to copy the data that I have into the template (I really don't know VBA) and I'm getting a 'This isn't a linear problem' from Solver and I'm not sure why? (When I use solver I just typically look for any division signs but I can't see any).

    I've attached my modified template. If anyone can help tell me why I'm getting a linear error problem with Solver, that would be great!
    Attached Files Attached Files

  6. #6
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Combination Sum

    here its done with solver
    adjusted the tolerances a bit and also added constraint of integer as well as binary as for some strange reason the binary constraint doesn't always hold true
    Attached Files Attached Files
    Last edited by martindwilson; 11-14-2010 at 06:32 AM.
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  7. #7
    Registered User
    Join Date
    11-14-2010
    Location
    Kelowna, Canada
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Combination Sum

    Tyvm! I'm also just wondering what values you put in for the Load Model input in Options in Solver?

  8. #8
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Combination Sum

    Load Model input ?
    see screen shots in attached
    Attached Files Attached Files
    Last edited by martindwilson; 11-14-2010 at 08:03 AM.

+ 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