Sub topic 2
Building a one-variable data table
This chapter assumes you know basic cell references, absolute references such as $B$2, and how to build a simple model with inputs and one formula-driven output. The running example is a loan model: B1 holds the loan amount, B2 the annual rate, B3 the term in years, and B4 the monthly payment, =PMT(B2/12, B3*12, -B1).
Building a one-variable data table
A one-variable data table recalculates the output for each value of one input. List the rates down D3:D7 and put a link to the output in E2: =B4.
- Select D2:E7.
- Go to Data > What-If Analysis > Data Table.
- Enter B2 in the Column input cell box. Leave the Row input cell box empty.
- Click OK.
Excel fills E3:E7 with {=TABLE(,B2)}. You cannot edit one cell of this array. Select the whole grid to change it.
Building a two-variable data table
For two inputs, place the output link in the top-left corner: D2 =B4. Put the terms across E2:I2 (10, 15, 20, 25, 30) and the rates down D3:D7. Select D2:I7. Set the Row input cell to B3, which matches the top row, and the Column input cell to B2, which matches the left column. Excel fills E3:I7 with {=TABLE(B3,B2)}.
Swapping the two input cells produces numbers that look plausible but answer a different question. Confirm that each header matches its input cell before you accept the grid.
Checking the table against the base case
A table is correct when the cell for the current inputs equals the model output. In the one-variable table, the 6.5% row is E5. Enter =E5-B4 in K2. For the two-variable table, the 6.5% and 30-year cell is I5, so use =I5-B4 in a free cell. Both should return 0. A nonzero result usually means an input cell points to the wrong place or the table has not recalculated.
Formatting the table and highlighting the base case
Select E3:I7 and add a conditional formatting rule that uses a formula: =AND($D3=$B$2, E$2=$B$3). Apply a fill color. Only the cell matching the current inputs is highlighted, so the base case stays visible when you change the inputs. A three-color scale across the grid gives a heatmap of the full sensitivity pattern.
Exercise
Q: In a one-variable table, the rates sit in D3:D7 and you want Excel to substitute each rate into B2. Which input cell do you enter, and which box stays empty?
A: Enter B2 in the Column input cell box, because the values run down a column. Leave the Row input cell box empty.