Spreadsheet Optimization with Solver

Spreadsheet Optimization with Solver turns a business decision into a search for the best permitted plan. You choose what Excel may change, calculate the outcome you want to improve, and describe the business limits. Applications include allocating a marketing budget, scheduling staff, and selecting a production mix. Solver's recommendation depends on the model you supply.

Build a linked decision model

The decision variables are the quantities Solver may change, such as kilograms of two products made each week. Put these quantities in input cells. Keep assumptions, such as contribution per kilogram and available production time, in separate cells.


The objective cell contains a formula linked to the decision cells. For two products with constant contribution rates, the governing objective is


max⁡Z=cxx+cyy\max Z=c_xx+c_yy


Here, xx and yy are weekly quantities, cxc_x and cyc_y are contribution per unit, and ZZ is total weekly contribution. Multiplying dollars per kilogram by kilograms per week gives dollars per week. Use a minimum objective instead when the business aim is to reduce cost.


Changing either quantity should recalculate the objective and the relevant resource totals. If a formula does not depend on the decision cells, Solver cannot improve that formula by changing those cells.

Translate business limits into constraints

A feasible solution satisfies every constraint in the model. A resource ceiling uses ≤\leq, a minimum commitment uses ≥\geq, and an exact requirement uses ==. Match units on both sides: minutes used must be compared with minutes available.


For illustration, suppose two blends use one kilogram of shared material per kilogram produced. Blend A requires two labour hours per kilogram; blend B requires one. With weekly limits of 60 kilograms of material and 80 labour hours, the numerical quantities satisfy


x+y≤60,2x+y≤80,x,y≥0.x+y\leq60,\qquad 2x+y\leq80,\qquad x,y\geq0.


The permitted plans lie in the overlap of these restrictions.


Two resource-limit lines enclose a shaded feasible region for weekly production.


Use continuous variables for divisible quantities. Add integer restrictions for whole items. A binary restriction permits only zero or one, appropriate for a yes-or-no decision.



Configure Solver for the model

In desktop Excel's Solver add-in, select the formula cell under Set Objective and choose Max or Min. Identify the input cells under By Changing Variable Cells. Add resource limits, bounds, and any integer restrictions, including nonnegativity where appropriate.


Choose the solving method to match the formulas, not merely the appearance of the worksheet.


Model structure

Suitable Solver method

Linear objective and linear constraints

Simplex LP

Smooth nonlinear formulas

GRG Nonlinear

Non-smooth formulas

Evolutionary


A linear expression adds constant multiples of decision variables. Multiplying a variable by a fixed unit contribution is linear; multiplying two decision variables together generally is not. Linear models with integer restrictions can also use Simplex LP.

Validate and interpret the result

Read the completion message before keeping the solution. Recalculate the objective independently and substitute the returned quantities into every constraint. Check units, nonnegativity, and integer requirements.


For a resource ceiling, unused capacity equals availability minus usage. A constraint is binding when usage equals its limit, within numerical tolerance. A binding limit does not by itself prove that buying more of that resource would improve the result.


An infeasible model has no plan satisfying all its constraints. An unbounded maximization model permits the objective to increase without a finite maximum; this can signal a missing limit. Solver's stopping reason matters, especially for nonlinear models: a local optimum need not be the global best.



What to remember

  • Link the objective and resource formulas to the decision cells.
  • Encode every relevant business limit with matching units.
  • Match the solving method and variable restrictions to the model.
  • Check feasibility and the stopping message before accepting the recommendation.

Example: Optimize a gift-box production plan

A gift company chooses weekly quantities of standard and premium boxes. Each box must be produced whole. All boxes produced within the stated demand limit can be sold, and contributions and processing times remain constant.


Item

Standard box

Premium box

Weekly limit

Contribution

$32 per box

$24 per box

—

Assembly time

3 min per box

2 min per box

180 min

Labelling time

1 min per box

2 min per box

100 min

Demand

At most 50 boxes

No additional ceiling

—


These are the only production limits. Let xx be standard boxes per week and yy be premium boxes per week.


a) Build the spreadsheet formulas and specify the Solver settings needed to maximize weekly contribution.


Use B2 and C2 as the standard and premium quantity cells. Enter zero initially so the starting plan is feasible. Store contribution and time assumptions separately, then calculate the objective and resource usage from the quantities.

  • B2:C2: enter 0 and 0 initially for standard and premium box quantities.
  • B3:C3: enter 32 and 24 for contribution in dollars per box.
  • B4:C4: enter 3 and 2 for assembly minutes per box.
  • B5:C5: enter 1 and 2 for labelling minutes per box.
  • E3: enter =SUMPRODUCT(B2:C2,B3:C3) for weekly contribution in dollars.
  • E4: enter =SUMPRODUCT(B2:C2,B4:C4) for weekly assembly minutes used.
  • E5: enter =SUMPRODUCT(B2:C2,B5:C5) for weekly labelling minutes used.

Each SUMPRODUCT formula multiplies the two quantities by their corresponding per-box values and adds the products. The mathematical model is


max⁡Z=32x+24ysubject to3x+2y≤180,x+2y≤100,x≤50,x,y≥0,x,y integers.\begin{aligned} \max\quad &Z=32x+24y\\ \text{subject to}\quad &3x+2y\leq180,\\ &x+2y\leq100,\\ &x\leq50,\\ &x,y\geq0,\quad x,y\text{ integers}. \end{aligned}


Set Objective to E3 and choose Max. Set By Changing Variable Cells to B2:C2. Add E4 ≤180\leq180, E5 ≤100\leq100, B2 ≤50\leq50, and nonnegative integer restrictions on B2:C2. Choose Simplex LP because the objective and resource expressions are linear.


At the initial quantities, contribution is 32(0)+24(0)=$032(0)+24(0)=\$0 per week and both resource totals are zero. This checks the totals for the feasible starting plan, although it does not establish optimality.


b) Find the optimal production quantities and verify the maximum weekly contribution.


First consider the continuous version of the linear model. Its best objective occurs at a feasible vertex. If a best continuous solution also contains whole quantities, it is feasible and optimal for the integer model as well.


Find the intersection of the assembly and labelling boundaries:


3x+2y=180,x+2y=100.\begin{aligned} 3x+2y&=180,\\ x+2y&=100. \end{aligned}


Subtract the second equation from the first:


2x=80⇒x=40 boxes per week.2x=80\quad\Rightarrow\quad x=40\ \text{boxes per week}.


Substitute into the labelling equation:


40+2y=100⇒y=30 boxes per week.40+2y=100\quad\Rightarrow\quad y=30\ \text{boxes per week}.


Now find the other feasible vertices. With y=0y=0, assembly permits ________ standard boxes, labelling permits ________, and demand permits only 50. Thus the standard-only endpoint is (50,0)(50,0). With x=0x=0, assembly permits ________ premium boxes but labelling permits only 50, giving (0,50)(0,50).


At the demand boundary x=50x=50, assembly permits


y≤180−3(50)2=15,y\leq\frac{180-3(50)}{2}=15,


while labelling permits y≤(100−50)/2=25y\leq(100-50)/2=25. The feasible upper endpoint on that boundary is therefore (50,15)(50,15). Together with the origin and the resource intersection, these are all feasible vertices.


Evaluate weekly contribution at each vertex, with coordinates written as standard boxes and premium boxes per week:

  • At (0,0)(0,0): Z=32(0)+24(0)=$0Z=32(0)+24(0)=\$0 per week.
  • At (50,0)(50,0): Z=32(50)+24(0)=$1,600Z=32(50)+24(0)=\$1,600 per week.
  • At (50,15)(50,15): Z=32(50)+24(15)=1600+360=$1,960Z=32(50)+24(15)=1600+360=\$1,960 per week.
  • At (40,30)(40,30): Z=32(40)+24(30)=1280+720=$2,000Z=32(40)+24(30)=1280+720=\$2,000 per week.
  • At (0,50)(0,50): Z=32(0)+24(50)=$1,200Z=32(0)+24(50)=\$1,200 per week.

The largest contribution is


Z=32(40)+24(30)=1280+720=$2,000 per week.Z=32(40)+24(30)=1280+720=\$2,000\ \text{per week}.


The maximizing quantities, 40 standard boxes and 30 premium boxes per week, are whole numbers. They therefore attain the continuous upper bound while satisfying the integer restrictions, verifying the integer optimum too.


c) Calculate unused capacity and identify the binding constraints at the optimal plan.


Substitute 40 standard boxes and 30 premium boxes into each business limit. For a ceiling constraint, subtract actual usage from the available amount.


Assembly usage and unused time are


Usage=3(40)+2(30)=180 min per week,Unused time=180−180=0 min per week.\begin{aligned} \text{Usage}&=3(40)+2(30)=180\ \text{min per week},\\ \text{Unused time}&=180-180=0\ \text{min per week}. \end{aligned}


Labelling usage and unused time are


Usage=40+2(30)=100 min per week,Unused time=100−100=0 min per week.\begin{aligned} \text{Usage}&=40+2(30)=100\ \text{min per week},\\ \text{Unused time}&=100-100=0\ \text{min per week}. \end{aligned}


Unused standard-box demand allowance is


50−40=10 boxes per week.50-40=10\ \text{boxes per week}.


The assembly and labelling ceilings are binding because their unused capacities are zero. The standard-box demand ceiling is not binding because production is 10 boxes below it. That unused demand allowance does not provide the processing time needed to produce extra boxes; any revised plan must still satisfy both time limits.

A design studio allocates weekly staff hours between illustration and editing. Both quantities may be fractional. Its worksheet contains the following cells.


Cell or range

Contents

B2:C2

Illustration hours and editing hours

B5

=90B2+70C2, total weekly contribution in dollars

B6

=B2+C2, total weekly hours used


The constraints are already entered: B6 ≤40\leq40, B2 ≤26\leq26, C2 ≤30\leq30, and nonnegative quantities. Which Solver setup seeks the greatest weekly contribution?

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 campus merchandise shop is building a spreadsheet to compare sales assumptions and assess whether revenue covers costs. Match each planning term with its meaning in the model.

Match each term
A.

Selling price per unit minus variable cost per unit

B.

A named, saved set of input values that can be substituted into a worksheet model

C.

The sales level at which total revenue equals total cost

Break-even point

Scenario

Unit contribution margin

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 workshop chooses weekly quantities xx and yy of two assembled kits. Kits cannot be divided, and production quantities cannot be negative. Each kit of type A requires 4 labour hours and contributes $18; each kit of type B requires 3 labour hours and contributes $16. The workshop has at most 120 labour hours per week. Demand limits production to 24 type A kits and 30 type B kits per week.


The objective is to maximize 18x+16y18x+16y, with demand bounds x≤24x\leq24 and y≤30y\leq30. Which additional configuration correctly represents the remaining requirements?

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

Extra Practice