Documentation For The Excel Solver Add-In: Solverreadfirst Page 1 of 9
Documentation For The Excel Solver Add-In: Solverreadfirst Page 1 of 9
Humberto Barreto
[email protected]
(765) 361-6315
Excel's Solver is a numerical optimization add-in (an additional file that extends the capabilities
of Excel). It can be fast, easy, and accurate. It is not, however, a 100% guaranteed silver bullet.
This document shows how to load and use Solver. It concludes with two important caveats
concerning Solver.
Organization:
Accessing Excels Solver
Reviewing the Solver Parameters Dialog Box
Using Excels Solver: General Description
Using Excels Solver: An Example (LifeguardSolver.xls)
Two Dangers of Numerical Optimization
Accessing Excels Solver
To use the Solver, click on the Tools heading on the menu bar and select the Solver . . . item.
If Solver is not listed (as shown above left), you must manually include it in the algorithms that
Excel has available. To do this, select Tools from the menu bar and choose the "Add-Ins . . ."
SolverReadFirst
Page 1 of 9
item. In the Add-Ins dialog box, scroll down and click on the Solver Add-In so that the box is
checked as shown by the picture below:
If the Solver add-in is not listed in the Add-Ins dialog box, click on the Select or Browse button
and navigate to the Solver add-in (called solver.xla in Windows and Solver on the MacOS) and
open it. It should be in the Library directory in the folders where Microsoft Office is installed.
If you cannot find the Solver Add-In, try using the Macs Find File or Find in Windows to locate
the file. Search for solver. Note the location of the file, return to the Add-Ins dialog box (by
executing Tools: Add-Ins), click on Select or Browse, and open the Solver Add-In file.
Still cant find it? Then it is likely that your installation of Excel failed to include the Solver
Add-In. Run your Excel or Office Setup again from the original CD-ROM and install the Solver
Add-In. You should now be able to use the Solver by clicking on the Tools heading on the menu
bar and selecting the Solver item.
Although Solver is proprietary, you can download a trial version from Frontline Systems, the
makers of Solver, at www.frontsys.com.
It is imperative that you successfully load and install the Solver add-in since without it, neither
Solver nor the Comparative Statics Wizard will be available.
SolverReadFirst
Page 2 of 9
Equal to: gives you the option of treating the Target Cell in three alternative ways. Max (the
default) tells Excel to maximize the Target Cell; Min to minimize; while Value is used if you
want to reach a certain particular value of the Target Cell by choosing a particular value of the
endogenous variable. If you choose Value, you must enter the particular value you want to attain
in the box to the immediate right unless you want the value to be zero (which is the default).
Equal to zero enables Solver to find equilibrium solutions or roots to first order conditions.
By Changing Cells is where you indicate which cells are the adjustable cells (i.e., endogenous
variables). As in the Set Target Cell box, you may either type in a cell address or click on a cell
in the spreadsheet. Excel handles multivariable optimization problems by allowing you to
include additional cells in the By Changing Cells box. Each non-contiguous choice variable is
separated by a comma. If you use the mouse technique (clicking on the cells), the comma
separation is automatic.
Guess controls the initial position of the changing cells. Excel uses the current values of the
cells as the default. Solver is sensitive to the initial values. If a solution cant be found, try
different starting values.
SolverReadFirst
Page 3 of 9
Subject to the Constraints is used to impose constraints on the endogenous variables. We will
rely on this important part of Solver when we do Constrained Optimization problems.
You can also use the Constraints part of Solver to help it find a solution. For example, in a profit
maximization problem, you could tell Solver that Quantity must be greater than or equal to zero,
i.e., that negative values of Q are not allowed. If Excel has trouble finding a solution to a
problem, limiting the possible values of the choice variables will help it find a solution.
Solver allows equality (Lagrange) or inequality (Kuhn-Tucker) constraints.
Add..., Change..., Delete buttons are used to create and alter the constraints you set. These
buttons lead to dialog boxes where you indicate your choices, then hit OK.
Returning to the top right-hand side of the Solver Parameters dialog box, we have:
Solve, obviously, the button you click to get Excel's Solver to find a solution. This is the last
thing you do in the Solver Parameters dialog box.
Close is just like cancel; it closes the Solver dialog box and no changes are made.
Options...allows you to adjust the way in which Solver approaches the solution..
As you can see, a series of choices are included in the Solver Options dialog box that direct
Solvers search for the optimum solution and for how long it will search. These options may be
changed if Solver is having difficulty finding the optimal solution. Lowering the Precision,
Tolerance, and Convergence values slows down the algorithm, but may enable Solver to find a
solution.
The Load and Save Model buttons enable you to recall and keep a complicated set of constraints
or choices so that you do not have to re-enter them every time.
Clicking OK or Cancel returns you to the Solver Parameters dialog box.
SolverReadFirst
Page 4 of 9
We continue our review of Solver options by going over the remaining buttons in the Solver
Parameters dialog box (which we display again below):
Reset All. This button changes everything back to the original, default choices, blanking out the
Set Cell, By Changing Cells, and Subject to the Constraints options.
It is important to understand that a saved Excel workbook will remember the information
included in the last Solver run.
If you wish to explore a different problem and want to quickly begin with a clean Solver, then
click on the Reset All button. If you wish to keep a particular Solver model, then use the
Options and Save Model . . . Buttons.
Help brings up limited documentation on Solver. Better help is available by typing solver in
the Index of Help (which can be accessed by executing Help: Contents and Index) as shown
below:
SolverReadFirst
Page 5 of 9
A message appears on the top left-hand side of the box. In this case, Excel reports that Solver
has converged to the current solution. All constraints are satisfied. This is good news!
SolverReadFirst
Page 6 of 9
Bad news is a message like, Solver could not find a solution. If this happens, you must
diagnose, debug, and otherwise think about what went wrong and how it could be fixed. The
two quickest fixes are to try different initial values and to add constraints to the problem.
From the Solver Results dialog box, you elect whether to have Excel write the solution it has
found into the Changing Cells (i.e., Keep Solver Solution) or whether to leave the spreadsheet
alone and NOT write the value of the solution into the Changing Cells (i.e., Restore Original
Values). When Excel reports a successful run, you would usually want it to Keep the Solver
Solution.
On the right-hand side of the Solver Results dialog box, Excel presents a series of reports. The
Answer, Sensitivity, and Limits reports are additional sheets that are inserted into the current
workbook. They contain diagnostic and other information and should be selected if Solver is
having trouble finding a solution.
Along the bottom of the Solver Results dialog box, are four buttons:
OK, obviously, the button you click after reading and choosing various options that you want to
keep. This is the last thing you do in the Solver Results dialog box.
Cancel closes the Solver Results dialog box and no changes are made.
Save Scenario... enables the user to save particular solutions for given configurations.
Help brings up information from Excels Help application.
SolverReadFirst
Page 7 of 9
Page 8 of 9
Solver really is a powerful way to solve optimization problems, but it isnt perfect. You need to
be aware of this. Remember to always format Solvers results with an eye toward ease of
understanding. Do not give up if you get a miserable result and stay alert even if Solver claims
to have hit pay dirtit may be a disastrous result!
When combined with the Comparative Statics Wizard, Solver provides a fast, easy way to do
comparative statics analysis. For more on the Comparative Statics Wizard, please visit
http://www.wabash.edu/econexcel/compstatics/.
For more on Solver, including more powerful Solver algorithms, please see www.frontsys.com.
SolverReadFirst
Page 9 of 9