Creating One-Variable and Two-Variable Data Tables in Microsoft Excel
Course: Advanced Excel
Topic: Creating One-Variable and Two-Variable Data Tables
Course Link: Advanced Excel Course – JustAcademy
Demo Link: Register for a Course Demo
Website: JustAcademy Official Website
1. Introduction to Data Tables in Excel
Microsoft Excel provides What-If Analysis tools that help users understand how changing input values affects calculated results. One of these tools is the Data Table feature, which automatically calculates multiple possible outcomes by substituting different values into a formula.
Data Tables are especially useful when working with financial models, sales forecasts, loan calculations, budgets, profit analysis, investment planning, and business reports. Instead of changing an input value repeatedly and recording each result manually, you can create a table that displays several scenarios at once.
Excel supports two main types of Data Tables:
- One-Variable Data Table: Examines how changing one input value affects a formula result.
- Two-Variable Data Table: Examines how changing two input values affects a formula result.
2. Learning Objectives
After studying this topic, you will be able to:
- Understand What-If Analysis and the purpose of Data Tables.
- Differentiate between one-variable and two-variable Data Tables.
- Create a one-variable Data Table using row or column input values.
- Create a two-variable Data Table using row and column input values.
- Apply Data Tables to loan payments, profit calculations, pricing, and sales forecasting.
- Interpret scenario results and use them for decision-making.
- Troubleshoot common Data Table errors and calculation issues.
3. What Is What-If Analysis?
What-If Analysis is a group of Excel tools that helps users evaluate how different assumptions affect calculated results. It is useful when the final answer depends on variables that may change.
For example, a business may want to know how its profit changes when the selling price, number of units sold, or production cost changes. Instead of manually editing the formula inputs for every possible scenario, What-If Analysis can compare multiple possibilities efficiently.
Common What-If Analysis tools include:
| Tool |
Purpose |
Example |
| Data Table |
Calculates outcomes for one or two changing inputs. |
Comparing profit at different prices. |
| Scenario Manager |
Stores and compares groups of input assumptions. |
Best-case, expected-case, and worst-case budgets. |
| Goal Seek |
Finds the input value needed to achieve a target result. |
Finding the sales quantity required for a target profit. |
| Solver |
Finds an optimized solution subject to constraints. |
Maximizing profit within a production limit. |
4. Understanding One-Variable Data Tables
4.1 Definition
A One-Variable Data Table calculates the result of a formula for multiple values of a single input cell. Excel temporarily substitutes each value into the selected input cell and records the formula result.
For example, if a company wants to calculate profit at selling prices of ₹100, ₹110, ₹120, ₹130, and ₹140, it can use a one-variable Data Table to calculate all five outcomes.
4.2 When to Use a One-Variable Data Table
- Testing different selling prices.
- Estimating loan payments at different interest rates.
- Calculating profit at different sales quantities.
- Comparing different discount percentages.
- Forecasting expenses under different cost assumptions.
- Evaluating investment returns for different growth rates.
5. Example: Creating a One-Variable Data Table for Profit
Suppose a company sells a product. Its profit depends on the selling price, number of units sold, and variable cost per unit.
5.1 Set Up the Original Calculation
| Cell |
Description |
Value or Formula |
| B2 |
Selling Price per Unit |
₹150 |
| B3 |
Units Sold |
500 |
| B4 |
Variable Cost per Unit |
₹90 |
| B5 |
Fixed Costs |
₹10,000 |
| B6 |
Total Revenue |
=B2*B3 |
| B7 |
Total Variable Cost |
=B3*B4 |
| B8 |
Total Profit |
=B6-B7-B5 |
With the initial values, the profit is ₹20,000. The objective is to determine how profit changes when the selling price changes while the other assumptions remain constant.
5.2 Prepare the Data Table Layout
Arrange the possible selling prices vertically. Place a reference to the profit formula in the cell above and to the right of the first input value.
| D |
E |
| Profit Formula |
=B8 |
| ₹100 |
|
| ₹110 |
|
| ₹120 |
|
| ₹130 |
|
| ₹140 |
|
For this example, assume the formula reference is entered in E2 and the selling price scenarios are entered in D3:D7. The Data Table output will appear in E3:E7.
5.3 Create the One-Variable Data Table
- Enter the possible selling prices in cells D3:D7.
- Enter
=B8 in cell E2 to reference the original profit calculation.
- Select the entire range D2:E7, including the formula reference and all input values.
- Open the Data tab on the Excel Ribbon.
- Select What-If Analysis in the Forecast group, or in the appropriate group for your Excel version.
- Choose Data Table.
- Because the changing prices are listed vertically, enter
$B$2 in the Column input cell field.
- Leave the Row input cell field blank.
- Click OK.
Excel substitutes each value from D3:D7 into cell B2, recalculates the profit formula, and displays the results in E3:E7.
5.4 Expected Results
| Selling Price |
Units Sold |
Variable Cost per Unit |
Fixed Costs |
Calculated Profit |
| ₹100 |
500 |
₹90 |
₹10,000 |
₹0 |
| ₹110 |
500 |
₹90 |
₹10,000 |
₹5,000 |
| ₹120 |
500 |
₹90 |
₹10,000 |
₹10,000 |
| ₹130 |
500 |
₹90 |
₹10,000 |
₹15,000 |
| ₹140 |
500 |
₹90 |
₹10,000 |
₹20,000 |
Interpretation: When the number of units sold, variable cost per unit, and fixed costs remain constant, increasing the selling price increases profit. The Data Table makes the relationship easy to compare without manually changing the original selling price.
6. Row Input Cell vs. Column Input Cell
The correct input cell depends on where the scenario values are arranged in the Data Table.
| Arrangement |
Input Cell to Use |
Example |
| Scenario values listed vertically in a column |
Column input cell |
Different interest rates listed down a column. |
| Scenario values listed horizontally in a row |
Row input cell |
Different prices listed across a row. |
The terms Row input cell and Column input cell refer to the direction of the scenario values in the Data Table, not necessarily the orientation of the original input cell in the worksheet.
6.1 One-Variable Data Table Using a Row
If the possible selling prices are arranged horizontally, place the formula reference in the cell immediately above and to the left of the first scenario value. Select the entire table, open Data > What-If Analysis > Data Table, and enter the original selling price input cell in the Row input cell field.
For example, if the selling prices are arranged across E2:I2 and the formula reference is in D2, use the original selling price cell B2 as the Row input cell. Leave the Column input cell blank.
7. Understanding Two-Variable Data Tables
7.1 Definition
A Two-Variable Data Table calculates the results of a formula by changing two input cells. One set of possible values is arranged horizontally across the top row, while the other set is arranged vertically down the first column.
For example, a company may want to compare profit at different selling prices and different sales quantities. A two-variable Data Table shows the profit for every combination of those two inputs.
7.2 When to Use a Two-Variable Data Table
- Comparing selling price and sales volume.
- Evaluating loan payments at different interest rates and loan terms.
- Testing profit at different product prices and production costs.
- Forecasting revenue under different traffic and conversion-rate assumptions.
- Comparing investment outcomes under different rates of return and investment periods.
- Evaluating budgets with two changing cost assumptions.
8. Example: Creating a Two-Variable Data Table for Profit
Use the same profit model, but this time vary both the selling price and the number of units sold. Keep the variable cost per unit at ₹90 and fixed costs at ₹10,000.
8.1 Prepare the Input Values
Enter the selling prices across the top row and the number of units sold down the first column. In the upper-left corner of the table, enter a reference to the original profit formula.
| Units / Price |
₹100 |
₹110 |
₹120 |
₹130 |
| 400 |
|
|
|
|
| 500 |
|
|
|
|
| 600 |
|
|
|
|
| 700 |
|
|
|
|
For this layout, assume the formula reference is in D2, selling prices are in E2:H2, and units sold are in D3:D6. The results will fill E3:H6.
8.2 Create the Two-Variable Data Table
- Ensure the original profit formula is calculated in cell B8.
- Enter
=B8 in D2.
- Enter the possible selling prices in E2:H2.
- Enter the possible sales quantities in D3:D6.
- Select the complete range D2:H6.
- Go to the Data tab.
- Choose What-If Analysis and then Data Table.
- Enter
$B$2 in the Row input cell field because the selling prices are arranged horizontally.
- Enter
$B$3 in the Column input cell field because the sales quantities are arranged vertically.
- Click OK to calculate the results for all combinations.
8.3 Expected Results
| Units Sold / Price |
₹100 |
₹110 |
₹120 |
₹130 |
| 400 |
-₹6,000 |
-₹2,000 |
₹2,000 |
₹6,000 |
| 500 |
₹0 |
₹5,000 |
₹10,000 |
₹15,000 |
| 600 |
₹6,000 |
₹12,000 |
₹18,000 |
₹24,000 |
| 700 |
₹12,000 |
₹19,000 |
₹26,000 |
₹33,000 |
Interpretation: The table shows how profit changes when both selling price and sales quantity change. For example, selling 600 units at ₹120 produces a profit of ₹18,000 under the assumptions in this model. Selling 700 units at ₹130 produces a profit of ₹33,000.
9. Difference Between One-Variable and Two-Variable Data Tables
| Feature |
One-Variable Data Table |
Two-Variable Data Table |
| Number of changing inputs |
One |
Two |
| Scenario layout |
One row or one column of input values |
One row and one column of input values |
| Input cells required |
One |
Two |
| Output |
One result per input value |
One result per combination of two input values |
| Complexity |
Relatively simple |
More detailed comparison |
| Example |
Profit at different selling prices |
Profit at different prices and sales quantities |
10. Formatting Data Tables for Professional Reporting
After creating the Data Table, format the results to make the information easier to understand.
- Apply currency formatting to financial results.
- Use bold text for row and column headings.
- Apply borders to distinguish the scenario values from the results.
- Use conditional formatting to highlight the highest profit, lowest cost, or negative results.
- Use clear titles such as “Profit by Selling Price” or “Profit by Price and Sales Volume.”
- Include a note explaining which assumptions remain constant.
- Ensure negative values are easy to recognize.
10.1 Applying Conditional Formatting
- Select the result cells in the Data Table.
- Open the Home tab.
- Select Conditional Formatting.
- Choose a suitable rule, such as Highlight Cells Rules or Color Scales.
- Choose the formatting that best communicates the results.
- Review the table to ensure the formatting does not hide important values.
11. Practical Business Applications
11.1 Loan and EMI Analysis
A financial analyst can compare monthly loan payments at different interest rates or loan periods. For a two-variable Data Table, the interest rate can be placed across the top and the loan term down the first column, with a payment formula in the upper-left corner.
For example, the Excel PMT function can calculate a periodic payment:
=PMT(Annual_Interest_Rate/12,Loan_Years*12,Loan_Amount)
Use consistent units and ensure the interest rate is entered as a percentage. The PMT result normally appears as a negative cash flow when the loan amount is positive; use =-PMT(...) if you want to display the payment as a positive number.
11.2 Sales Forecasting
Sales teams can compare revenue for different prices and expected sales quantities. This helps identify which combinations may meet a revenue target.
Revenue formula:
=Selling_Price*Units_Sold
11.3 Budget Planning
Finance teams can test the impact of changes in salaries, operating costs, marketing expenditure, or expected revenue. Data Tables help show how sensitive a budget is to changes in key assumptions.
11.4 Investment Planning
Investors can evaluate possible future values under different return rates and time periods. The results are scenario estimates, not guarantees of actual investment performance.
12. Common Errors and Troubleshooting
| Problem |
Possible Cause |
Solution |
| All results are identical |
Wrong input cell selected or formula does not depend on the input. |
Verify the input cell and confirm that the result formula uses it. |
| Results are incorrect |
Incorrect row or column input cell assignment. |
Match the input-cell field to the orientation of the scenario values. |
| Table does not calculate |
Incorrect range selected or formula reference missing. |
Select the complete table and check the formula in the upper-left corner. |
| Unexpected zero values |
Formula references blank or incorrect cells. |
Check the original model and all formula references. |
| Data Table is slow |
Large table or complex workbook formulas. |
Reduce unnecessary scenarios and review workbook calculation settings. |
| Formula appears instead of result |
Cell formatted as Text or Show Formulas enabled. |
Change the format to General, re-enter the formula if needed, and check Show Formulas. |
| Results do not update as expected |
Calculation mode or workbook dependencies may affect recalculation. |
Check Formulas > Calculation Options and use Automatic calculation when appropriate. |
13. Important Notes and Limitations
- A Data Table requires a formula that depends on the input cell or cells being tested.
- A one-variable Data Table uses either a row input cell or a column input cell, not both.
- A two-variable Data Table uses both a row input cell and a column input cell.
- The row input cell corresponds to values arranged horizontally; the column input cell corresponds to values arranged vertically.
- Data Tables are different from ordinary Excel tables created with Insert > Table.
- Data Tables are also different from PivotTables, which summarize and analyze existing datasets.
- Large scenario tables can increase recalculation time, especially in workbooks containing complex formulas.
- Data Table outputs are calculated scenario results based on the current formula and assumptions. They do not automatically predict what will happen in the real world.
- In many Excel versions, Data Table results are generated through Excel's What-If Analysis feature and may behave differently from ordinary formulas when edited or recalculated.
14. Best Practices
- Build and verify the original calculation before creating the Data Table.
- Use descriptive labels for all input values and outputs.
- Keep the model's input cells separate from the scenario table for easier maintenance.
- Use absolute cell references where appropriate in the original formula.
- Start with a small set of test values to confirm that the table works correctly.
- Check at least one scenario manually to verify the Data Table's result.
- Format financial outputs consistently, especially currency, percentages, and decimal places.
- Document assumptions such as fixed costs, tax rates, unit costs, and forecast periods.
- Use conditional formatting carefully to highlight meaningful results rather than decorate every cell.
- Save a backup before changing a complex financial model.
15. Practice Exercises
Exercise 1: One-Variable Data Table
Create a profit model with a selling price of ₹250, 300 units sold, a variable cost of ₹150 per unit, and fixed costs of ₹12,000. Create a one-variable Data Table using selling prices of ₹200, ₹220, ₹240, ₹260, and ₹280.
Tasks:
- Calculate the original profit.
- Set up the scenario values in a column.
- Use the correct Column input cell.
- Identify the selling price that produces a profit of at least ₹15,000.
Exercise 2: Two-Variable Data Table
Use the same profit model and compare selling prices of ₹200, ₹220, ₹240, and ₹260 with sales quantities of 250, 300, 350, and 400 units.
Tasks:
- Place selling prices horizontally and sales quantities vertically.
- Enter the profit formula reference in the upper-left corner.
- Use the selling price as the Row input cell and units sold as the Column input cell.
- Identify the scenario with the highest profit.
- Apply conditional formatting to highlight negative profits and the highest profit.
Exercise 3: Loan Payment Comparison
Build a loan model using a principal of ₹500,000. Compare annual interest rates of 7%, 8%, 9%, and 10%, and loan periods of 5, 10, 15, and 20 years. Use the PMT function to calculate monthly payments.
Tasks:
- Convert annual interest rates to monthly rates.
- Convert loan periods into months.
- Create a two-variable Data Table.
- Determine which combination produces the lowest monthly payment.
- Explain why a lower monthly payment may still result in more total interest over the full loan period.
16. Mini Project: Profit Sensitivity Analysis Dashboard
Project Objective: Create a worksheet that helps a business understand how selling price and sales volume affect profit.
Project Requirements
- Create input cells for selling price, sales quantity, variable cost per unit, and fixed costs.
- Build formulas for revenue, total variable cost, total cost, and profit.
- Create a one-variable Data Table for different selling prices.
- Create a two-variable Data Table for selling prices and sales quantities.
- Apply currency formatting and conditional formatting.
- Identify the combinations that produce a loss, break-even result, or profit.
- Add a short written recommendation explaining which assumptions have the greatest impact on profitability.
Expected Deliverables
- A clearly labeled Excel worksheet.
- A working profit calculation model.
- One-variable and two-variable Data Tables.
- Formatted scenario results.
- A brief business interpretation supported by the calculated results.
17. Interview Questions and Answers
Q1. What is a Data Table in Excel?
Answer: A Data Table is a What-If Analysis tool that calculates formula results for multiple values of one or two input cells.
Q2. What is a One-Variable Data Table?
Answer: It evaluates a formula by changing one input cell across a list or row of possible values.
Q3. What is a Two-Variable Data Table?
Answer: It evaluates a formula for combinations of values from two input cells, with one set arranged horizontally and the other vertically.
Q4. What is the difference between Row input cell and Column input cell?
Answer: The Row input cell is used when scenario values are arranged horizontally. The Column input cell is used when scenario values are arranged vertically.
Q5. Can a One-Variable Data Table use both input-cell fields?
Answer: No. A one-variable Data Table uses either the Row input cell or the Column input cell.
Q6. Why is a formula reference needed in the corner of the Data Table?
Answer: It tells Excel which formula result must be recalculated for each input value or combination of input values.
Q7. What is the difference between a Data Table and Scenario Manager?
Answer: A Data Table compares results across a structured set of one or two input variables. Scenario Manager stores and compares groups of assumptions, which may involve several changing cells.
Q8. Why might a Data Table show identical results?
Answer: The input cell may be incorrect, or the formula may not depend on the cell being changed. Verify the model and input-cell selection.
Q9. Can Data Tables be used for financial analysis?
Answer: Yes. They are useful for comparing loan payments, pricing strategies, budgets, profit margins, and investment scenarios.
Q10. Do Data Tables guarantee future outcomes?
Answer: No. They calculate outcomes from the formulas and assumptions provided. Actual results may differ if the assumptions change or real-world conditions are different.
18. Quick Revision Checklist
- Understand the purpose of What-If Analysis.
- Know when to use a one-variable or two-variable Data Table.
- Place the formula reference correctly in the Data Table layout.
- Arrange scenario values horizontally or vertically as required.
- Set the correct Row input cell and Column input cell.
- Verify the results by manually calculating a sample scenario.
- Format the results for easy comparison.
- Document assumptions and interpret the outcomes carefully.
19. Conclusion
One-Variable and Two-Variable Data Tables are valuable Advanced Excel tools for scenario analysis and decision-making. A one-variable Data Table shows how changing a single input affects a formula, while a two-variable Data Table compares the combined effect of two changing inputs.
By applying these tools to profit models, loan payments, budgets, and sales forecasts, Excel users can compare alternatives efficiently, identify important assumptions, and make more informed business decisions. Always verify the original formula, select the correct input cells, and interpret the results within the limits of the model.
20. Learn More with JustAcademy
Explore the Advanced Excel course to strengthen your skills in formulas, What-If Analysis, reporting, dashboards, and business data analysis.
Course: Explore the Advanced Excel Course
Demo Registration: Register for a Course Demo
Official Website: Visit JustAcademy