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 xx and yy denoting standard and premium production in litres, the formulas calculate:


P=3x+5ydollars,M=2x+4yminutes,F=3x+2yminutes.\begin{aligned} P&=3x+5y &&\text{dollars},\\ M&=2x+4y &&\text{minutes},\\ F&=3x+2y &&\text{minutes}. \end{aligned}


The production cells are inputs that Solver can adjust. Profit and resource use are formulas that recalculate from those inputs; capacities remain fixed.


Decision cells feed the profit and resource-use formulas, with resource use compared against fixed capacities.


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≤2402x+4y\leq240 and 3x+2y≤1803x+2y\leq180, 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:


P=(3 dollars/L)(30 L)+(5 dollars/L)(45 L)=90+225=315 dollars per day.\begin{aligned} P&=(3\ \text{dollars/L})(30\ \text{L})+(5\ \text{dollars/L})(45\ \text{L})\\ &=90+225\\ &=315\ \text{dollars per day}. \end{aligned}


Check both resource totals independently:


M=(2 min/L)(30 L)+(4 min/L)(45 L)=60+180=240 min,F=(3 min/L)(30 L)+(2 min/L)(45 L)=90+90=180 min.\begin{aligned} M&=(2\ \text{min/L})(30\ \text{L})+(4\ \text{min/L})(45\ \text{L})\\ &=60+180=240\ \text{min},\\ F&=(3\ \text{min/L})(30\ \text{L})+(2\ \text{min/L})(45\ \text{L})\\ &=90+90=180\ \text{min}. \end{aligned}


Both production quantities are nonnegative, and neither resource exceeds its capacity. The unused mixing time is 240−240=0240-240=0 min, and the unused filling time is 180−180=0180-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.

An operations analyst must decide how many units of each product a plant should make each week and wants to solve the problem as a linear program with Excel Solver. Arrange the stages of the workflow in the order the analyst should carry them out.

Loading ordering steps…

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

A service company uses Excel Solver to minimize daily contractor costs. It needs at least 20 contractor-hours in total, including at least 6 specialist hours. Fractional hours are permitted.


The worksheet contains the following cells. Formulas are shown instead of their calculated values.


Cell

Meaning

Entry

C2

General contractor-hours

Initially 12

D2

Specialist contractor-hours

Initially 8

C3

General contractor cost per hour

40 dollars/hour

D3

Specialist contractor cost per hour

60 dollars/hour

F4

Total daily cost in dollars

=SUMPRODUCT(C2:D2,C3:D3)

F6

Total contractor-hours

20, entered as a fixed number


Solver minimizes F4 by changing C2:D2, subject to F6 being at least 20, D2 being at least 6, and both changing cells being nonnegative. The solving method is Simplex LP.


Solver returns C2 = 0 and D2 = 6, while F6 still displays 20. Which change correctly repairs the worksheet so that Solver enforces the required total hours?

Choose an answer

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

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 .

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors