Excel Advanced - What-If Analysis (Goal Seek, Data Tables, and Solver)

Excel What-If Analysis Tutorial

Excel What-If Analysis

A practical guide to Goal Seek, one-variable and two-variable Data Tables, and Solver.

Learning outcome: Build one profit model, then use Excel to find a target, compare possible results, and optimise decisions.

1. Build the profit model

Use one worksheet for the profit model and both Data Tables. Enter labels in column A and values or formulas in column B.

RowColumn A — labelColumn B — value or formula
2A2: Selling price per unitB2: 50
3A3: Variable cost per unitB3: 30
4A4: Fixed costsB4: 5000
5A5: Units soldB5: 500
6Leave blank.
7A7: RevenueB7: =B2*B5
8A8: Total variable costB8: =B3*B5
9A9: ProfitB9: =B7-B8-B4
Check: B7 = RM25,000, B8 = RM15,000 and B9 = RM5,000.

2. Goal Seek

Question: How many units must be sold to earn RM20,000 profit?

Goal Seek changes one input until a formula reaches a target.

  1. Choose Data → What-If Analysis → Goal Seek.
  2. Enter the settings below.
  3. Choose OK, then keep the solution.

Goal Seek

Set cell:$B$9
To value:20000
By changing cell:$B$5
Answer: B5 becomes 1,250 units. Profit becomes RM20,000.
Remember: Set cell is the formula result. Changing cell is the input Excel may adjust.

3. One-variable Data Table

Question: What profit will result from several sales quantities?

Keep the Data Table on the same worksheet as B5 and B9.

Set up the table

CellEnter
D3Leave blank
E3=B9
D4:D8500, 750, 1000, 1250, 1500
E4:E8Leave blank for Excel to calculate

Create the table

  1. Select D3:E8.
  2. Choose Data → What-If Analysis → Data Table.
  3. Leave Row input cell blank.
  4. Set Column input cell to $B$5.
  5. Choose OK.
Units soldProfit
500RM5,000
750RM10,000
1,000RM15,000
1,250RM20,000
1,500RM25,000
Why Column input cell? The test values run downward in a column.

4. Two-variable Data Table

Question: What profit will result from different combinations of selling price and units sold?

Keep this table on the same worksheet as B2 and B5.

Set up the table

LocationEnter
H3=B9
I3:L345, 50, 55, 60 — selling prices
H4:H7500, 750, 1000, 1250 — units sold
I4:L7Leave blank for Excel to calculate

Create the table

  1. Select H3:L7.
  2. Choose Data → What-If Analysis → Data Table.
  3. Set Row input cell to $B$2 because prices run across the top row.
  4. Set Column input cell to $B$5 because quantities run down the first column.
  5. Choose OK.
Units \ PriceRM45RM50RM55RM60
500RM2,500RM5,000RM7,500RM10,000
750RM6,250RM10,000RM13,750RM17,500
1,000RM10,000RM15,000RM20,000RM25,000
1,250RM13,750RM20,000RM26,250RM32,500
Memory rule: Top-row values use Row input cell. First-column values use Column input cell.

5. Solver

Question: How many units of Product A and Product B should be produced to maximise profit without exceeding labour and material limits?

Create a new worksheet named Solver Model.

Build the model

CellEnter
B2:C2Product A, Product B
A3Quantity
B3:C30, 0 — Solver changes these cells
A4 and B4:C4Unit profit; 40, 55
A5 and B5:C5Labour per unit; 2, 4
A6 and B6:C6Material per unit; 3, 2
E3=SUMPRODUCT(B3:C3,B4:C4) — total profit
E5=SUMPRODUCT(B3:C3,B5:C5) — labour used
E6=SUMPRODUCT(B3:C3,B6:C6) — material used
F5:F6400, 300 — available resources

Run Solver

If Solver is missing, enable Solver Add-in from File → Options → Add-ins → Excel Add-ins → Go.

  1. Choose Data → Solver.
  2. Set Objective to $E$3 and select Max.
  3. Set Changing Variable Cells to $B$3:$C$3.
  4. Add $E$5<=$F$5 for labour.
  5. Add $E$6<=$F$6 for material.
  6. Add $B$3:$C$3>=0 and $B$3:$C$3 = int.
  7. Select Simplex LP, then choose Solve.
Optimal answer: Produce 50 units of Product A and 75 units of Product B. Maximum profit is RM6,125. Labour used = 400 hours; material used = 300 units.

6. Which tool should you use?

QuestionTool
What one input produces a target result?Goal Seek
What results come from several values of one input?One-variable Data Table
What results come from combinations of two inputs?Two-variable Data Table
What combination gives the best result within limits?Solver

Essential checks

  • Goal Seek’s Set cell must contain a formula.
  • Data Table input cells must be on the same worksheet as the table.
  • The Data Table corner cell must link to the result formula, such as =B9.
  • Solver’s changing cells must be editable inputs, not formulas.
...