Excel course · Lesson 26 of 34

What-if analysis: Goal Seek, Data Tables, Scenario Manager and Solver

Answer 'what if' questions: find break-even with Goal Seek, test many inputs with Data Tables, compare cases with Scenario Manager and optimise with Solver.

Advanced 20 min read

A good model separates inputs (price, volume, costs, interest rate) from outputs (profit, payment). Once it does, Excel can explore it for you. What price do we need to reach a target? What happens to profit across ten different volumes? How do the best and worst cases compare? What product mix maximises profit within our capacity? Excel's what-if tools answer each of these. They live under Data › Forecast › What-If Analysis, and Solver under Data › Analyze.

The model

B6fx=B5*(B2-B3)-B4
AB
1Input / outputValue
2Price per unit25
3Variable cost per unit15
4Fixed costs12000
5Units sold1000
6Profit-2000

A break-even model. Inputs in B2:B5, profit in B6. Each unit contributes 10, so 1,000 units do not cover 12,000 of fixed costs.

Result: -2000

Goal Seek: work backwards to a target

Goal Seek changes one input until a formula reaches a value you specify. How many units must we sell to break even?

  1. Choose Data › Forecast › What-If Analysis › Goal Seek.
  2. Set cell: B6 (the profit formula).
  3. To value: 0.
  4. By changing cell: B5 (units sold).
  5. Click OK. Goal Seek reports a solution and B5 now shows 1,200. Click OK to keep it or Cancel to restore the original 1,000.

The same tool answers loan questions. With a payment formula =PMT(6%/12, 60, -B1) for a loan amount in B1, Goal Seek can find the largest loan whose monthly payment is 500: set the payment cell to 500 by changing B1; the answer is about 25,862.78. See Excel for finance basics: loan schedules with PMT, IPMT, PPMT and a budget for PMT.

Watch out. Goal Seek changes one input only, and the set cell must contain a formula that depends on it. It also stops at the first solution it finds within a tolerance, so results may be slightly off (1,199.9999 instead of 1,200). Round or check the result.

Data Tables: many inputs at once

A one-variable data table shows how an output changes for a list of input values.

E2fx=B6
DE
1UnitsProfit
2-2000
3800-4000
41000-2000
512000
614002000
716004000

D3:D7 hold the units to test. E2 links to the profit cell (=B6). After the Data Table command, E3:E7 show the profit for each volume.

Result: -2000

  1. Type the input values in a column: D3:D7 with 800, 1,000, 1,200, 1,400, 1,600.
  2. In the cell one row above and one column to the right of the first value, E2, enter =B6, a link to the output.
  3. Select the whole block D2:E7.
  4. Choose Data › What-If Analysis › Data Table.
  5. Leave Row input cell empty. Set Column input cell to B5 (units sold), because the input values are in a column.
  6. Click OK. Excel fills E3:E7 with {=TABLE(,B5)}, recalculating the model once per row.

A two-variable data table varies two inputs: put prices across the top row and units down the left column, the output link in the top-left corner, then set both the row input cell (B2, price) and the column input cell (B5, units). The grid shows profit for every combination, a perfect base for a heat map with Conditional formatting, including formula-based rules.

DEFG
10-2000222528
111000-5000-20001000
121200-360003600
131400-220020006200

Two-variable table: D10 holds =B6 (it shows the current profit, -2,000), prices across (row input B2), units down (column input B5). At price 22 the margin is 7 per unit.

Tip. Data tables recalculate the model many times and can slow down a big workbook. Formulas › Calculation Options › Automatic Except for Data Tables keeps the workbook fast; press F9 to update the tables when you need them.

Scenario Manager: named sets of inputs

Scenarios store several input values under a name such as Best, Base and Worst case, so you can switch between them or produce a summary.

  1. Choose Data › What-If Analysis › Scenario Manager and click Add.
  2. Name: Base. Changing cells: B2,B3,B5 (price, variable cost, units). Click OK and enter 25, 15, 1,000.
  3. Add Best with 27, 14, 1,400 and Worst with 23, 16, 800.
  4. Select a scenario and click Show to put its values into the model.
  5. Click Summary, choose Scenario summary with result cell B6. Excel creates a new sheet comparing all scenarios.
ScenarioPriceVar. costUnitsProfit
Base25151,000-2,000
Best27141,4006,200
Worst2316800-6,400

Give input cells names first (for example Price, Units); the summary report then shows names instead of cell addresses. Scenario Manager is limited to 32 changing cells per scenario and is not available in Excel for the web.

Solver: optimise with constraints

Goal Seek finds an input for a target; Solver finds the best combination of several inputs subject to rules. It is a free add-in: enable it under File › Options › Add-ins › Manage: Excel Add-ins › Go, tick Solver Add-in. On Mac use Tools › Excel Add-ins. It then appears as Data › Analyze › Solver.

Example: the best product mix

ABCDE
1DesksChairsUsedAvailable
2Units to make00
3Profit per unit4030
4Machine hours210100
5Labour hours11080
6Total profit0

B2:C2 are the decisions. D4 =SUMPRODUCT($B$2:$C$2,B4:C4), D5 likewise, D6 =SUMPRODUCT(B2:C2,B3:C3).

  1. Open Data › Solver.
  2. Set Objective: $D$6, To: Max.
  3. By Changing Variable Cells: $B$2:$C$2.
  4. Click Add for constraints: $D$4 <= $E$4, $D$5 <= $E$5, and $B$2:$C$2 = integer (choose int).
  5. Tick Make Unconstrained Variables Non-Negative and choose the Simplex LP method, because the model is linear.
  6. Click Solve and then Keep Solver Solution.

Solver answers 20 desks and 60 chairs: machine hours 2×20 + 60 = 100, labour hours 20 + 60 = 80, profit 40×20 + 30×60 = 2,600. Making only chairs (80) would earn 2,400 and only desks (50) 2,000, so the mix beats both.

Tip. Use Simplex LP for linear models (sums of inputs times constants), GRG Nonlinear for smooth nonlinear ones, and Evolutionary for models with IF, lookups or other jumps. Save the Solver model with Load/Save if you want to keep several setups in one sheet.

Choosing the right tool

QuestionTool
What input gives exactly this output?Goal Seek
How does the output change across a range of inputs?Data Table
How do a few named cases compare?Scenario Manager
What is the best combination within limits?Solver
What will the trend give next year?Data › Forecast Sheet and FORECAST.LINEAR

Check yourself

1. You want the price that gives a profit of exactly 5,000. Which tool?

2. In a one-variable data table with input values in a column, which box do you fill?

3. With price 25, variable cost 15 and fixed costs 12,000, what is the break-even volume?

4. Which Solver method suits a linear product-mix model?

5. How do you make Solver available?

⬇Practice workbookExamples with live formulas + practice sheets · .xlsx · 14 KB