Product Mix Example For Excel Solver
Product Mix Example For Excel Solver
This part of our Solver Tutorial takes you step by step through the process of creating a Solver
model, using a Product Mix example. We'll first show you how to define the problem and write
out formulas for the objective and constraints. Then we'll walk you through two ways to define
and solve your model -- in an Excel spreadsheet, or in a Visual Basic program.
In the next production cycle, you have 5,800 quarts of glue; 730 hours of pressing capacity;
29,200 pounds of pine chips; and 60,500 pounds of oak chips available. Further assume that
each pallet of Tahoe, Pacific, Savannah, and Aspen panels can be sold for profits of $450,
$1,150, $800, and $400, respectively.
A pallet of each type of panel requires a certain amount of glue, pressing, pine chips, and oak
chips. The amount of resources used (calculated by the left hand side of each constraint)
depends on the mix of products built, and we have a limited amount of each type of resource
available (corresponding to the constraint right hand side values). The constraints for this
problem are expressed as follows:
Since the number of products built cannot be negative, we'll also have non-negativity
conditions on the variables:
Now, we'll take you step by step through implementing and solving this optimization model
using Excel's built-in Solver
Within this overall structure, you have a great deal of flexibility in how you choose cells to hold
your model's decision variables and constraints, and which formulas and built-in functions you
use. In general, your goal should be to create a spreadsheet that communicates its purpose in
a clear and understandable manner.
In the worksheet below, we have reserved cells B4, C4, D4 and E4 to represent our decision
variables X1, X2, X3, and X4 representing the number of pallets of each type of panel to produce.
The Solver will determine the optimal values for these cells. (Click on the worksheet for a full-
size image.)
Notice that the profit for each pallet of panels ($450, $1,150, $800 and $400) was entered in
cells B5, C5, D5 and E5, respectively. This allows us to compute the objective in cell F5 as:
or equivalently,
We can copy this formula to cells F9:F11 to compute the total amount of pressing, pine chips,
and oaks chips used. (The dollar signs in $B$4:$E$4 specify that this cell range stays constant,
while the cell range B8:E8 becomes B9:E9, B10:E10, and B11:E11 in the copied formulas.)
The formulas in cells F8:F11 correspond to the left hand side values of the constraints.
In cells G8:G11, we've entered the available amount of each type of resource (corresponding
to the right hand side values of the constraints). This allows us to express
the constraints shown earlier as:
F8:F11<=G8:G11
This is equivalent to the four constraints: F8<=G8, F9<=G9, F10<=G10, and F11<=G11. We
can enter this set of constraints directly in the Solver dialogs along with the non-negativity
conditions:
B4:E4 >= 0
Understanding the Excel Solver Dialogs
To let the Excel Solver know which cells on the worksheet represent the decision variables,
constraints and objective function, we click Solver button on the Excel Data tab, or the Premium
Solver button on the Add-Ins tab, which displays the Solver Parameters dialog. In the Set Objective
(or Set Target Cell) edit box, we type or click on cell F5, the objective function. In the By Changing
Variable Cells edit box, we type B4:E4 or select these cells with the mouse.
To add the constraints, we click on the Add button in the Solver Parameters dialog and select cells
F8:F11 in the Cell Reference edit box (the left-hand side), and select cells G8:G11 in the Constraint
edit box (the right-hand side); the default relation <= is OK.
We choose the Add button again (either from the Add Constraint dialog above, or from the main
Solver Parameters dialog) to define the non-negativity constraint on the decision variables.
(Alternatively, we can check the Make Unconstrainted Variables Non-Negative option in the Solver
Parameters dialog.)
When we've completely entered the problem, the Solver Parameters dialog appears as shown
below. This is the Excel Solver dialog from Excel 2010; the Solver in earlier versions of Excel have
similar elements. Frontline's Premium Solver products can emulate either style, and they also offer a
new Ribbon-based user interface.
To find the optimal solution, we simply click on the Solve button. After a moment, the Excel Solver
returns the optimal solution in cells B4 through E4. This means that we should build 23 pallets of
Tahoe panels, 15 pallets of Pacific panels, 39 pallets of Savannah panels, and 0 pallets of Aspen
panels. This results in a total profit of $58,800 (shown in cell F5).
The message "Solver found a solution" appears in the Solver Results dialog, as shown above. (Click
on the image to see it full size). We now click on "Answer" in the Reports list box to produce an
Answer Report, and click OK to keep the optimal solution values in cells B4:E4.
After a moment, the Solver creates another worksheet containing an Answer Report, like the one
below, and inserts it to the left of the problem worksheet in the Excel workbook
Answer Report
This report shows the original and final values of the objective function and the decision variables, as
well as the status of each constraint at the optimal solution. Notice that the constraints on glue,
pressing, and pine chips are binding and have a slack value of 0.
The optimal solution would use up all of these resources; however, there were 28,000 pounds of oak
chips left over. If we could obtain additional glue, pressing capacity, or pine chips we could further
increase total profits, but extra oak chips would not help in the short run.