To make a schedule in Excel with Solver, you must define a target objective (such as minimizing labor costs), set the cells that Solver can change (the shift assignments), and establish constraints (such as maximum hours per employee). Solver then iterates through thousands of combinations to find the mathematically optimal arrangement that satisfies all your rules.

What You'll Need

  • Microsoft Excel (Desktop version; Solver is not available in the basic web version).
  • The Solver Add-in enabled (this is a built-in tool but is disabled by default).
  • A clearly defined set of requirements, including a list of staff, available time slots, and specific coverage needs for each slot.
  • Basic knowledge of Excel formulas, specifically SUM and SUMPRODUCT.

Step-by-Step

  1. Enable the Solver Add-in
    Before you can build your schedule, you must activate the tool. Go to the File menu and select Options. In the Excel Options window, click on Add-ins. At the bottom of the window, ensure the Manage dropdown is set to Excel Add-ins and click Go. Check the box for Solver Add-in and click OK. You will now find the Solver button under the Data tab in the Analysis group. Note that menu labels may differ slightly depending on your version of Excel or region.
  2. Build the Decision Matrix
    Create a grid where the rows represent your employees and the columns represent the time slots (e.g., Monday 8am, Monday 12pm, etc.). Leave the cells where the rows and columns intersect empty; these are the "Changing Variable Cells" that Solver will fill with 1s (to indicate a shift is assigned) or 0s (to indicate it is not). For clarity, you can format these cells with a light border to mark the scheduling area.
  3. Set Up Coverage Requirements
    Below your decision matrix, create a row titled "Actual Staffing." Use the SUM formula for each column to add up the 1s and 0s in that specific time slot. For example, if your matrix is B2:F10, the formula in B11 would be =SUM(B2:B10). Below this, create a row titled "Required Staffing" and manually enter the minimum number of people needed for that specific slot (e.g., 2 people for the morning shift, 5 for the afternoon).
  4. Define Employee Constraints
    To the right of your decision matrix, create a column titled "Total Hours." Use the SUM formula for each row to calculate how many shifts each employee is assigned. For example, if employee one's shifts are in B2:F2, the formula in G2 would be =SUM(B2:F2). Next to this, create a column for "Max Hours" where you enter the limit for each person to prevent burnout or overtime costs.
  5. Create the Objective Cell
    Solver needs a single cell to optimize. If your goal is to minimize total labor cost, create a "Total Cost" cell. To do this, assign a hourly rate to each employee in a separate column. Use the =SUMPRODUCT(G2:G10, H2:H10) formula (where G is total hours and H is the hourly rate) to calculate the total expenditure. This cell will be your "Set Objective."
  6. Configure Solver Parameters
    Click the Solver button on the Data tab. In the Solver Parameters dialog box, perform the following:
    • Set Objective: Select your Total Cost cell.
    • To: Select "Min" (to minimize cost).
    • By Changing Variable Cells: Select the entire empty grid of your decision matrix (e.g., B2:F10).
  7. Add Constraints
    Click the Add button to enter your rules. You must add these specifically:
    • Binary Constraint: Select the decision matrix cells and choose "bin" from the dropdown. This forces Excel to use only 0 or 1, preventing it from assigning "0.5 of a person" to a shift.
    • Coverage Constraint: Select the "Actual Staffing" row and set it to be ">=" (greater than or equal to) the "Required Staffing" row.
    • Workload Constraint: Select the "Total Hours" column and set it to be "<=" (less than or equal to) the "Max Hours" column.
  8. Select the Solving Method and Run
    In the "Select a Solving Method" dropdown, choose "Simplex LP." This is the most efficient method for linear scheduling problems where the relationships are additive. Click Solve. Excel will process the data and notify you when it finds a solution. Select "Keep Solver Solution" and click OK.

Common Mistakes

One of the most frequent errors is forgetting the binary constraint. Without the "bin" setting, Solver may treat the cells as continuous numbers, resulting in a schedule where an employee is assigned 0.23 of a shift, which is physically impossible. This leads to a mathematically correct but practically useless result.

Another common mistake is creating "Infeasible" constraints. This happens when you set requirements that cannot possibly be met. For example, if you require 10 people for a shift but only have 8 employees available in total, Solver will return an error stating it cannot find a feasible solution. Always double-check that your total available labor exceeds your total required coverage.

Users also often confuse the "Objective" with a "Constraint." The objective is the one thing you want to maximize or minimize (like cost or total hours), while constraints are the boundaries you cannot cross. If you put your coverage needs in the objective cell, Solver will try to make that number as small as possible, effectively emptying your schedule.

Tips

To make your schedule more readable, use Conditional Formatting on the decision matrix. Set a rule so that any cell containing a "1" is filled with a specific color (like green) and any cell containing a "0" is white or has the font color set to white. This transforms a grid of numbers into a visual calendar that is easy for staff to understand.

If you have complex rules, such as "Employee A cannot work if Employee B is working," you can create a helper cell. Use a formula that adds the two employees' cells for a specific shift; if the sum is greater than 1, the rule is violated. You can then add a constraint to Solver that this helper cell must be "<= 1." This allows you to build highly specific logic into the automation.

Always keep a backup of your constraints in a separate table. If you accidentally clear the Solver parameters or need to adjust the staff list, having a reference table for "Max Hours" and "Required Staffing" makes it much faster to re-run the model without hunting through formulas.

Troubleshooting

If Solver returns the message "Solver could not find a feasible solution," the first step is to relax your constraints. Try increasing the "Max Hours" for your employees or decreasing the "Required Staffing" for the busiest shifts. Often, one single overly-restrictive rule is blocking the entire model.

If the results seem random or illogical, check your Solving Method. If you are using "GRG Nonlinear," the tool might be getting stuck in a "local optimum" rather than finding the global best solution. Switching to "Simplex LP" is essential for scheduling because scheduling is a linear problem. If Simplex LP still fails, ensure all your cells in the decision matrix are truly empty or contain numbers, and that no text is accidentally included in the range.

If the Solver button is missing from the Data tab, the add-in may have been disabled by a system update. Repeat the activation process in the Excel Options menu. If it still doesn't appear, restart Excel completely. In some corporate environments, add-ins are managed by IT administrators; if the options are greyed out, you may need to request permission to enable Solver.

Frequently Asked Questions

Can I use Solver for a rotating shift schedule?

Yes, but you must build the constraints to reflect the rotation. You can do this by creating constraints that link the assignments of one week to the assignments of the next, ensuring that a night shift is followed by a required rest period.

Does Solver work on Excel for Mac?

Yes, Solver is available on the Mac version of Excel. The activation process is similar, though the menu paths may vary slightly (typically found under Tools > Excel Add-ins).

What is the limit on the number of variables Solver can handle?

The standard Excel Solver has a limit on the number of decision variables (the cells it can change). For extremely large organizations with hundreds of employees and thousands of slots, you may need a professional third-party optimization add-in.

Can I optimize for something other than cost?

Absolutely. You can set the objective to maximize employee satisfaction (if you have a preference score for each shift) or to minimize the variance in hours worked between employees to ensure fairness.

Why is my schedule taking so long to calculate?

Complexity increases exponentially with the number of binary constraints. If your matrix is very large, Solver has to test millions of combinations. Ensure you are using the Simplex LP method to speed up the process.

Can I automate this so it runs every week?

Solver is a manual tool and does not run automatically via a standard formula. To automate it, you would need to record a VBA macro that triggers the Solver function, though this requires knowledge of the Solver VBA reference library.