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.
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
| A | B | |
|---|---|---|
| 1 | Input / output | Value |
| 2 | Price per unit | 25 |
| 3 | Variable cost per unit | 15 |
| 4 | Fixed costs | 12000 |
| 5 | Units sold | 1000 |
| 6 | Profit | -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?
- Choose Data › Forecast › What-If Analysis › Goal Seek.
- Set cell:
B6(the profit formula). - To value:
0. - By changing cell:
B5(units sold). - Click OK. Goal Seek reports a solution and
B5now 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.
Data Tables: many inputs at once
A one-variable data table shows how an output changes for a list of input values.
| D | E | |
|---|---|---|
| 1 | Units | Profit |
| 2 | -2000 | |
| 3 | 800 | -4000 |
| 4 | 1000 | -2000 |
| 5 | 1200 | 0 |
| 6 | 1400 | 2000 |
| 7 | 1600 | 4000 |
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
- Type the input values in a column:
D3:D7with 800, 1,000, 1,200, 1,400, 1,600. - In the cell one row above and one column to the right of the first value,
E2, enter=B6, a link to the output. - Select the whole block
D2:E7. - Choose Data › What-If Analysis › Data Table.
- Leave Row input cell empty. Set Column input cell to
B5(units sold), because the input values are in a column. - Click OK. Excel fills
E3:E7with{=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.
| D | E | F | G | |
|---|---|---|---|---|
| 10 | -2000 | 22 | 25 | 28 |
| 11 | 1000 | -5000 | -2000 | 1000 |
| 12 | 1200 | -3600 | 0 | 3600 |
| 13 | 1400 | -2200 | 2000 | 6200 |
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.
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.
- Choose Data › What-If Analysis › Scenario Manager and click Add.
- Name:
Base. Changing cells:B2,B3,B5(price, variable cost, units). Click OK and enter 25, 15, 1,000. - Add
Bestwith 27, 14, 1,400 andWorstwith 23, 16, 800. - Select a scenario and click Show to put its values into the model.
- Click Summary, choose Scenario summary with result cell
B6. Excel creates a new sheet comparing all scenarios.
| Scenario | Price | Var. cost | Units | Profit |
|---|---|---|---|---|
| Base | 25 | 15 | 1,000 | -2,000 |
| Best | 27 | 14 | 1,400 | 6,200 |
| Worst | 23 | 16 | 800 | -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
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Desks | Chairs | Used | Available | |
| 2 | Units to make | 0 | 0 | ||
| 3 | Profit per unit | 40 | 30 | ||
| 4 | Machine hours | 2 | 1 | 0 | 100 |
| 5 | Labour hours | 1 | 1 | 0 | 80 |
| 6 | Total profit | 0 |
B2:C2 are the decisions. D4 =SUMPRODUCT($B$2:$C$2,B4:C4), D5 likewise, D6 =SUMPRODUCT(B2:C2,B3:C3).
- Open Data › Solver.
- Set Objective:
$D$6, To: Max. - By Changing Variable Cells:
$B$2:$C$2. - Click Add for constraints:
$D$4 <= $E$4,$D$5 <= $E$5, and$B$2:$C$2 = integer(choose int). - Tick Make Unconstrained Variables Non-Negative and choose the Simplex LP method, because the model is linear.
- 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.
Choosing the right tool
| Question | Tool |
|---|---|
| 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?
Goal Seek finds one input for one target value.
2. In a one-variable data table with input values in a column, which box do you fill?
Values listed down a column are fed into the column input cell.
3. With price 25, variable cost 15 and fixed costs 12,000, what is the break-even volume?
Each unit contributes 10; 12,000 / 10 = 1,200.
4. Which Solver method suits a linear product-mix model?
Simplex LP is exact and fast for linear problems.
5. How do you make Solver available?
Solver is a free add-in that must be ticked once in the Add-ins dialog.