+ Reply to Thread
Results 1 to 4 of 4

Excel Solver finds an incorrect answer

  1. #1
    Registered User
    Join Date
    01-09-2016
    Location
    Poland
    MS-Off Ver
    2007
    Posts
    6

    Excel Solver finds an incorrect answer

    Hello,

    I have a spreadsheet with four sets of data (columns A-G), each column is multiplied by number defined under N2:T2). Result of calculation is in column I. The "proper" result is entered manually in column J.

    I try to use Excel Solver to solve the problem but for some reason I can't get proper results.

    variable cells: $N$2:$T$2
    objective: $K$9 to Min
    constraints:
    $I$2 = $J$2
    $I$4 = $j$4
    $I$6 = $j$6
    $I$8 = $j$8

    correct solution can be found in row 5 (0.26 for cell N2, 0.235 for cell O5 etc) but for some reason these are results provided by the Excel Solver (I use GPR non linear model)

    0.018854367 0.111766227 0 0.009738396 0.114344159 0.076039893 0.033181818

    Does someone has a clue why Excel Solver can't solve it properly?
    Attached Images Attached Images
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,814

    Re: Excel Solver finds an incorrect answer

    Check my logic: K9 is an ABS() function, so the minimum of this function should be 0 -- when all four values are equal, is that correct?

    Why is this set of values not The Correct (TM) solution? What makes the solution you posted more correct than this one? It appears to me that both solutions yield a minimum (0) in K9, which is what you have asked it to do?

    There are no shortage of numeric problems like this where there is more than one solution. Much of the time, if you want to find a specific solution when multiple solutions are possible, you need to know enough about your desired solution to give Excel/Solver a good starting guess so that it will converge on the correct solution. In this case, it looks like you are starting from the "all values are 0" starting point, and it is converging on the wrong solution. I have not studied your problem in detail, but I would suggest that you need to study this so that you will know what starting values to give Solver so it can converge on the correct solution.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  3. #3
    Registered User
    Join Date
    01-09-2016
    Location
    Poland
    MS-Off Ver
    2007
    Posts
    6

    Re: Excel Solver finds an incorrect answer

    Hi MrShorty. You are correct, the minimum of this function should be 0 -- when all four values are equal.

    The solution I posted is more correct because it matches also another sets of data (which are not available in the spreadsheet). You made a good point about good starting guess, I decided to add following boundaries for each variable cells:

    0.275 0.25 0.215 0.135 0.095 0.045 0.03
    0.245 0.22 0.185 0.105 0.065 0.015 0

    N2 must be higher or equal to 0.245 and lower or equal to 0.275 etc.

    Results are now better (0.247215955 0.22 0.185 0.103750758 0.085454674 0.037443151 0.016363606), closer to my solution but it's still a solution which won't fit another sets of data.

    Is there any way to force Excel Solver to look for solutions only through specified numbers? For example after setting boundaries Excel solver will try solutions with all numbers between 0.245 and 0.275 (for cell N2). Is there any way to force Excel Solver to instead use only following numbers?

    -0.275
    -0.274
    -0.273
    ...
    -0.247
    -0.246
    -0.245

    This way I would prevent Excel Solver from displaying numbers like 0.247215955084465 as solution

  4. #4
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,814

    Re: Excel Solver finds an incorrect answer

    I don't think there is any way to force Solver to use a "brute force" algorithm like that. You could simply program that brute force algorithm into the spreadsheet and sidestep Solver, but that seems overkill to me.

    Looking at your problem more carefully, it almost looks like a basic "solve a system of equations" kind of problem, where you have 4 equations and 7 unknowns. This kind of situation often yields a scenario where there are infinite solutions (even limiting the variables to narrow ranges). You say that there is another set of data that somehow determines which solution is correct. It seems to me that the best way to get your solution to be correct is to incorporate this additional data into your Solver model (or other algorithm).

    Since it looks like a "solve a system of equations" kind of problem, it might be of value to research other possible solutions. For example, one can use matrix algebra (and Excel's built in matrix functions like MINVERSE()) to solve systems of linear equations: http://www.excel-easy.com/examples/s...equations.html
    A couple of algebra lessons might also be useful:
    Solving systems of non-linear equations: http://www.purplemath.com/modules/syseqgen.htm
    solving systems of linear equations: http://www.purplemath.com/modules/systlin1.htm

    Whether you completely change tactics or not, I think the key to a good solution will be to bring the rest of the information from the other data set that decides which solution is correct and incorporate that into your algorithm.

+ 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. [SOLVED] Date formular gives incorrect answer
    By danbl in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 12-12-2016, 10:17 AM
  2. [SOLVED] incorrect answer
    By Excelski in forum Excel General
    Replies: 4
    Last Post: 06-30-2016, 12:23 PM
  3. How to get excel SOLVER to give out more than one answer??
    By KPee44 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-30-2015, 04:02 PM
  4. [SOLVED] Help with solver as solver gives wrong answer
    By syjytg in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 10-14-2013, 09:05 AM
  5. Replies: 1
    Last Post: 04-12-2011, 06:46 PM
  6. Vlookup incorrect answer
    By toclare84 in forum Excel General
    Replies: 9
    Last Post: 08-27-2010, 07:33 AM
  7. Sum Function sometimes displays incorrect answer
    By John Westgate in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-18-2005, 09:06 AM

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