Find the best mix with Solver
Loans, forecasts and Solver9 minPremium
Builds on Work backward to a target with Goal Seek.
A furniture workshop in Porto makes desks and bookcases from the same stock of wood and the same carpenters' hours. The owner wants the weekly mix that earns the most without running out of either.
How it works
Solver changes several inputs at once to make one result as large or as small as possible, within limits you set. It's an add-in that comes with Excel. Turn it on once: File > Options > Add-ins, pick Excel Add-ins in the Manage box, click Go and check Solver Add-in. On a Mac, choose Tools > Excel Add-ins. Then choose Data > Solver, in the Analysis group.
A Solver model is three kinds of cells:
| Row | A | B |
|---|---|---|
| 1 | Part | In Solver Parameters |
| 2 | Objective | Set Objective: a formula, to Max, Min or Value Of |
| 3 | Variable cells | By Changing Variable Cells: the inputs Solver may change |
| 4 | Constraints | Subject to the Constraints: limits such as Used <= Available, or int for whole numbers |
Keep Make Unconstrained Variables Non-Negative checked, so no quantity goes below zero. Choose Simplex LP when the objective and the limits are sums of variable cells times fixed numbers, as in most mix and staffing problems. GRG Nonlinear, the default, is for smooth curves. Click Solve, then Keep Solver Solution or Restore Original Values.
A constraint is binding when the best answer uses it up completely, as when every hour of carpenter time is booked. More of it would raise the profit, while more of a limit with time to spare wouldn't. The Answer report, offered when Solver finishes, marks each constraint Binding or Not Binding.
Example
Here is the workshop's model, with the mix Solver finds.
- Step 1: Set Objective is the total profit in B4, to Max.
- Step 2: By Changing Variable Cells is B2:C2, the two quantities.
- Step 3: Each Used cell in B7:B9 must stay at or under its Available cell.
- Step 4: Wood and carpentry are used up, so they're binding. Finishing has time to spare.
Common mistakes
- The variable cells pointing at the profit. Solver changes inputs, so the variable cells are the quantities, and the profit is the objective.
- A limit left out, such as finishing hours. Solver then plans a mix the workshop can't make. Add one constraint per limit.
- Typed limits, such as
B7 <=. Point at the cell that holds the limit, so next week's figures need no new setup.200 - GRG Nonlinear on a model of sums like this one. Simplex LP is the method made for linear models, and it tells you when a formula isn't linear.
In short
- Solver changes several variable cells to make an objective as large or small as possible, within constraints.
- Use Simplex LP for linear models such as mixes, and add int for whole numbers.
- A binding constraint is used up at the best answer, and easing it would improve the result.
Practice
Premium4 exercises: 1 set of steps, 2 dialogs and 1 quiz question.
Practice is part of Premium
Every lesson is free to read, and you can practice the free lessons without an account. This lesson's exercises are part of Premium, which you add to a free account.
Have one? Sign in