Use Solver in Microsoft Excel
Optimizing values in an Excel spreadsheet to meet a given objective can be an arduous process. Fortunately, Microsoft offers Solver, a numerical optimization add-in to assist in this task. While it can’t solve every problem, It can be a very useful “what-if” tool. Here is how to use it effectively.
Contents
Steps
Before You Begin
- To understand the Solver, it’s important to understand the basic concept of what it does and how it works. There are 3 primary components you should be familiar with.
- Target Cell. This is the cell that represents the goal or objective of the problem. In our example, we will be attempting to have a schedule that has no shortfall in staffing. The cell that reports any shortfall will be our Target Cell.
- Variable Cells are the cells that can be modified to arrive at the desired outcome. In our example, that will be work hours from Monday through Friday for all employees.
- Constraints. This are restrictions or limitations to what Solver can do to solve the problem. For example, if Employee X cannot work Tuesdays, Solver is restricted from assigning an employee work on Tuesdays.
Excel 2007
- Start Microsoft Excel
- Install the Solver add-in. If it’s not already installed, follow the next steps:
- Click on the Tools menu and select Add-ins...
- In the Add-ins window, enable the checkmark to the left of the Solver add-in, then click OK.
- Download the data used for this exercise. We will use it to create a real-world example to solve scheduling issues. When downloaded, open the file in Excel.
- Start Solver. Click on Tools, and then Solver.
- The Solver Parameters window opens. This is where you enter the criteria needed to solve the given problem.
- Enter the Target Cell. The goal is to have no shortfall in staffing, so our target cell is B25, and we want to make it equal to the value of 0.
- Enter the variable cells. Click and hold on cell B5 and drag-select to cell H20.
- Add constraints. In this example, there are several employees who cannot work certain days of the week, and part-time employees who do not work a normal 40-hour week. Use the constraints listed below:
- $B$11:$F$11 = 0
- $B$12:$H$12 = 0
- $B$22:$H$22 = $B$23:$H$23
- $B$5:$H$20 = binary (i.e. 1's and 0's only)
- $C$5 = 0
- $D$18:$H$18 = 0
- $D$8 = 0
- $E$5 = 0
- $F$17 = 0
- $F$9 = 0
- $G$14 = 0
- $G$19:$H$19 = 0
- $H$10 = 0
- $I$19:$I$20 <= 24
- $I$5:$I$18 <= 40
- In the constraint window, enter a constraint, then click the Add button. This will add your constraint to the list, and then allow you to enter another
- Continue entering all the constraints, and after you have entered the final one on the list, click the Cancel button return to the main Solver window.
- Click the Solve button. Depending on how much memory your computer has and the processor speed, Solver may take a few seconds, or a few minutes.
- When it’s finished processing, Solver will either return a solution, or alert you that it was not able to do so.
- If Solver is not able to find a solution, you must think through, diagnose, and debug, your problem. First, revert to your original values.
- The two quickest fixes are to try different initial values and to add or remove constraints to the problem.
- On the right-hand side of the Solver Results dialog box, Excel presents a series of reports. The Answer, the Sensitivity, and the Limits reports are additional sheets inserted into the current workbook. They contain diagnostic and other information and should be selected when Solver is having trouble finding a solution.
- When Excel reports a successful run, select Keep the Solver Solution and then click OK.
Excel 2010
- Changes have been made in Excel 2010 that greatly improve Solver’s functionality and interface. Use these steps to enable Solver in Excel 2010.
- Start Microsoft Excel
- From the File menu, choose Options.
- In the Excel Options dialog box, select Ad-Ins from the left sidebar, then click the Go button at the bottom of the window.
- Click the Solver Add-in checkbox, then click OK.
- Access Solver. You will see it under the Data tab.
- Using Solver. Once you’ve installed and activated Solver, it opens a Solver Paramaters dialog box, where you will enter the parameters.
Related Articles
- Truncate Text in Excel
- Convert Measurements Easily in Microsoft Excel
- Create a Currency Converter With Microsoft Excel
- Create a Mortgage Calculator With Microsoft Excel
- Edit Data in Microsoft Excel
- Create a Simple Checkbook Register With Microsoft Excel
- Calculate the Day of the Week in Excel
- Embed a SQL Query in Microsoft Excel
Sources and Citations
What links here
- Make a Spreadsheet in Excel
- Create a Histogram in Excel
- Calculate Mean and Standard Deviation With Excel 2007
- Sort Microsoft Excel Columns Alphabetically
- Add Autonumber in Excel
- Change Date Formats in Microsoft Excel
- Embed a SQL Query in Microsoft Excel
- Fix the Application Error 0xc000007b Using AIO 210
- Separate First Names and Last Names Into Separate Fields in a Microsoft Excel List
- Use the Sum Function in Microsoft Excel