Example: Solving Linear Programs with Excel Solver for Daily Production
A manufacturer produces standard and premium liquid detergents. You need to implement its daily production model in desktop Excel with the Solver add-in enabled. Production quantities may be fractional litres, and all output can be sold.
Model input | Standard detergent | Premium detergent | Daily capacity |
|---|---|---|---|
Contribution profit | 3 dollars/L | 5 dollars/L | — |
Mixing time | 2 min/L | 4 min/L | 240 min |
Filling time | 3 min/L | 2 min/L | 180 min |
The supplied model maximizes contribution profit subject to the two time capacities and nonnegative production quantities. There are no other restrictions.
a) Build the worksheet using B2:C2 for production quantities, D3 for total profit, and D5:D6 for resource use. Show the formulas and test their links.
Enter the worksheet labels, inputs, and formulas as follows. Formulas use English-language Excel syntax with comma separators. Leave unspecified cells blank.
- Row 1: A1 contains Item, B1 contains Standard, C1 contains Premium, D1 contains Calculated total, and E1 contains Capacity.
- Row 2: A2 contains Production (L); enter 0 in both B2 and C2.
- Row 3: A3 contains Profit (dollars/L); enter 3 in B3, 5 in C3, and =SUMPRODUCT(B2:C2,B3:C3) in D3.
- Row 4: A4 contains Resource, B4 contains Standard, C4 contains Premium, D4 contains Used (min), and E4 contains Available (min).
- Row 5: A5 contains Mixing (min/L); enter 2 in B5, 4 in C5, =SUMPRODUCT(B2:C2,B5:C5) in D5, and 240 in E5.
- Row 6: A6 contains Filling (min/L); enter 3 in B6, 2 in C6, =SUMPRODUCT(B2:C2,B6:C6) in D6, and 180 in E6.
Each SUMPRODUCT multiplies matching entries and adds the products. With x and y denoting standard and premium production in litres, the formulas calculate:
The production cells are inputs that Solver can adjust. Profit and resource use are formulas that recalculate from those inputs; capacities remain fixed.
Test the links by temporarily entering 1 in B2 and leaving C2 at 0. D3 should display ________ dollars, D5 should display ________ minutes, and D6 should display ________ minutes. Next, enter 0 in B2 and 1 in C2: the corresponding results should be 5 dollars, 4 minutes, and 2 minutes. Reset both production cells to 0 before solving.
b) Specify the objective, changing cells, constraints, and solving method in Solver.
Open Solver from the Data tab. If the command is unavailable, activate the Solver add-in first. Enter these settings:
- Set Objective: D3.
- Objective direction: Max.
- By Changing Variable Cells: B2:C2.
- Mixing constraint: D5 less than or equal to E5.
- Filling constraint: D6 less than or equal to E6.
- Nonnegativity constraint: B2:C2 greater than or equal to 0.
- Solving method: Simplex LP.
These constraints enforce 2x+4y≤240 and 3x+2y≤180, with time measured in minutes. Use explicit nonnegativity constraints so the permitted production values are clear.
Select Simplex LP because the objective and resource-use formulas are linear in B2:C2. Keep the profit rates, processing times, and capacities outside the changing-cell selection: they are supplied inputs, not production decisions. Select Solve.
c) State the optimal production plan and verify the returned profit and time usage.
A completed Simplex LP solve for this correctly entered model returns 30 L of standard detergent and 45 L of premium detergent. Confirm that Solver reports an optimal solution, then select Keep Solver Solution.
Recalculate profit from the original inputs:
Check both resource totals independently:
Both production quantities are nonnegative, and neither resource exceeds its capacity. The unused mixing time is 240−240=0 min, and the unused filling time is 180−180=0 min.
These arithmetic checks verify feasibility and the reported profit. They do not establish optimality by themselves; that conclusion relies on the successful Simplex LP solve of the correctly encoded model. The optimal daily plan is 30 L standard and 45 L premium, giving $315 contribution profit.
A bakery's spreadsheet model stores the number of bread batches in cell B2 and the number of cake batches in cell C2. Profit per batch is in B3:C3, oven hours per batch are in B5:C5, and the 40 available oven hours are in E5. The batch cells are also constrained to be nonnegative. Complete the description of the setup so Solver can find the most profitable weekly plan.
The total profit in D3 should use the function to multiply B3:C3 by B2:C2 and add the products. In the Solver Parameters dialog, D3 is the objective cell and the direction is set with the option button labelled . The cells Solver is allowed to adjust, entered under By Changing Variable Cells, are (written as a relative range, without dollar signs). Because every formula in the model is linear in those cells, the solving method to pick from the Select a Solving Method list is the one labelled .