+ Reply to Thread
Results 1 to 6 of 6

Using the Solver function to calculate a schedule.

  1. #1
    Registered User
    Join Date
    05-25-2012
    Location
    Eagle River, Alaska
    MS-Off Ver
    MS Office 365 (Excel ver. 2304)
    Posts
    16

    Using the Solver function to calculate a schedule.

    I have "tinkered" with this spreadsheet and watched more than a few online videos trying to get Solver to make a schedule using the goal and constraints needed. While I can get it to calculate an answer, it is not doing so efficiently. The goal should be the minimum (highlighted in orange), based on the actual number of personnel scheduled. Instead, it seems to want to focus on spreading the hours out evenly among whoever is available for the day.

    The first tab is the kind of results I am hoping for and the next tabs are the different results I have gotten depending on the value I start with in the data cells.

    Any guidance would be greatly appreciated. I feel like I must be missing a step.

    Thank you,

    Michael
    Attached Files Attached Files

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

    Re: Using the Solver function to calculate a schedule.

    There are good news and bad news.

    The good news is that your problem can be solved to optimality (best solution is 21).

    The bad news is that you have to add a new set of (binary) variables, and Solver will complain that the problem is too complex. Therefore you need to install OpenSolver, a free and open source add-in.

    The problem lies in your COUNTIF() function in row 22, that is non-linear. We can use a workaround, defining a new set of vars for each employee and day of the week. If we can force these vars to switch to one when the corresponding integer var is greater than zero, we could use a simple SUM() function, which is linear, and then minimize their sum. In the attached file you'll find a very simple setup.

    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.

  3. #3
    Registered User
    Join Date
    05-25-2012
    Location
    Eagle River, Alaska
    MS-Off Ver
    MS Office 365 (Excel ver. 2304)
    Posts
    16

    Re: Using the Solver function to calculate a schedule.

    Francesco,

    I appreciate you for taking a look at this. I will be on the lookout for non-linear functions in the future. I look forward to trying out OpenSolver. I was afraid the problem called for too many renditions of possible solutions to calculate in the original form.

    Thank you,

    Michael

  4. #4
    Registered User
    Join Date
    05-25-2012
    Location
    Eagle River, Alaska
    MS-Off Ver
    MS Office 365 (Excel ver. 2304)
    Posts
    16

    Re: Using the Solver function to calculate a schedule.

    Francesco,

    I played around with it some more and was able to make the Solver table linear and use a helper table to calculate the hours. I added another constraint for the number of days in the week to schedule an employee in order to distribute the workload more evenly. Again, thanks for the tip. I am reading up on OpenSolver.

    Michael
    Attached Files Attached Files

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

    Re: Using the Solver function to calculate a schedule.

    Michael,

    your problem is still non-linear. Solver will gladly use the Simplex LP because it gets fooled by references to other sheets, but OpenSolver, which is a little more reliable, will warn you.

    There's nothing wrong in using GRG or Evolutionary engines, just remember that you have no guarantee that the solution you find is the best one.

    Any function like IF(), COUNTIF(), SUMIF(), LOOKUP() and the like that involves variables is going to make your problem non-linear. I can't see how to solve this schedule without a second set of variables, but maybe someone here will help you further.

    HTH,

    Francesco

  6. #6
    Registered User
    Join Date
    05-25-2012
    Location
    Eagle River, Alaska
    MS-Off Ver
    MS Office 365 (Excel ver. 2304)
    Posts
    16

    Re: Using the Solver function to calculate a schedule.

    Appreciate the explanation. I understand this is a "workaround" of sorts. It at least gets me closer to what I'm trying to achieve and is usable for my needs. Thanks again.

+ 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] How can I use Solver to schedule my employees (Healthcare)?
    By lsm33000 in forum Excel General
    Replies: 11
    Last Post: 11-18-2020, 07:11 PM
  2. Football Tournement Schedule (Excel Solver)
    By myotoni in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-23-2018, 06:29 AM
  3. Employee work schedule using solver
    By k39 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 04-05-2018, 11:14 PM
  4. Using Solver to create a resources schedule
    By lucsilva in forum Excel General
    Replies: 0
    Last Post: 08-03-2017, 10:16 PM
  5. [SOLVED] Using Solver for Schedule
    By prismcat in forum Excel General
    Replies: 3
    Last Post: 05-01-2015, 10:46 AM
  6. Schedule optimization using solver
    By bball3212 in forum Excel General
    Replies: 1
    Last Post: 12-05-2012, 02:24 AM
  7. HOW DO I CHANGE A SCHEDULE USING SOLVER WITHOUT CHANGING EACH DAY?
    By TARA BROWN in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-04-2006, 08:15 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