Sub topic 5
Building a One-Variable Data Table
Assume you know basic Excel navigation, cell references, absolute references, and simple financial modeling. You should also be comfortable with percentages and formulas such as PMT. A one-variable data table changes one model input across several values and records the resulting output for each value.
Why use a one-variable table?
A sensitivity table shows how an output changes when one assumption changes. For example, a loan model can show the monthly payment at interest rates from 4.5% to 8.5%.
The model should separate:
- Input cells, such as the loan amount, interest rate, and term.
- Calculation cells, such as the monthly payment.
- Output cells, which display the result you want to test.
The data table temporarily replaces the selected input cell, recalculates the model, and restores the original input. It does this for every value in the sensitivity range.
Prepare the model
Create this small loan model:
B1: 300000
B2: 0.065
B3: 30
B4: =PMT(B2/12, B3*12, -B1)Here, B2 is the annual interest rate, and B4 is the monthly payment. The negative sign before B1 makes the payment display as a positive amount.
Format B2 as a percentage and B4 as currency. The formula in B4 must depend on B2. If the output does not reference the input cell, the table will not show a meaningful change.
Build a column-oriented table
A column-oriented table places the test values down one column. The output formula goes one row above the first test value and one column to its right.
Set up the range as follows:
| Cell | Content |
|---|---|
| D2 | blank |
| E2 | `=B4` |
| D3:D7 | `4.5%`, `5.5%`, `6.5%`, `7.5%`, `8.5%` |
The layout is important. Excel uses the position of the formula and test values to recognize the table.
- Select
D2:E7. - Select Data > What-If Analysis > Data Table.
- Leave Row input cell empty.
- Set Column input cell to
B2. - Select OK.
Excel fills E3:E7 with the monthly payment for each interest rate.
Build a row-oriented table
You can place the test values across a row instead. For example:
| Cell | Content |
|---|---|
| D2 | `=B4` |
| E2:I2 | `4.5%`, `5.5%`, `6.5%`, `7.5%`, `8.5%` |
| D3 | blank |
Select D2:I2 and the blank corner beneath the formula, such as D2:I3, then open Data Table. Leave Column input cell empty and set Row input cell to B2. Excel writes the results across the row beneath the test values.
Use the orientation that fits your report. A column often works better when you want to add labels or compare several outputs vertically.
Verify and debug the result
Include the current interest rate, 6.5%, among the test values. The matching table result should equal B4. A check cell can calculate:
K2: =E5-B4If the result is zero, the base case agrees with the model.
A flat table usually means the output does not depend on the selected input, the wrong input cell was supplied, or the model uses a hardcoded value instead of the input cell. A wrong-axis result usually means a row input cell was used for a vertical table, or a column input cell was used for a horizontal table.
Exercise
In a vertical table, the rates are in D3:D7 and the output formula is in E2. Which input-cell field should contain B2?
Show answer
Put B2 in the Column input cell field and leave the Row input cell field empty.