📊 Learn Excel inside Excel. Try Ninja Excel free for 15 days, no credit card required. Start free trial

Data Table in Excel: Play With Different Scenarios

Scrabble tiles spelling DATA on a wooden tile background

Quick answer

A Data Table in Excel is a What-If Analysis tool that shows how a result changes when you swap in different input values, without rewriting the formula each time. You can test one variable (listed in a row or a column) or two variables at once (one in a row, one in a column), and Excel fills in every combination automatically. You’ll find it under Data > What-If Analysis > Data Table, and because the results come from an array formula, you can’t delete a single result cell on its own, only the whole range.

Summarize this content with your favorite AI

Opens a new conversation with this article ready to analyze.

What is a Data Table in Excel? A Data Table is a set of cells that, combined, show you how a result changes under different scenarios.

You use it to see the change in a result the moment you change one or more input variables, without having to rebuild the formula or recalculate it by hand for every new value.

You can build a Data Table with one variable or with two variables, depending on how many inputs you want to change at once.

What you’ll learn in this article

  • What a Data Table is and when to use it
    the idea behind Excel’s What-If Analysis tools and why it beats recalculating a formula by hand.
  • How to build a one-variable Data Table
    a worked example with a budget and a quantity that changes, with the surplus recalculated for each option.
  • How to build a two-variable Data Table
    testing two inputs at the same time, like quantity and a change in price.
  • Where to find Data Table in the ribbon
    the exact path through What-If Analysis, so you don’t go looking in the wrong menu.
  • Why you can’t delete a single result
    what the array formula behind a Data Table means once you try to edit it.

Once you finish this article: you’ll be able to set up a one-variable or two-variable Data Table on your own and read its results with confidence.

Reading time: 9 minutes | Level: intermediate | For: analysts, budget owners and anyone who tests scenarios in Excel

How do you build a one-variable Data Table?

A one-variable Data Table changes a single input to see how the final result changes.

Let’s say you have a budget of $5.26 to buy bread. A kilogram of bread costs $1.58. At first, you buy just one kilogram.

The image below shows the starting data.

Excel sheet showing a budget of $5.26, a bread price of $1.58 per kilogram, and a quantity of 1

You want to know how much of the budget is left over after buying one kilogram of bread. The calculation below leaves a surplus of $3.68.

Excel formula calculating the surplus as budget minus price times quantity, resulting in $3.68

Now you want to run this same calculation again, but changing the quantity. You want to see the surplus if you buy 2 or more kilograms of bread, without repeating the calculation by hand.

How do you do it?

You build another small table. In the first cell, you write the result you want to track: here, that’s the surplus. So you select cell C5, which already holds the surplus you calculated above.

Then, in the first column of that table, you list the changes you want to test for the variable. In this case, the variable is quantity, so you list the kilograms of bread you could buy: 1, 2, 3, 4 and 5.

Excel sheet showing the surplus formula reference and a column listing quantities from 1 to 5

To build the Data Table, select this whole range.

Excel sheet with the surplus cell and the quantity column selected

Go to the Data tab, click What-If Analysis (in the Forecast group), and choose Data Table, as shown below.

Excel ribbon with the What-If Analysis menu open and Data Table highlighted

A dialog box appears for you to fill in.

How do you fill in a one-variable Data Table?

In the input cell fields, you select the cell that will be replaced by each new value in the table. If the new values are listed in a row, you pick the cell to replace in Row input cell. If the new values are listed in a column, as in our case, you pick the cell to replace in Column input cell.

In our example, the new quantities are listed in a column, so we enter the cell that holds the quantity (C4) in Column input cell, as shown below.

Data Table dialog box with the column input cell set to C4

This way, the values 1, 2, 3, 4 and 5 each replace the value 1 in Quantity, one at a time, changing the surplus formula’s result each time. Click OK.

The full table appears, with every result for every scenario, just like that.

And without having to calculate each one by hand!

Finished one-variable Data Table showing the surplus for buying from 1 to 5 kilograms of bread

Ninja Summary

  • A one-variable Data Table swaps a single input (here, quantity) and recalculates the result for every value you list.
  • The result cell goes in the corner of the range; the list of test values goes in a row or a column next to it.
  • You can’t afford 4 or 5 kilograms of bread in this example: the surplus turns negative.

You can see the different surpluses depending on how many kilograms of bread you buy. In this case, for example, you wouldn’t be able to buy 4 or 5 kilograms, because the budget doesn’t stretch that far.

How do you build a two-variable Data Table?

A two-variable Data Table changes two inputs at once to see how the final result changes.

Let’s say the price of a kilogram of bread will change next month, dropping by 20%.

First, calculate the new price, as shown below. It comes out to $1.26.

Excel formula calculating the new price as the old price times one plus the price variation, resulting in $1.26

You also need to calculate the new surplus with the new price, as shown below. It comes out to $4.00.

Excel formula calculating the new surplus using the new price, resulting in $4.00

Now imagine that over the next 5 months, the price of a kilogram of bread will change by different amounts.

Next month it will drop 20%, the following month 10%, then it will stay flat (0%), then rise 10%, and finally rise 20%.

Now you want your Data Table to show how the surplus changes when you change 2 inputs at once: quantity and the change in the price of bread.

You build a table with two input directions.

First, you insert the surplus value you’ve already calculated into the corner cell, as shown below.

Excel sheet with the surplus formula referenced in the corner cell of a new table, before the row and column are filled in

In the first column of your Data Table, you fill in, going down, the changes for variable 1: Quantity.

In the first row of your Data Table, you fill in the changes for variable 2: Price variation.

As shown below.

Excel Data Table with quantities 1 to 5 down the first column and price variations from -20% to 20% across the first row

To complete your Data Table, select this whole range.

Excel sheet with the two-variable Data Table range selected

Go to Data, What-If Analysis, Data Table, same as before.

Excel ribbon with the What-If Analysis menu open and Data Table highlighted

The dialog box for filling in the table appears.

How do you fill in a two-variable Data Table?

In the input cell fields, you select the cells that will be replaced by the new values in the Data Table, depending on where they sit (rows or columns).

In our example, we want the Price variation cell (-20%) to be replaced, in turn, by each value in the top row (-20%, -10%, 0%, 10% and 20%), to show how the surplus changes.

Since we put those values in a row, we enter the cell with the price variation, C5, in Row input cell.

As in the previous example, the new quantity values sit in a single column in the table.

So we enter the cell with the quantity, C4, in Column input cell.

Data Table dialog box with the row input cell set to C5 and the column input cell set to C4

Click OK, and your Data Table fills in with every variation and every result!

Finished two-variable Data Table with surplus results for each combination of quantity and price variation

Ninja Tip

Because a Data Table is built as a single array formula, Excel won’t let you delete just one result inside it. If you try, you’ll get an error. To remove the results, you need to select the full range of the table and delete it all at once.

You can see, for example, that next month you’d be able to buy 3 kilograms of bread with no problem, with a surplus of $1.47 left over to spend on something else.

But five months from now, you wouldn’t be able to buy 3 kilograms of bread, because the price will have risen and the budget won’t stretch that far: the surplus turns negative, at -$0.42. In that case, you’d need to buy fewer than 3 kilograms.

This way, a simple Data Table, built quickly, lets you see different scenarios as your variables change. You can compare them, analyze them, and draw conclusions from the results.

Benefits of using a Data Table in Excel

A Data Table turns a single formula into a whole set of scenarios, without extra formulas, extra copies of your sheet, or manual recalculation. Once it’s set up, testing a new value takes seconds, not a fresh round of typing.

Take the next step with Ninja Excel

Still building separate formulas for every scenario?

What-If Analysis tools like Data Table save hours once you’ve practiced them inside a real spreadsheet. Ninja Excel’s online courses walk you through exercises like this one with live classes, so your team builds the habit together.

See Excel Courses Online

You start with a skills assessment, so you never repeat what you already know.

FAQ

How do you create a Data Table in Excel?

Select the range that includes your result cell and the list of values you want to test, go to the Data tab, click What-If Analysis, and choose Data Table. Enter the row input cell, the column input cell, or both, and click OK.

What are the main features of a Data Table in Excel?

It recalculates a single formula for every input value you list, works with one or two variables at a time, and updates automatically when the source data changes. Because the results are stored as one array formula, you can only edit or delete them as a whole range.

What is a data table?

In general, a data table is an arrangement of data in rows and columns, used to manage, analyze and research information. In Excel, Data Table is also the name of the What-If Analysis tool covered in this article.

Table of contents