Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Excel Single Variable Data Table: Step-by-Step Guide

· 5 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

A single variable data table in Excel lets you see how changing one input affects one or more formula results, all in a compact grid. You set up the input values you want to test, point Excel at the formula, and it fills in the outcomes. You need a working formula that depends on at least one input cell, and you need to know which cell that input lives in. The steps below are for Excel on Windows and Mac; the ribbon labels are nearly identical, though a few dialogs differ slightly by version and region.

What You'll Need

  • Excel 2016 or later (desktop version; the web version does not support data tables).
  • A formula in a cell that references at least one input cell you can change.
  • The input values you want to test, typed into a single column or row.

Step-by-Step

  1. Build your model. In a blank area, put your input value in one cell (say B2) and write a formula in another cell (say B3) that uses B2. For example, B2 = 100 and B3 = B2*1.1. This is your base case.
  2. List the test values. In a column below or beside your model, type the different input values you want to try, one per cell, going down. Leave the cell above the list empty if you plan to put the formula there.
  3. Set up the table. In the cell one row above and one column to the right of your list (or one column to the right and one row above, depending on orientation), type a reference to the formula cell. For a column-oriented table, put =B3 in the cell directly above the list of values and one column to the right. For a row-oriented table, put =B3 in the cell directly to the left of the list and one row above.
  4. Select the whole table range. Highlight from the formula-reference cell through the last test value, including the row or column that holds the reference. For a column table with values in C3:C7 and the reference in D2, select D2:D7.
  5. Open the Data Table dialog. Go to the Data tab, click What-If Analysis, then Data Table. (On Mac, the menu path is Data > What-If Analysis > Data Table.)
  6. Set the input cell. In the dialog, click the Column input cell box if your test values run down a column, or the Row input cell box if they run across a row. Then click the cell that holds your original input value (B2 in the example). Leave the other box empty.
  7. Click OK. Excel fills the table with the formula result for each test value. The results are live: if you change a test value or the formula, the table recalculates.

Common Mistakes

  • Wrong reference cell. The cell above (or beside) the list must contain a formula reference to the result cell, not a typed number. If you type a number, the table will not calculate.
  • Selecting the wrong range. The selection must include the reference cell and every test value, with no blank rows or columns in between.
  • Putting the input cell in the wrong box. Column-oriented tables use the Column input cell box; row-oriented tables use the Row input cell box. Mixing them up produces wrong or blank results.
  • Using the web version. Excel for the web does not support data tables. Open the file in the desktop app.
  • Forgetting that the table is an array. You cannot edit individual result cells; change the test values or the formula instead.

Tips

  • Keep the input cell and the formula cell close together so the table is easy to audit.
  • Use a named range for the input cell to make the dialog easier to fill in.
  • Format the result column to match the formula's output (currency, percentage, etc.) so the numbers read clearly.
  • To test several formulas at once, put each formula in its own column to the right of the test values and include all of them in the selection.
  • If you need to test two inputs together, use a two-variable data table instead.

Troubleshooting

If the table shows the same result for every row, the input cell is probably wrong or the formula does not actually reference that cell. Check that the formula in the result cell uses the input cell directly or through a chain of references.

If you see #VALUE! or blank cells, confirm the selection includes the reference cell and that the reference cell contains a formula pointing to the result cell. Also check that no test value is text where a number is expected.

If the Data Table option is greyed out, you may be in the web version, or the workbook may be in a mode that blocks what-if tools. Save the file locally and open it in desktop Excel. If the workbook is shared or protected, unshare or unprotect it first.

If results look stale, press F9 to recalculate, or check that automatic calculation is on under Formulas > Calculation Options.

Frequently Asked Questions

Can I use a data table in Excel for the web?

No. Data tables are only available in the desktop versions of Excel for Windows and Mac.

Can I edit a single result in the table?

No. The table is an array of calculated values. Change the test values or the formula, and the table updates.

What is the difference between a one-variable and two-variable data table?

A one-variable table changes a single input and shows one or more results. A two-variable table changes two inputs at once and shows a single result in a grid.

Why does my table show the same number in every cell?

The input cell in the dialog is likely incorrect, or the formula does not depend on that cell. Recheck the formula and the cell reference.

Can I test more than one formula with a single-variable table?

Yes. Put each formula in its own column to the right of the test values and include all those columns in the selection before opening the Data Table dialog.

Does changing a test value update the table automatically?

Yes, as long as automatic calculation is on. If not, press F9 to recalculate.