Home > Formulas > Sum > Data Table Excel Data Table ExamplesInstead of entering formulas and variables individually, to compare results, you can set up an Excel Data Table, with one or two variables. Data Tables are one of Microsoft Excel's What If Analysis tools, along with Scenario Manager and Goal Seek. |
In some workbooks, you might want to test different scenarios, and compare the results. For example, if you're buying a car, which loan repayment term would fit your monthly budget?
In this tutorial, you'll see how to:
-- Set up loan payment calculation
-- Compare multiple options in formula
-- Compare loan payments 1 variable
-- Compare loan payments with 2 variables
With the PMT function, you can calculate the monthly payment for a loan, based on 3 variables:
These side-by-side PMT formulas show what your monthly payments will be, based on changing one variable in the formula -- the number of payments.
The formula in cell C6 divides the annual rate by 12, to calculate the monthly interest rate:
For a 48-month term, the monthly payment is $230.29, and for a 36-month term, it's $299.71 per month.
What if you want to test multiple options for one of your formula variables, like the number of payments variable, shown above?
A data table makes it easy to test one or two variables from a formula, and see the differences, side-by-side.
For example, in the screen shot below, the data table show results for 2 variables - interest rate and number of payments.
In the sections below, you'll see how to set up Excel data tables, make them calculate efficiently, and clear them, if necded.
-- Set up a 1 variable Data Table
-- Set up a 2 variable Data Table
-- Speed up workbook calculations
In this example, you will build a one-variable data table that shows the monthly payments for loan terms ranging from 1 to 6 years. The number of payments will range from 12 to 72.
NOTE: The Input cells have to be on the same sheet as the data table.
The loan information is in cells C2:C4, with the number of payments in cell C3.
To set up the data table:
The Data Table dialog box opens, where you can enter the input cell details
In this example, you will build a two-variable data table. With the 2 variables, it will show the monthly payments for loan terms ranging from 1 to 6 years, and interest rates from 2% to 6%.
NOTE: The Input cells have to be on the same sheet as the data table.
The loan information is in cells C2:C4, with the interest rate in C2, and the number of payments in cell C3.
To set up the data table:
To prevent the data table from slowing down your Excel workbook calculations, you can change the calculation option for your workbook.
Most Excel workbooks are set for Automatic calculation. With that setting, Excel automatically recalculates all of the open workbooks:
To prevent Excel from automatically doing all the Data Table calculations each time, follow these steps:
After you change this setting, the Data Table calculations will not occur when a recalculation is done on the entire workbook.
If you change the calculation mode to Automatic Except for Data Tables, the Data Tables will not update automatically.
To manually recalculate your data table, follow these steps:
You can also use macros to get faster calculation with Data Tables. See this post by Excel calculation expert, Charles Williams: Excel What-If Data Tables: Faster calculation with VBA
Because the data table values are in an array, you cannot edit or clear individual cells. If you try to change one cell, you will see an error message - "Cannot change part of a data table." If you want to remove the entire table, or the resulting values, follow the steps below.
To remove the data table from the worksheet:
To clear out the resulting values only:
In this video, Mynda Treacy shows how to set up Data Tables in Excel, using multiple variables.
See how much a savings account will grow, with different amounts deposited monthly.
Click here to download the Data Tables sample file. The zipped Excel workbook file is zipped, and in xlsx format. There are no macros in the workbook
Last updated: January 26, 2023 1:56 PM