+ Reply to Thread
Results 1 to 11 of 11

Finding the Values which nets to 0 using Solver - Help please

  1. #1
    Registered User
    Join Date
    09-14-2012
    Location
    India
    MS-Off Ver
    Excell 2010
    Posts
    22

    Exclamation Finding the Values which nets to 0 using Solver - Help please

    Folks,

    I am using solver to find out various netting's but i am not able to find the values which nets to zero .

    Example data:

    343
    234
    46
    567
    768
    8
    809
    987
    62
    -1234
    -632


    In this data if we totaled 8+809+987+62+ -1234 + -632 = 0

    Solver is not working if the target value is 0.

    Experts please help on this..

    Your responses are really appreciated..
    sample.xlsx
    Last edited by manoj.0790; 03-12-2013 at 01:15 AM.

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2504 Win 11
    Posts
    24,702

    Re: Finding the Values which nets to 0 using Solver - Help please

    Look at threads 5 and 6 of this link.

    http://www.excelforum.com/excel-form...o-a-total.html
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Registered User
    Join Date
    09-14-2012
    Location
    India
    MS-Off Ver
    Excell 2010
    Posts
    22

    Re: Finding the Values which nets to 0 using Solver - Help please

    Hi alansidman,

    First of all thanks for the response I will look into that link you provided and get back.

    Meanwhile let me ask you one thing, i have spoken with Solver help desk representative, he mentioned that solver will work for all target values including zero.

    but for me its working except zero. please let me know do i need to change any settings in solver?

    i.e Engine, values etc

    Thanks in advance,

    Quote Originally Posted by alansidman View Post
    Look at threads 5 and 6 of this link.

    http://www.excelforum.com/excel-form...o-a-total.html

  4. #4
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,784

    Re: Finding the Values which nets to 0 using Solver - Help please

    Solver is doing exactly what you tell it i.e. SUMPRODUCT(B2:B12,C2:C12) should be 0 and solver does that by setting all elements in range C2:C12 to 0.

    To get the kind of solution you wish for you must add constraints telling solver what it can't do.

    Try running solver on sheet "Solver_Constraint"

    Alf
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    09-14-2012
    Location
    India
    MS-Off Ver
    Excell 2010
    Posts
    22

    Re: Finding the Values which nets to 0 using Solver - Help please

    Hi Alf,

    Solver Constraint also doesnt give the exact value. i have tried giving constraints as much as possible but it doesnt seems working.

    if you know any other options please let me know, or if you can workout something it would be grateful.

    Thanks.

    Quote Originally Posted by Alf View Post
    Solver is doing exactly what you tell it i.e. SUMPRODUCT(B2:B12,C2:C12) should be 0 and solver does that by setting all elements in range C2:C12 to 0.

    To get the kind of solution you wish for you must add constraints telling solver what it can't do.

    Try running solver on sheet "Solver_Constraint"

    Alf

  6. #6
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,784

    Re: Finding the Values which nets to 0 using Solver - Help please

    Solver Constraint also doesnt give the exact value.
    ????

    See pgn Solver_1 and Solver_2

    Alf
    Attached Images Attached Images

  7. #7
    Registered User
    Join Date
    09-14-2012
    Location
    India
    MS-Off Ver
    Excell 2010
    Posts
    22

    Question Re: Finding the Values which nets to 0 using Solver - Help please

    Thats really Good its working, Please let me know the settings and which engine is used.

    And your solver looks different, please see the attached which is including screenshots and results.Solver_sample.xlsx



    Quote Originally Posted by Alf View Post
    ????

    See pgn Solver_1 and Solver_2

    Alf

  8. #8
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,784

    Re: Finding the Values which nets to 0 using Solver - Help please

    You are using Excel 2010 and I'm using the 2007 version of Solver that explains the difference in how the Solver set up looks. In options I've not set model as linear so my model will run GRG Nonlinear as well.

    As I to why you get decimal values and not binaries as I do I really can tell. I think I've stumbled over that problem before. Will check to my other solver postings and see if I can find that particular posting and report back in the meantime you could test setting range C2:C12 to both binary and integer. Not sure it will help but may be worth a try.

    Alf

  9. #9
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,784

    Re: Finding the Values which nets to 0 using Solver - Help please

    Hah! Found it " in the Solver setup dialog, click the Options button and look for a checkbox that says Ignore Integer Constraints on the All Methods tab." and remove check mark if found.

    From the "FrontlineSolver" info

    The Ignore Integer Constraints check box allows you to solve the “relaxation” of an integer programming problem, where the integer, binary, and alldifferent constraints are ignored, but all other constraints are enforced.
    Alf
    Last edited by Alf; 03-10-2013 at 05:49 PM.

  10. #10
    Registered User
    Join Date
    09-14-2012
    Location
    India
    MS-Off Ver
    Excell 2010
    Posts
    22

    Re: Finding the Values which nets to 0 using Solver - Help please

    Hi Alf,

    Yes, this works now..

    Thanks a lot.


    Quote Originally Posted by Alf View Post
    Hah! Found it " in the Solver setup dialog, click the Options button and look for a checkbox that says Ignore Integer Constraints on the All Methods tab." and remove check mark if found.

    From the "FrontlineSolver" info



    Alf

  11. #11
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,784

    Re: Finding the Values which nets to 0 using Solver - Help please

    Glad to be of help and thanks for feed back.

    Alf

+ 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