Templates, guides & honest tool reviews for small business

Monday, November 30, 2026

Two-Variable Data Table in Excel: Rates and Terms Together

Section: Excel & Google Sheets

Two-variable data table - explanatory illustration for Two-Variable Data Table in Excel
Illustration: Two-variable data table

A two-variable data table in Excel shows one formula's answer for every combination of two inputs, all in one block. You set the payment formula once, list interest rates down a column and loan terms across a row, and Excel fills the grid: twelve payments from one formula, refreshed whenever an input changes. This guide covers what a data table is, how a two-variable table differs from a one-variable table, Microsoft's setup steps, a worked grid of payments, and the calculation cost nobody mentions until a workbook gets slow.

What a data table is

Microsoft describes a data table as a range of cells in which you change values in some cells and get different answers to a problem, and places it among the What-If analysis tools. The classic example on the same page is a PMT formula with different loan amounts and interest rates, which is exactly the shape of the question a borrower asks.

There are three What-If tools: scenarios, data tables and Goal Seek. Scenarios and data tables take sets of input values and calculate the results. Goal Seek works the other way round, starting from one result and finding the input that produces it.

One variable or two

A one-variable data table varies a single input cell and shows the results in a column or a row beside it. A two-variable data table varies two input cells at once, one across a row and one down a column, and fills the rectangle between them.

Two is the hard limit. Microsoft states that a data table cannot accommodate more than two variables, and points to scenarios when you need more. A data table can hold as many different values as you like for each of its two variables, while a single scenario holds at most 32 values, so the two tools trade breadth for depth.

One or two variables in a data table - explanatory illustration for Two-Variable Data Table in Excel
One or two variables in a data table (explanatory illustration, not a software screenshot).

Setting up a two-variable table

The layout has three parts, and the order matters. The formula goes in one cell at the top left of the block. One list of values runs down the column below the formula. The second list runs across the row to the right of the formula. The formula must refer to two different input cells, one for each list, and those two cells live somewhere else on the sheet.

Microsoft's example uses the mortgage case: the loan amount in B5, the annual rate in B3 and the term in months in B4, with the formula =PMT(B3/12,B4,-B5) in C2. The rates sit in C3, C4 and C5, the terms sit in D2 and E2, and the results fill D3:E5.

The steps

  1. Enter the formula that refers to the two input cells. In the example, that is =PMT(B3/12,B4,-B5) in C2.
  2. Type the first list of values in the same column, below the formula. Here the interest rates go in C3, C4 and C5.
  3. Type the second list in the same row as the formula, to its right. Here the loan terms in months go in D2 and E2.
  4. Select the whole block: the formula cell, both lists and the empty cells where the results will land. In the example, C2:E5.
  5. On the Data tab, choose What-If Analysis and then Data Table.
  6. In the Row input cell box, enter the cell that holds the values running across the row. In the example that is B4, the term.
  7. In the Column input cell box, enter the cell that holds the values running down the column. In the example that is B3, the rate.
  8. Select OK, and Excel fills the block.

The mapping is the step people get wrong. The row input cell takes the values that run across the top row, and the column input cell takes the values that run down the left column, whatever those values happen to represent. Swap them and the grid still fills, but every number in it is wrong.

The steps for a two-variable table - explanatory illustration for Two-Variable Data Table in Excel
The steps for a two-variable table (explanatory illustration, not a software screenshot).

A worked grid

Here is the same idea with a 225,000 loan and three rates against four terms. The rates run across the top and the terms down the left, so the row input cell is the rate cell and the column input cell is the term cell. The figures below are monthly payments I calculated with the PMT formula, and the top left cell matches the 1,042.01 that Microsoft's own web example shows for 3.75 percent over 360 months on 225,000.

  • 360 months: 1,042.01 at 3.75 percent, 1,106.86 at 4.25 percent, 1,173.71 at 4.75 percent.
  • 300 months: 1,156.80, 1,218.91 and 1,282.76.
  • 240 months: 1,334.00, 1,393.28 and 1,454.00.
  • 180 months: 1,636.25, 1,692.63 and 1,750.12.

Read across a row to see what half a point of interest costs at a fixed term, and down a column to see what a shorter term costs. At 3.75 percent, cutting the term from 360 months to 180 raises the payment by 594.24 a month. That comparison is the reason to build the table: the trade is visible in one screen instead of twelve separate formulas.

Monthly payments by rate and term - explanatory illustration for Two-Variable Data Table in Excel
Monthly payments by rate and term (explanatory illustration, not a software screenshot).

Reading the results

Every cell in the block is a copy of the same formula, evaluated with one value from the row and one from the column. The block is a snapshot, so label the axes. Put the unit in the header row, such as 3.75% rather than 3.75, and put "months" beside the term list, or the table will be misread by the next person who opens it.

Formatting matters more than usual here. Select the result cells and apply currency or accounting format with two decimals, which is what Microsoft's note on the same page recommends. A payment of 1042.0100810 is hard to compare with 1106.8647549 at a glance.

The formula cell and the input cells

Only the formula cell holds a real formula. If you change the formula in C2, the whole grid recalculates with the new formula. If you change the loan amount in B5, which is not one of the two variable cells, the whole grid updates too, because every result is the formula run again.

The result cells are one array, so Excel will not let you type over a single cell in the block. To change the output, change an input or the formula. This is also why a data table is not an Excel Table with structured references: it is an array of calculated values that happens to look like a table, and sorting or filtering it will not behave the way a real table does.

Calculation cost

Microsoft states the catch plainly: whenever a worksheet recalculates, data tables recalculate too, even if nothing changed. A workbook with several tables therefore gets slower with every edit anywhere in it.

The remedy on the same page is to change the calculation options. Select File, then Options, then Formulas, and in the Calculation options section choose Automatic; after that, no data-table calculation happens when the whole workbook recalculates. To refresh a table on demand, select its formulas and press F9. If the numbers in your table look frozen, that setting is the reason, and F9 is the fix.

Data table recalculation behaviour - explanatory illustration for Two-Variable Data Table in Excel
Data table recalculation behaviour (explanatory illustration, not a software screenshot).

When Goal Seek is the better tool

A data table answers "what if these values change". Goal Seek answers the reverse question: you know the payment you can afford and you want the loan amount or the term that produces it. Microsoft draws the same line, describing Goal Seek as starting from a single result and calculating possible input values.

Use the table when you want to see the shape of the trade across a range, and Goal Seek when you have one target and one unknown. For a single payment figure you can also skip both and call PMT directly with the numbers you care about.

Questions and answers

How many variables can a data table handle?

Two. One for the row input cell and one for the column input cell. For three or more, Microsoft points to scenarios.

Why are my results all the same number?

The row and column input cells are probably pointing at the same cell, or at a cell the formula does not use. Check that the formula refers to both input cells.

Why can I not edit one cell in the table?

The results are a single array. Change an input value or the formula, and the block recalculates as a whole.

Why does my workbook recalculate slowly now?

Data tables recalculate on every recalculation. Change the calculation options so tables are excluded, then press F9 when you want them refreshed.

Can I use a data table for anything other than loans?

Yes. Any formula with two input cells works, such as a break-even calculation with price and volume, or a bonus model with rate and threshold.

Official references

العربية