+ Reply to Thread
Results 1 to 10 of 10

Can this be done in Solver? Simple problem

  1. #1
    Registered User
    Join Date
    11-10-2021
    Location
    Toronto, ON
    MS-Off Ver
    2007
    Posts
    4

    Can this be done in Solver? Simple problem

    Good morning all,

    I have a particular task I'm looking to accomplish using Excel's "Solver" or any of the "What-If-Analysis" tools.

    Would love to get some feedback on how to achieve my result.

    I'm looking to figure out how to optimize a (somewhat) simple problem.

    I tried to attach a screenshot to give a visual, but it seems like I can't (perhaps because I'm a brand new member to the forum).


    I have 3 columns: "Name", "Score", and "Salary"

    The rows under "Name" contain around 10-15 values
    The rows under "Score" contain a value for each (static, not changing)
    The rows under "Salary" contain a value for each (static, not changing). All "salaries" range between 6500 to 9900.

    The Goal / Desired result: Get the solver to tell me what the Maximum possible cumulative score would be, while following the constraints:

    -must use exactly 6 Names (anything more or less would not be valid)
    -the total salary (sum) of the 6 Names must be 50,000 or less. There is no minimum

    I am trying to determine the optimal solution to this problem, using the functionality of Excel.


    Thank you,
    Josh

  2. #2
    Forum Expert
    Join Date
    01-25-2011
    Location
    Belgium, Alveringem
    MS-Off Ver
    Excel 2003, 2007, 365
    Posts
    1,418

    Re: Can this be done in Solver? Simple problem

    like this ...
    Attached Files Attached Files
    Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

  3. #3
    Registered User
    Join Date
    11-10-2021
    Location
    Toronto, ON
    MS-Off Ver
    2007
    Posts
    4

    Re: Can this be done in Solver? Simple problem

    Amazing, thank you bsalv - i'm going to look into this now.

    Thanks for your help.

  4. #4
    Registered User
    Join Date
    11-10-2021
    Location
    Toronto, ON
    MS-Off Ver
    2007
    Posts
    4

    Re: Can this be done in Solver? Simple problem

    Bsalv - can I please ask some follow up questions?

    I inputted my own values, replacing the sample ones you gave me.

    Did you use any "solver" or "what-if-analysis" tools for this problem? Or did you just use the "SUMPRODUCT" function to solve the problem?

    How do I get the "binair" column to populate the "1"s automatically? Is there where solver comes into play?

    Thanks again!

  5. #5
    Forum Expert
    Join Date
    01-25-2011
    Location
    Belgium, Alveringem
    MS-Off Ver
    Excel 2003, 2007, 365
    Posts
    1,418

    Re: Can this be done in Solver? Simple problem

    I used "oplosser" (Solver in dutch), that's under my "data" menu in the ribbon.
    There you define
    * maximize B18
    * with variables D2:D16
    * constraints
    - D2:D16 are binary (0/1)
    - total salary (C18) <= 50.000 (C20)
    - number of persons (D18) = 6 (D20)

    When all those things are done, push the button at the bottom "Oplossen/Solve" and wait 1 minute.
    Attached Images Attached Images

  6. #6
    Valued Forum Contributor Hydraulics's Avatar
    Join Date
    07-15-2018
    Location
    Udine - Italy
    MS-Off Ver
    Office 365
    Posts
    373

    Re: Can this be done in Solver? Simple problem

    You should use Simplex engine, this is a MILP problem.

    It's faster (much faster), and the solution is guaranteed to be optimal.

    HTH,

    Francesco
    Attached Files Attached Files
    Aim high or don't even try.
    ---------------------------------
    If your question has been answered, don't forget to mark the thread as SOLVED.
    If you find an answer helpful, click on the star icon at the bottom of the post.

  7. #7
    Forum Expert
    Join Date
    01-25-2011
    Location
    Belgium, Alveringem
    MS-Off Ver
    Excel 2003, 2007, 365
    Posts
    1,418

    Re: Can this be done in Solver? Simple problem

    You should use Simplex engine, this is a MILP problem.
    Oké, I agree !

  8. #8
    Registered User
    Join Date
    11-10-2021
    Location
    Toronto, ON
    MS-Off Ver
    2007
    Posts
    4

    Re: Can this be done in Solver? Simple problem

    Hello Bsalv & Hydraulics,

    Thank you again for sharing your knowledge with me.

    Hydraulics - I see your suggestion to use Simplex engine. And from playing around with the two models, I am noticing that yours ("Simplex") provides the absolute optimal solution, while Bsalv's version provided a valid solution, but not the optimal one.

    What did you do differently in yours, Hydraulics? It appears to me the Solver constraints were set up identically to Bsalv's. How did you utilize "Simplex" in your model?


    EDIT: I don't seem to have an option to use "Simplex" as a solving method......maybe its the version of Excel i'm using? (2003)

    EDIT 2: Yes, it appears to be my Excel version. I am now working on the work laptop instead

    My new question is how did you set up the 3rd constraint? When I try to tell it that $D2:$D$16 is supposed to equal "binary", it tells me that the constraint must be a number, simple reference, or formula with a numeric value.
    Last edited by El_Gato_Diablo666; 11-11-2021 at 12:02 AM.

  9. #9
    Forum Expert
    Join Date
    01-25-2011
    Location
    Belgium, Alveringem
    MS-Off Ver
    Excel 2003, 2007, 365
    Posts
    1,418

    Re: Can this be done in Solver? Simple problem

    when choicing another option in the 2nd box, the 3rd one must be empty !
    Attached Images Attached Images

  10. #10
    Valued Forum Contributor Hydraulics's Avatar
    Join Date
    07-15-2018
    Location
    Udine - Italy
    MS-Off Ver
    Office 365
    Posts
    373

    Re: Can this be done in Solver? Simple problem

    Quote Originally Posted by El_Gato_Diablo666 View Post
    EDIT: I don't seem to have an option to use "Simplex" as a solving method......maybe its the version of Excel i'm using? (2003)
    If I'm not mistaken, under Excel 2003, go to Options from the Solver window and check "Assume Linear Model".

    HTH,

    Francesco

+ 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. Simple Open Solver Setup Not Working
    By chicagoland8 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-02-2018, 12:44 AM
  2. Replies: 7
    Last Post: 12-31-2016, 12:29 PM
  3. Solver, goal seek or more simple formula
    By faodavid in forum Excel General
    Replies: 5
    Last Post: 09-16-2015, 10:44 AM
  4. Problem Using Solver with an optimization stock problem
    By Jagrubski in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-24-2013, 03:41 AM
  5. Solve a simple equation using solver
    By crf1722 in forum Excel General
    Replies: 2
    Last Post: 06-16-2011, 03:30 PM
  6. Simple Equation Builder/Solver in Excel for use in Dell Axim X51v
    By Clarence Crow in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 07-21-2006, 04:20 PM
  7. Interesting Solver problem (Solver encounters an error)
    By MrShorty in forum Excel General
    Replies: 3
    Last Post: 12-22-2005, 06:55 PM

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