Sub topic 6
Building a Two-Variable Data Table
Assume you know basic Excel navigation, cell references, absolute references, and how a formula-driven financial model works. This chapter uses a loan model, but the same method applies to a discounted cash flow (DCF) model.
What a two-variable table shows
A two-variable data table shows how one output changes when two input cells change at the same time. For example, you can test monthly loan payments across several interest rates and loan terms.
The model should have:
- Input cells, such as interest rate and term.
- A formula-driven output, such as monthly payment.
- A grid containing possible values for the two inputs.
Excel substitutes each pair of values into the model, recalculates the output, and writes the result into the matching grid cell.
B1: 300000 (Loan amount)
B2: 0.065 (Annual interest rate)
B3: 30 (Term in years)
B4: =PMT(B2/12, B3*12, -B1) (Monthly payment)How the grid maps to the model
The values across the top row replace the row input cell. The values down the first column replace the column input cell.
In this example:
- The years run across the top, so they replace
B3. - The rates run down the left side, so they replace
B2. - The formula in the top-left corner of the table points to the output,
B4.
Build the two-variable table
First, arrange the table. The corner cell must contain a reference to the output formula.
| Cell range | Contents |
|---|---|
| D2 | `=B4` |
| E2:I2 | 10, 15, 20, 25, 30 |
| D3:D7 | 4.5%, 5.5%, 6.5%, 7.5%, 8.5% |
| E3:I7 | Empty result area |
Select the entire range D2:I7. Then choose Data > What-If Analysis > Data Table.
In the dialog box, enter:
- Row input cell:
B3 - Column input cell:
B2
Click OK. Excel fills E3:I7 with the payment for every rate and term combination.
D2: =B4
E2:I2 (years): 10, 15, 20, 25, 30
D3:D7 (rates): 0.045, 0.055, 0.065, 0.075, 0.085
Select D2:I7
Choose Data > What-If Analysis > Data Table
Row input cell: B3
Column input cell: B2A row input cell does not mean “the input shown in a row” in general. It specifically means the model cell replaced by values across the table's top row. Likewise, the column input cell is replaced by values down the left side.
Check the axis direction
A reversed assignment often produces plausible-looking but incorrect results. Test one cell manually by entering a rate and term into the model, recording the output, and comparing it with the corresponding table cell.
The table should also move logically:
- Higher interest rates should increase the payment.
- Longer terms should usually reduce the payment, although total interest may increase.
Exercise
Exercise
In a table with discount rates across the top and terminal growth rates down the side, which cells belong in the Row input cell and Column input cell?
Show answer
Put the discount-rate input in Row input cell because rates run across the top. Put the terminal-growth input in Column input cell because growth rates run down the side.