Excel Advanced - What-If Analysis
What-If Analysis
Explore alternative assumptions, find the input required for a target result and optimise decisions while respecting real business limits.
Learning outcomes
Download the practice model
The embedded dataset contains a base profit model, three business scenarios and a three-product optimisation problem.
1. Build the profit model
Verify the base calculation
On the Model sheet, enter 500 units, RM120 selling price, RM72 variable cost per unit and RM15,000 fixed cost.
Revenue = Units × PriceProfit = (Units × Price) − (Units × Variable Cost) − Fixed CostCheckpoint: Revenue RM60,000; total variable cost RM36,000; contribution RM24,000; profit RM9,000.
2. One-variable Data Table
Test alternative prices
- List RM100, RM110, RM120 and RM130 vertically.
- In the top-right corner of the result block, enter a direct reference to the Profit cell.
- Select the complete block, including prices and the formula reference.
- Choose Data → What-If Analysis → Data Table.
- Set Column input cell to the Price input cell; leave Row input blank.
| Price | Expected profit |
|---|---|
| RM100 | −RM1,000 |
| RM110 | RM4,000 |
| RM120 | RM9,000 |
| RM130 | RM14,000 |
Diagnose Data Table problems
- The corner cell must reference the output formula, not type the current result.
- Because test values run down a column, use the Column input cell.
- Do not edit one result cell inside a Data Table array; select the whole table to delete it.
3. Two-variable Data Table
Compare price and quantity together
- Place prices RM100–RM130 across the top row.
- Place quantities 400, 500, 600 and 700 down the first column.
- Put a reference to Profit in the upper-left corner.
- Select the whole grid and open Data Table.
- Set Row input cell to Price and Column input cell to Units.
Check selected intersections: 400 units at RM100 = −RM3,800; 500 at RM120 = RM9,000; 700 at RM130 = RM25,600.
4. Goal Seek
Find units for RM20,000 profit
- Choose Data → What-If Analysis → Goal Seek.
- Set cell: Profit.
- To value: 20000.
- By changing cell: Units.
- Accept the result and record it.
Expected result: approximately 729.17 units. If sales must be whole units, test 730; profit becomes RM20,040.
Why is Goal Seek suitable?
There is one target formula and one unknown input. Goal Seek changes only one input and does not handle multiple constraints.
5. Scenario Manager
Create three named scenarios
Use Units, Price, Variable Cost and Fixed Cost as the four changing cells.
| Scenario | Units | Price | Variable cost | Fixed cost | Profit |
|---|---|---|---|---|---|
| Base | 500 | 120 | 72 | 15,000 | 9,000 |
| Optimistic | 650 | 130 | 68 | 14,500 | 25,800 |
| Conservative | 400 | 105 | 75 | 17,000 | −5,000 |
- Open Scenario Manager and choose Add.
- Name each scenario and keep the same four changing cells.
- Enter its values, then use Show to place them into the model.
Create a Scenario Summary
- Open Scenario Manager and choose Summary.
- Select Scenario summary.
- Choose Profit as the result cell.
- Rename input and output cells before generating the report so the labels are readable.
The new Scenario Summary sheet is static. Recreate it after changing scenario definitions.
6. Solver optimisation
Prepare the production model
| Product | Profit/unit | Labour/unit | Material/unit |
|---|---|---|---|
| A | RM45 | 2 | 3 |
| B | RM60 | 3 | 2 |
| C | RM38 | 1 | 4 |
Available resources: 600 labour hours and 700 material units.
Total profit = SUMPRODUCT(Quantity, Profit per unit)Resources used = SUMPRODUCT(Quantity, Resource per unit)Configure and solve
- Enable Solver through File → Options → Add-ins if it is missing.
- Set the Total Profit cell as the objective and choose Max.
- Use the three Quantity cells as changing variables.
- Add Labour Used ≤ 600 and Material Used ≤ 700.
- Require quantities to be non-negative integers.
- Select Simplex LP, solve and keep the solution.
Expected optimum: A=0, B=170, C=90; maximum profit RM13,620. Both resource limits are fully used.
Choose the right What-If tool
| Question | Tool |
|---|---|
| How does one or two inputs affect one formula? | Data Table |
| Which single input produces a target result? | Goal Seek |
| How do named sets of assumptions compare? | Scenario Manager |
| Which combination gives the best result under constraints? | Solver |
Troubleshooting
Check the formula corner and row/column input-cell assignment.
Confirm the target cell contains a formula dependent on the changing cell.
Name the changing and result cells before generating the summary.
Enable Solver Add-in through Excel Options; it is not always active by default.
Knowledge check
1. Can Goal Seek change several inputs?
No. It changes one input to reach one target. Use Solver for several variables or constraints.
2. Why does a two-variable Data Table use both row and column input cells?
Values across the top replace one model input, while values down the first column replace the other.
3. Are Scenario Summary reports dynamic?
No. Generate a new summary after changing scenarios.
4. Why add integer constraints in Solver?
Products or people may need whole-number decisions even when the mathematical model permits fractions.
Completion checklist
- Base profit: RM9,000
- One-variable profits: −RM1,000 / RM4,000 / RM9,000 / RM14,000
- Goal Seek: approximately 729.17 units
- Scenario profits: RM9,000 / RM25,800 / −RM5,000
- Solver quantities: A=0, B=170, C=90
- Solver maximum profit: RM13,620
Next lesson: combine arrays, lookups, logical functions, links, consolidation and workbook navigation.