Business Analytics & Data Science

B03 · Introductory

Excel for Business Analytics

10 lessons

B03 · Module 4, lesson 1 · Lesson 9 of 10

What-if analysis: data tables, Goal Seek, scenarios and Solver

A well-built model answers questions. Use one to see how a catering job’s contribution responds to guests, hours and costs (data tables and scenarios), to find the price that reaches a target margin (Goal Seek), and to choose the month’s best mix of events and workshops within limited time (Solver).

About 80 minutes

Before you start

You will be able to

  • Build a what-if model with inputs, calculations and outputs separated, one assumption per cell and no typed-in numbers in its formulas.
  • Use one- and two-variable data tables, sensitivity analysis and Scenario Manager to show how an output responds to its inputs.
  • Use Goal Seek to find the input that makes a formula reach a target, and check its answer by algebra.
  • Construct a linear programme for a decision (decision variables, objective, constraints) and solve it with Solver’s Simplex LP method, with and without integer constraints.
  • Interpret Solver’s results: binding constraints, slack, shadow prices, and infeasible or unbounded models.
  • Evaluate a model’s answers with independent checks before acting on them.

Review first

Fictional case A fictional coffee business founded by Ana Lim. It starts as a catering and barista-training service, opens its own cafés and an online shop for beans, and plans a canned cold brew.

The idea

Fictional case

By the end of 2026 Lantern Coffee Co.’s catering business has 18 clients and an event most weeks. Ana Lim prices every job from her quote sheet: $60 to set up, $6.50 a guest, $30 an hour of service, $120 for a pastry platter, and a minimum invoice of $300. Two questions keep coming back: does a particular job make money once the baristas, the coffee and the van are paid for, and when December’s enquiries pile up, which jobs should she take? This lesson builds a small model for the first question and an optimisation model for the second.

A model is a machine for questions

A spreadsheet model turns assumptions into results. It has three parts: inputs, the numbers you are given or assume (the guests, the price per guest, a barista’s wage); calculations, the formulas that combine them; and outputs, the results you care about (the invoice, what the job earns). The cells-and-formulas lesson set out the rule that makes this work: each assumption sits in its own labelled cell, and every formula refers to that cell instead of repeating the number.

A model built that way can be questioned. What-if analysis is the name for those questions: change an input and see what happens to an output, or fix the output you want and work back to the input that delivers it. Excel’s three built-in what-if tools, Scenario Manager, Goal Seek and data tables, are on the Data tab under What-If Analysis. Solver, an add-in, goes further and chooses several inputs at once.

A what-if model: inputs flow through calculations to outputs. The tools differ in which way they run and how many inputs they change.

Ana’s costing model

The quote sheet sets the invoice. To know what a job earns, Ana also needs its direct costs, the costs that exist only because the event happens. Her estimates for 2026 are fictional: baristas earn $23 an hour, for the hours of service plus 1 paid hour each for setting up and packing down; she sends one barista for every 40 guests or part of 40; coffee, milk and cups cost $0.80 a guest; a pastry platter costs her $70; and each event day uses about $25 of van fuel and wear.

What is left of the invoice after the direct costs is the event’s contribution margin, called the contribution for short: the money the job adds towards Lantern’s fixed costs (rent, the van’s depreciation, Ana’s own time) and then profit. The contribution divided by the invoice is the contribution margin ratio. The table shows the model as Ana lays it out, with the first event she wants to price, a team day.

Ana’s costing model for one event day (sheet layout; the costs are fictional)
AB
3–5Guests; hours of service; pastry platter (1 = yes, 0 = no)45; 5; 0
7–11Setup charge; price per guest; charge per hour; platter price; minimum invoice$60.00; $6.50; $30.00; $120.00; $300.00
13–18Wage per hour; paid set-up hours per barista; guests per barista; coffee per guest; platter cost; van per event day$23.00; 1; 40; $0.80; $70.00; $25.00
20Baristas=ROUNDUP(B3/B15,0)
21Invoice=MAX(B11,B7+B8*B3+B9*B4+B10*B5)
22Barista wages=B20*(B4+B14)*B13
23Coffee, milk and cups=B3*B16
24Pastry platter=B5*B17
25Van=B18
26Direct costs=SUM(B22:B25)
27Contribution=B21-B26
28Contribution margin ratio=B27/B21

Rows 3–18 are inputs, typed once; rows 20–28 are formulas and are never typed over. The working model is the first widget under Explore.

For the team day, 45 guests with five hours of service and no pastries, the invoice is 60+6.50×45+30×5=502.5060 + 6.50 \times 45 + 30 \times 5 = 502.50 dollars. Forty-five guests need two baristas, paid for six hours each: 2×6×23=2762 \times 6 \times 23 = 276 dollars. With $36 of coffee, milk and cups and $25 for the van, the direct costs are $337 and the contribution is $165.50, a ratio of 32.9%.

A breakfast for 120 guests with three hours of service and a platter looks very different. The invoice is 60+6.50×120+30×3+120=1,05060 + 6.50 \times 120 + 30 \times 3 + 120 = 1{,}050 dollars; three baristas paid for four hours cost $276; with $96 of coffee, the $70 platter and the van, the direct costs are $467 and the contribution is $583, a ratio of 55.5%. Same quote sheet, very different jobs: the kind of difference a model exists to show.

Four kinds of question

  • What if this input changes? Change it and watch the output: sensitivity analysis by hand, or a data table for a whole list of values at once.
  • What if several inputs change together? Save each combination as a named scenario in Scenario Manager and compare them side by side.
  • What input reaches my target? Goal Seek changes one input until a formula equals the value you want.
  • What is the best choice within my limits? Solver chooses several inputs to make an output as large or as small as possible while respecting constraints: optimisation, the prescriptive analytics of B01, in a spreadsheet.

In depth

Building a model you can question

Good models share a layout: inputs grouped at the top (or on their own sheet) and labelled with their units, calculations below, and outputs where the reader looks first. Ana’s sheet keeps the event in B3:B5, the quote sheet in B7:B11, her cost estimates in B13:B18 and the results in B20:B28. Nothing in the results area is typed: every cell there is a formula.

  • Label every input with its unit and its source (the quote sheet; Ana’s estimate).
  • Mark input cells so readers can tell them from formulas: a fill colour plus a note, since colour alone is easy to miss.
  • Keep one assumption per cell. If the wage changes in January, one edit should update every job.
  • Test the model on a case you can work by hand, as above, and at the edges: 40 guests should need one barista and 41 should need two.

Sensitivity analysis by hand

Sensitivity analysis asks which assumptions matter. The simplest version raises one input at a time by the same proportion, say 10%, and records how far the output moves. The table does this for the breakfast, whose contribution is $583.

The breakfast’s contribution when one input at a time rises by 10% (fictional costs)
Input raised by 10%New valueContributionChange
Price per guest$7.15$661.00+$78.00 (+13.4%)
Barista wage$25.30$555.40−$27.60 (−4.7%)
Guests132$559.40−$23.60 (−4.0%)
Hours of service3.3$571.30−$11.70 (−2.0%)
Coffee, milk and cups per guest$0.88$573.40−$9.60 (−1.6%)
Pastry platter cost$77.00$576.00−$7.00 (−1.2%)
Van cost per event day$27.50$580.50−$2.50 (−0.4%)

Two things stand out. The price per guest matters far more than any cost, so a small discount to win a job is expensive. And more guests lower the contribution: 132 guests need a fourth barista, whose four paid hours ($92) cost more than the extra 12 guests bring in ($68.40 after coffee). A model with steps in it can surprise you, which is why you test changes rather than assume their direction.

One-at-a-time changes have two limits. They ignore what happens when inputs move together, and a 10% change may cross a step (like the fourth barista) that a 5% change would not. Data tables and scenarios deal with both.

Data tables

A data table recalculates the model for a list of values of one input, or for every combination of values of two inputs, and lays the results out as a grid. You build it on the sheet. For a one-variable table with its values down a column, put a formula that refers to the output one row above and one column to the right of the first value. For a two-variable table, put that formula in the top-left corner, one input’s values down the column below it and the other’s across the row to its right. Select the whole block and choose Data › What-If Analysis › Data Table.

Excel’s names for the input cells trip people up. The Row input cell is the cell into which the values in the table’s top row are substituted; the Column input cell takes the values in its left column. So a one-variable table with its values down a column uses only the Column input cell. A data table handles at most two input variables, though each can take as many values as you like.

One-variable data table: contribution by guests (three hours of service, no pastries)
GuestsBaristasContribution
201$167.00
401$261.00
412$174.70
602$283.00
802$397.00
813$310.70
1003$419.00
1203$533.00
1214$446.70
1604$669.00

Each time the guests pass a multiple of 40, Ana sends another barista for four paid hours and the contribution drops by $86.30: 41 guests earn less than 40. (At 20 guests the quote is $280 and the $300 minimum applies.) The rule “one barista per 40 guests” is a business decision written into the model, and the table shows what it costs at the edges.

Two-variable data table: contribution by guests (down) and hours of service (across), no pastries
Guests2 hours3 hours4 hours5 hours6 hours
40$254$261$268$275$282
80$413$397$381$365$349
120$572$533$494$455$416
160$731$669$607$545$483

Read along a row and the hourly charge shows its weakness: each extra hour adds $30 to the invoice and $23 for every barista on the job. With one barista an hour earns $7; with two it loses $16, with three $39 and with four $62. Long events with many guests are the ones Ana under-prices, a pattern the challenging example turns into a pricing rule.

A data table recalculates whenever the worksheet does, even if nothing it depends on has changed, so a workbook with several large tables can become slow. Excel can be set to recalculate everything except data tables: in current versions the option is called Partial (Automatic except for data tables in older versions), under File › Options › Formulas or Formulas › Calculation Options. The tables then update only when you ask Excel to recalculate.

Scenarios and Scenario Manager

A scenario, in B01’s sense, is one possible future described by the values of the uncertain inputs. Excel’s Scenario Manager (Data › What-If Analysis › Scenario Manager) saves named sets of values for chosen changing cells, up to 32 of them, and substitutes a set into the sheet when you show it. Its Scenario summary report puts every scenario’s inputs and chosen result cells side by side on a new sheet.

Ana is unsure about her 2027 costs, so she saves three scenarios for the wage, the coffee cost per guest and the van cost, and summarises the breakfast:

Scenario summary for the breakfast (fictional 2027 costs)
BaseBestWorst
Barista wage per hour (B13)$23.00$23.00$26.00
Coffee, milk and cups per guest (B16)$0.80$0.70$1.00
Van per event day (B18)$25.00$22.00$32.00
Direct costs (B26)$467.00$452.00$534.00
Contribution (B27)$583.00$598.00$516.00
Contribution margin ratio (B28)55.5%57.0%49.1%

Even in the worst case the breakfast keeps a ratio near one half, while the team day, run through the same three scenarios, falls from 32.9% to 22.6%. Scenario Manager has limits worth knowing:

  • Showing a scenario writes its values into the changing cells, replacing what was there, so save the current values as a Base scenario first.
  • Summary reports are not recalculated: if the model changes, create the report again.
  • A best or worst case puts every input at its extreme at once, which is rarely likely, and scenarios carry no probabilities. For an expected value, as in B01, you supply the probabilities yourself.
  • Scenarios kept in other workbooks or sheets can be merged in, which helps when several people each supply one.

Goal Seek

Goal Seek works backwards. You give it a Set cell that contains a formula, the value you want that cell to show (To value), and one input cell to change (By changing cell), which the formula must depend on. Excel tries values of the input, iterating until the formula reaches the target, and leaves the answer in the input cell. It changes exactly one input; for more, use Solver.

Ana wants a contribution margin ratio of at least 45% on every job, and the team day falls short. Goal Seek with Set cell B28, To value 0.45 and By changing cell B8 returns a price per guest of about $8.95; the simple example checks it by algebra. Goal Seek can fail or mislead in four ways:

  • The target can’t be reached. For a 20-guest, two-hour meeting the quote comes to $250, which the $300 minimum lifts to $300. Asking Goal Seek for an invoice of $250 by changing the price per guest fails: up to $9 a guest the invoice stays at $300, and above $9 it rises.
  • The output doesn’t respond near the starting value. The same flat stretch can stop Goal Seek even when a solution exists further away; start it from a different value.
  • There is more than one answer. Goal Seek returns the one it reaches first from the current value.
  • The answer makes no sense in practice. Goal Seek may return 37.6 guests or a negative price. It knows nothing about whole numbers or common sense; you do.

Its answer is also a typed value, not a formula: change the costs and the price Goal Seek found is no longer right. Always check it by putting it back into the model, and where you can, solve the same equation by hand or with a formula that stays live.

Solver and linear programmes

Some questions have many inputs and limits at once. In late November Ana has to decide how many catering events to accept for December and how many Saturday barista workshops to run. Each job earns money but uses her time and the van, and she has only so much of both. Choosing the best combination is an optimisation problem.

An optimisation model has three parts. The decision variables are the quantities chosen: E, the events, and W, the workshops. The objective is the formula to maximise or minimise: total contribution. The constraints are the limits every plan must respect. Ana’s figures are fictional:

  • Contribution: about $350 a catering event (her costing model’s figure for a typical December booking) and $950 a workshop (12 places at $125, less $550 for the room, materials and a second trainer).
  • Her hours: 4 per event (quoting, planning and starting the day on site) and 16 per workshop (preparing, selling places, the three-hour session and the follow-up). She can give 90 hours in December.
  • Van hours: 3 per event and 3 per workshop (taking the training machine to the hired room and back). The van is free for 45 hours.
  • Demand and commitments: at most 15 events (December’s enquiries), at most 3 workshops (Saturdays 5, 12 and 19 December), and at least 8 events, which are already confirmed.
maximise350E+950Wsubject to4E+16W≤90(her hours)3E+3W≤45(van hours)8≤E≤15,W≤3E, W≥0 and whole numbers\begin{aligned} \text{maximise}\quad & 350E + 950W \\ \text{subject to}\quad & 4E + 16W \le 90 \quad \text{(her hours)} \\ & 3E + 3W \le 45 \quad \text{(van hours)} \\ & 8 \le E \le 15, \quad W \le 3 \\ & E,\ W \ge 0 \text{ and whole numbers} \end{aligned}

This is a linear programme: the objective and every constraint are sums of decision variables multiplied by constants. Linear models are solved exactly by the simplex method, Solver’s Simplex LP option. The figure draws this one. Each constraint is a line, and the plans that satisfy all of them form the shaded feasible region. Without whole numbers, the best plan lies at a corner of the region, here where Ana’s hours and the van hours run out together: 12.5 events and 2.5 workshops, worth $6,750.

Ana’s December plan. The shaded area is the feasible region; dots are the whole-number plans inside it. The dotted line joins every plan worth $6,750 and touches the region only at the corner where her hours and the van hours meet.

Half an event is not a plan. Adding the integer constraint that E and W are whole numbers moves the answer to 13 events and 2 workshops, worth $6,450. Rounding the fractional answer would not have found it. Rounding to the nearest gives 13 events and 3 workshops, which needs 100 of Ana’s 90 hours and 48 of the 45 van hours; rounding down gives 12 and 2, worth only $6,100.

Setting up Solver

Solver comes with desktop Excel but must be switched on once: File › Options › Add-ins, choose Excel Add-ins in the Manage box, select Go and tick Solver Add-in. It then appears on the Data tab in the Analysis group. Lay the model out first, as the second widget does: the decision variables in their own cells (B4:C4), the objective as a formula of them (=SUMPRODUCT(B4:C4,B5:C5) in B6), and each constraint’s left-hand side as a formula beside its limit (=SUMPRODUCT($B$4:$C$4,B9:C9) in D9, with the plan as an absolute reference so it can be filled to D10).

In the Solver Parameters dialog, Set Objective is the objective cell (B6); To is Max, Min or Value Of; and By Changing Variable Cells lists the decision variables, up to 200 of them. Add each constraint as a cell, a relationship (<=, =, >=, int, bin or dif) and a limit, preferably a cell such as E9 rather than a typed number. Tick Make Unconstrained Variables Non-Negative unless a variable may go below zero. Then choose the solving method:

  • Simplex LP for linear models like this one. It finds the true optimum; with integer constraints it also searches the whole-number plans.
  • GRG Nonlinear for smooth nonlinear models, such as one where a higher price lowers the number of bookings.
  • Evolutionary for non-smooth models, with jumps or steps in them, such as ROUNDUP or IF applied to a decision variable.

When Solver stops, choose Keep Solver Solution or Restore Original Values, and pick any reports. Its Integer Optimality (%) option matters for whole-number models: at its default of 1%, Solver may stop at a whole-number plan within 1% of the best possible. Set it to 0 when you need the proven optimum.

Reading Solver’s answer

A binding constraint holds exactly at the optimum: the resource is used up. The others have slack, the limit minus what the plan uses. In Ana’s whole-number plan the van is binding (45 of 45 hours), while she has 6 of her 90 hours spare, 1 Saturday free and 2 enquiries unaccepted. Solver’s Answer Report lists the original and final values of the objective and the decision variables, and each constraint’s final value, status (binding or not) and slack. The Solver panel in the second widget shows the constraints part of this report under each result.

The Sensitivity Report goes further, but only for models without integer or binary constraints. For each binding constraint it gives a shadow price: how much the optimal objective changes per unit increase in the limit, and, in its Allowable Increase and Allowable Decrease columns, how far the limit can rise or fall before that rate changes. In Ana’s model without the integer constraint, her hours and the van hours both have a shadow price of $50: with 91 hours the best contribution rises from $6,750 to $6,800. The $50 holds for up to 6 more of her hours; after that the Saturday limit binds and more hours add nothing.

With whole numbers, value comes in lumps. One or two more van hours change nothing in the whole-number plan, because E + W still can’t exceed 15; three more allow a fourteenth event and add $350. And a constraint with slack can still hold a whole-number plan back: Ana has 6 hours spare, yet two more (92) would let her swap two events for the third workshop, 11 and 3, worth $6,700. Shadow prices describe smooth trade-offs that whole-number plans don’t have, which is why Excel offers no Sensitivity Report once integer constraints are in the model. To see what a change is worth, change the limit and solve again.

Two other outcomes need recognising. If no plan meets every constraint, Solver reports that it could not find a feasible solution: with 16 events already confirmed, Ana’s model has no answer, because only 15 enquiries exist and 45 van hours cover at most 15 jobs. If the objective can grow without limit, Solver reports that the objective cell’s values do not converge, which nearly always means a constraint is missing. Remove her hours, the van and the enquiry limit, and Solver would book events without end.

Checking a model’s answers

A model can be wrong in its formulas, its assumptions or its use, and the tools above will happily optimise a mistake. Three habits catch most problems.

  1. Solve it another way. Goal Seek’s price can be checked by algebra. A small linear programme can be checked by listing every plan: with E from 8 to 15 and W from 0 to 3 there are 32 plans, 24 of them feasible; the best is 13 events and 2 workshops, and the next best, 10 events and 3 workshops, earns $100 less.
  2. Back-test it. Run the model on cases whose answers you know. Applied to all 76 events of 2026, Ana’s assumptions give 1,082 paid barista hours and $24,886 of wages, against $25,200 of event wages in Lantern’s books (F02), about 1.2% less; and they leave a contribution of 44.9% of the year’s $62,320 of invoices, in line with the 45% contribution margin used in M01. The costing model is close enough to trust for pricing.
  3. Question the inputs. The plan is only as good as the $350 per event and the 4 hours per event. A data table or a scenario on those estimates shows how far the plan depends on them.

Formulas

Baristas for an event

B=⌈Gg⌉B = \left\lceil \dfrac{G}{g} \right\rceil
BB
Baristas sent to the eventpeople
GG
Guestsguests
gg
Guests per barista (Ana’s rule: 40)guests per barista

Assumes. The ceiling brackets mean “round up to a whole number”: a part-group of guests still needs a barista.

In Excel: ROUNDUP(guests/guests_per_barista, 0), or CEILING(…, 1).

Invoice from the quote sheet (one event day)

I=max⁡ ⁣(M,  S+pG+hH+kP)I = \max\!\left(M,\; S + pG + hH + kP\right)
II
Invoice$
MM
Minimum invoice$
SS
Setup charge per event day$
pp
Price per guest$ per guest
GG
Guestsguests
hh
Charge per hour of service$ per hour
HH
Hours of servicehours
kk
Pastry platter price$
PP
1 if a platter is ordered, 0 if not

A two-day event is quoted day by day. Actual invoices add bespoke changes, so they differ a little from the quote.

Contribution and contribution margin ratio of an event

C=I−[ B(H+u)w+cG+qP+v ],r=CIC = I - \left[\,B(H + u)w + cG + qP + v\,\right], \qquad r = \dfrac{C}{I}
CC
Contribution of the event$
II
Invoice$
BB
Baristaspeople
HH
Hours of servicehours
uu
Paid set-up hours per baristahours
ww
Barista wage$ per hour
cc
Coffee, milk and cups per guest$ per guest
GG
Guestsguests
qq
Pastry platter cost$
PP
1 if a platter is ordered, 0 if not
vv
Van cost per event day$
rr
Contribution margin ratio

Assumes. Only direct costs are subtracted; fixed costs are covered by the contributions of all jobs together.

Price per guest for a target contribution margin ratio

p∗=D1−r∗−S−hH−kPGp^{*} = \dfrac{\dfrac{D}{1 - r^{*}} - S - hH - kP}{G}
p∗p^{*}
Price per guest that gives the target ratio$ per guest
DD
Direct costs of the event$
r∗r^{*}
Target contribution margin ratio
SS
Setup charge$
hh
Charge per hour$ per hour
HH
Hours of servicehours
kk
Platter price$
PP
1 if a platter is ordered, 0 if not
GG
Guestsguests

Assumes. The invoice needed, D ÷ (1 − r*), is above the minimum invoice; the direct costs don’t depend on the price.

This is the equation Goal Seek solves by trial when you set the ratio cell by changing the price.

A linear programme (maximisation)

max⁡∑jcjxjsubject to∑jaijxj≤bi for each i,xj≥0\max \sum_{j} c_j x_j \quad \text{subject to} \quad \sum_{j} a_{ij} x_j \le b_i \ \text{for each } i, \qquad x_j \ge 0
i, ji,\ j
Indexes: i counts the constraints (resources), j the decision variables
xjx_j
Decision variable j (such as the number of events)units chosen
cjc_j
Contribution of one unit of variable j$ per unit
aija_{ij}
Amount of resource i that one unit of variable j usesresource units per unit
bib_i
Amount of resource i available (the limit)resource units

Assumes. Proportionality and additivity: doubling a variable doubles its contribution and its use of each resource, and the effects add up. Constraints can also be ≥ or =; integer constraints are added when the variables must be whole.

Slack in a constraint

si=bi−∑jaijxjs_i = b_i - \sum_{j} a_{ij} x_j
sis_i
Slack in constraint i at a solutionresource units
bib_i
Limit of constraint iresource units
aija_{ij}
Use of resource i per unit of variable jresource units per unit
xjx_j
Value of decision variable j in the solutionunits

A constraint with zero slack is binding.

Worked examples

A first example: The price that gives the team day a 45% ratio

Fictional figures

The team day (45 guests, five hours of service, no pastries) earns a contribution of $165.50 on an invoice of $502.50, a contribution margin ratio of 32.9%. Ana wants at least 45%. Goal Seek (Set cell B28, To value 0.45, By changing cell B8) returns 8.949494… for the price per guest. Check it by algebra and decide what to quote.

  1. The direct costs don’t depend on the price per guest: two baristas × 6 paid hours × $23 = $276, plus 45 × $0.80 = $36 of coffee, plus $25 for the van: $337.
  2. A ratio of 45% means the costs are the other 55% of the invoice, so the invoice must be 337÷(1−0.45)=337÷0.55≈612.73337 \div (1 - 0.45) = 337 \div 0.55 \approx 612.73 dollars. That is above the $300 minimum, so the minimum doesn’t interfere.
  3. The invoice is 60+45p+30×560 + 45p + 30 \times 5. Setting it to 612.73 gives p=(612.73−60−150)÷45≈8.95p = (612.73 - 60 - 150) \div 45 \approx 8.95 dollars a guest, the price Goal Seek found.
  4. Check by putting $8.95 back in B8: the invoice becomes 60 + 45 × 8.95 + 150 = $612.75 and the contribution $275.75, a ratio of 45.0%. Rounding the price up to the cent keeps the ratio just above 45%.

Answer. A price of $8.95 a guest, an invoice of $612.75, gives the team day a contribution of $275.75, a contribution margin ratio of 45.0%.

What it means. At $8.95 a guest the team day costs the client about 612.75÷45≈13.62612.75 \div 45 \approx 13.62 dollars a head, far above Ana’s usual “about $9 a head” (M01) and Brewline Catering’s $7.50. Long, small events are expensive to staff, and the challenging example shows that the hourly charge, not the price per guest, is the better lever.

A harder example: Where the hourly charge goes wrong

Fictional figures

The two-variable data table of contribution by guests and hours (no pastries) is in the In depth section. Explain the pattern along its rows, find the hourly charge per barista at which an extra hour never loses money, and judge whether Ana should charge for hours per barista.

  1. Read the table. At 40 guests (one barista) the contribution rises by $7 for each extra hour; at 80 guests it falls by $16 an hour, at 120 by $39 and at 160 by $62.
  2. Explain it with the model. An extra hour adds the hourly charge, $30, to the invoice and adds one paid hour per barista to the wages, 23B23B dollars. The change in contribution per hour is 30−23B30 - 23B: 7, −16, −39 and −62 for 1 to 4 baristas, exactly the table’s steps.
  3. Find the break-even charge. If Ana charged hh dollars an hour for each barista, an extra hour would change the contribution by hB−23B=(h−23)BhB - 23B = (h - 23)B, which is never negative when h≥23h \ge 23. At $30 per barista-hour every hour earns $7 per barista.
  4. Test it on the team day (two baristas, five hours): the hourly charges become 30×2×5=30030 \times 2 \times 5 = 300 dollars instead of $150, the invoice $652.50 and the contribution $315.50, a ratio of 48.4%. On the breakfast (three baristas, three hours) they become $270 instead of $90, an invoice of $1,230, or $10.25 a head.
  5. Judge. The change fixes long events but raises short, crowded ones like the breakfast well above the $7.50 a head that Brewline Catering charges, and M01 records five bids lost to Brewline on price already. A narrower rule, charging per barista only for hours beyond three, removes the loss on each hour beyond the third without touching breakfasts: the team day’s hourly charges become 30 × 3 + 30 × 2 × 2 = $210, its invoice $562.50 and its contribution $225.50, a ratio of 40.1%.

Answer. Each extra hour changes the contribution by 30 − 23B dollars, so it loses money whenever an event needs two or more baristas. Charging at least $23 per barista-hour removes the loss; $30 per barista-hour lifts the team day to a 48.4% ratio, but would price the breakfast at $10.25 a head. Applying it only to hours beyond three is the better rule: it removes the loss on each hour beyond the third (the team day rises to a 40.1% ratio) without touching breakfasts.

What it means. The data table found the problem; the model’s algebra explained it; the judgement about competitors came from outside the model. That is the usual division of labour: what-if tools show consequences, and people decide which consequences matter.

Applied: a business decision: Ana’s December plan with Solver

Fictional figures

In late November Ana must decide how many December catering events to accept and how many Saturday workshops to run, using the figures and constraints in the In depth section: $350 per event and $950 per workshop; 4 and 16 of her hours (90 available); 3 van hours each (45 available); at most 15 events and 3 workshops; at least 8 events already confirmed. Solve it, check the answer and recommend a plan.

  1. Lay out the model (the second widget): E and W in B4:C4; total contribution in B6, =SUMPRODUCT(B4:C4,B5:C5); hours and van hours used in D9:D10, each a SUMPRODUCT of the plan and the resource row; the limits in E9:E10 and B13:B15.
  2. Solve with Simplex LP, maximising B6 by changing B4:C4, with the five constraints and B4:C4 = integer. Solver returns 13 events and 2 workshops, a contribution of $6,450.
  3. Read the constraints. Van hours used: 13 × 3 + 2 × 3 = 45 of 45, binding. Her hours: 13 × 4 + 2 × 16 = 84 of 90, 6 hours of slack. One Saturday and two enquiries are left unused.
  4. Check by another route. Without the integer constraint Solver gives 12.5 and 2.5 ($6,750), which is no plan; listing all 32 whole-number plans with 8 to 15 events and 0 to 3 workshops confirms that 13 and 2 is the best, $100 ahead of 10 events and 3 workshops ($6,350).
  5. Ask what would change the answer by changing a limit and solving again. Three more van hours (48) allow a fourteenth event: 14 and 2, $6,800 (+$350). Her hours have 6 hours of slack, yet two more (92) let her swap two events for the third workshop: 11 and 3, $6,700 (+$250); six more (96) give 12 and 3, $7,050. In a whole-number model a constraint with slack can still hold the plan back, so test each limit rather than reading its value off the slack.

Answer. Accept 13 catering events and run 2 workshops (5 and 12 December, say), for a contribution of $6,450. The van is the binding constraint; Ana has 6 hours, 1 Saturday and 2 enquiries to spare, though a few more of her own hours would also raise the best plan.

What it means. Solver answered the question the model asked. Whether to hire a second van for a few days, or to decline the enquiries politely and keep the clients for January, are business decisions that the model informs but doesn’t make. December in fact brought 13 events, as the events data show.

Explore

The costing model, starting with the team day. Run Goal Seek as set to find the price per guest for a 45% ratio, then make the two-variable data table of contribution by guests and hours. Change the inputs in B3:B18 to price other events or test other costs, and use Show formulas to see the model.

Loading the interactive…

Ana’s December plan, laid out for Solver. Solve it and read the Answer report under the result: which constraints are binding and how much slack the others have. Then switch the integer constraint and each limit off and on to see which plan wins, and change a limit (E9, E10 or B15) and solve again.

Loading the interactive…

Common mistakes

  • “I’ll put the 40 straight into the formula.”

    A number typed into a formula is invisible to data tables, Goal Seek and Solver, and easy to miss when it changes. Every assumption belongs in a labelled input cell that the formulas refer to.

  • “The values go across the top, so that’s the Column input cell.”

    It is the other way round. The values in a data table’s top row are substituted into the Row input cell; the values in its left column go into the Column input cell. Swapping them gives a table that looks fine and is wrong.

  • “Goal Seek found it, so it’s the answer.”

    Goal Seek finds one value of one input from where it starts. It can fail on a flat stretch (a minimum invoice), stop at one of several answers, or return 37.6 guests. Put the value back into the model, check it makes sense, and solve by hand where you can.

  • “Solver said 12.5 events, so I’ll book 13 and 3 workshops.”

    Rounding a fractional optimum can break constraints (13 and 3 needs 100 of 90 hours) or miss the best whole-number plan. If the decisions must be whole, add integer constraints and solve again.

  • “Solver’s answer is the best plan for the business.”

    It is the best plan for the model. A missing constraint, a wrong estimate or a rule left out (a client who must be served) gives a confident answer to the wrong question. Read which constraints bind and ask whether the model is complete.

  • “The worst case is what we should expect.”

    A worst-case scenario sets every input at its extreme together, which is rarely likely. Scenarios show a range; to weigh them you need probabilities, as in B01’s expected value.

Guided practice

Work through these with hints when you need them. Every hint and every worked solution is there to be used.

Loading four questions…

On your own

No hints this time. Answer, check, and read the feedback; the solution appears once you have answered or if you ask for it. Your first answers count toward mastery.

Loading six questions…

In practice

What-if tools earn their keep in decisions that come round again and again. Three fictional cases show the pattern.

A hotel’s room rates. The revenue manager of a seaside hotel keeps a model of a weekend’s revenue from occupancy and the room rate. A two-variable data table of rates against occupancy shows where a lower rate fills enough extra rooms to pay for itself, and Goal Seek answers the owner’s question: what rate keeps revenue at last year’s level if occupancy falls?

A food bank’s volunteer rota. A food bank schedules volunteers across six shifts a week, each needing a minimum number of people, with each volunteer offering at most two shifts. Solver, with integer constraints, finds the fewest volunteers who can cover the week, and the slack in each shift shows where extra recruits would be wasted.

A bike shop’s service prices. Before printing next year’s price list, a repair shop saves scenarios for labour and parts costs and checks that every service package keeps its target contribution margin ratio even in the worst case.

Fictional case

Ana used all four tools before December. The scenarios told her that the breakfast-type jobs were safe and the long team days were not. Solver’s plan of 13 events and 2 workshops matched the enquiries she accepted, and the van was, as the model said, fully used. From January 2027 her quote sheet charges $30 an hour for each barista on hours of service beyond the third, the narrower rule from the challenging example, and the model, with its inputs in their own cells, took one edit to update.

Two habits from this lesson carry into the rest of the course. Build the model so that its assumptions can be changed in one place, and check every answer a tool gives you by a second route before you act on it. The dashboards lesson that follows turns from deciding to reporting: how to show the results of decisions like these to the people who need them.

Knowledge check

Six questions, one attempt each, no hints. Score 80% or more to complete the lesson; you can take it again at any time.

Loading six questions…

Summary

  • A what-if model separates inputs, calculations and outputs, with one assumption per labelled cell and no numbers typed into formulas.
  • Sensitivity analysis changes one input at a time; a data table shows an output for lists of one or two inputs (top-row values go in the Row input cell, left-column values in the Column input cell); Scenario Manager saves named sets of up to 32 changing cells.
  • Goal Seek changes one input until a formula reaches a target. It can fail on flat stretches or impossible targets, and its answer is a typed value: check it by algebra.
  • An optimisation model has decision variables, an objective and constraints. A linear programme is solved exactly by Solver’s Simplex LP; GRG Nonlinear and Evolutionary handle smooth and non-smooth nonlinear models.
  • Whole-number decisions need integer constraints: rounding a fractional optimum can be infeasible or second-best.
  • Binding constraints are used up; the others have slack. Shadow prices (Sensitivity Report, models without integer constraints) say what one more unit of a limit is worth, within a range.
  • Infeasible means no plan meets every constraint; an objective that does not converge usually means a missing constraint.
  • Check a model by a second method, back-test it on known cases, and question its inputs before acting on its answers.

Key formulas

Terms introduced

What-if analysis
Changing the inputs of a model to see how its outputs respond, or working back from a target output to the input values that reach it.
Contribution margin
Price received minus variable cost per unit: what each unit contributes towards fixed costs and then profit. As a share of price it is the contribution margin ratio.
Sensitivity analysis
Measuring how much a model’s output changes when an input changes, usually one input at a time, to find the assumptions that matter most.
Data table
An Excel what-if tool that recalculates a formula for a list of values of one input cell, or for every combination of values of two input cells, and shows the results as a grid.
Scenario Manager
An Excel what-if tool that saves named sets of values for up to 32 changing cells, substitutes a chosen set into the sheet and summarises the scenarios’ results side by side.
Goal Seek
An Excel what-if tool that finds the value of one input cell that makes a formula cell equal a target value, by trying values in turn.
Solver
An Excel add-in that chooses the values of several decision-variable cells to maximise, minimise or set the value of an objective cell, subject to constraints.
Decision variable
A quantity the decision maker controls and an optimisation model chooses, such as the number of events to accept; in Solver, a variable cell.
Objective
In an optimisation model, the quantity to be maximised or minimised, such as total contribution; in Solver, the formula in the objective cell.
Constraint
A limit that every solution of an optimisation model must respect, written as a formula compared with a bound by ≤, = or ≥, such as hours used ≤ hours available.
Linear programme
An optimisation model whose objective and constraints are all sums of decision variables multiplied by constants, so that it can be solved exactly by the simplex method.
Feasible region
The set of all values of the decision variables that satisfy every constraint of an optimisation model.
Integer constraint
A constraint that a decision variable must take a whole-number value; int in Excel’s Solver.
Binding constraint
A constraint that holds exactly at the optimum, so that the resource it describes is used up; relaxing it could improve the objective.
Slack
The unused part of a constraint at a solution: its limit minus what the solution uses.
Shadow price
In a linear programme without integer constraints, the change in the optimal objective per unit increase in a constraint’s limit, valid over a stated range.

Sources

  1. Microsoft. “Introduction to What-If Analysis”. Microsoft Support. support.microsoft.com/en-us/Excel/introduction-to-what-if-an…
  2. Microsoft. “Use Goal Seek to find the result you want by adjusting an input value”. Microsoft Support. support.microsoft.com/office/use-goal-seek-to-find-the-resul…
  3. Microsoft. “Calculate multiple results by using a data table”. Microsoft Support. support.microsoft.com/en-us/excel/calculate-multiple-results…
  4. Microsoft. “Change formula recalculation, iteration, or precision in Excel”. Microsoft Support. support.microsoft.com/office/change-formula-recalculation-it…
  5. Microsoft. “Define and solve a problem by using Solver” and “Load the Solver Add-in in Excel”. Microsoft Support. support.microsoft.com/en-us/excel/define-and-solve-a-problem…
  6. Frontline Systems. “Excel Solver Tutorial: Step by Step Easy to use guide for Excel’s Solver”. solver.com. solver.com/node/181
  7. Frontline Systems. “Module 2: Reports and Sensitivity” (the Sensitivity Report) and “Excel Solver: How Integer, Binary and Alldifferent constraints affect solving” (solver.com/node/192, Integer Optimality). solver.com. solver.com/courses/optimization/module-2/reports-and-sensiti…