How to create and use two-input data tables in Microsoft Excel (282856)



The information in this article applies to:

  • Microsoft Office Excel 2003
  • Microsoft Excel 2002
  • Microsoft Excel 2000
  • Microsoft Excel 2001 for Mac
  • Microsoft Excel 98 Macintosh Edition
  • Microsoft Excel 97 for Windows

This article was previously published under Q282856

SUMMARY

This article describes how to create and use two-input tables, which allow you to test how changes in two variables affect one formula.

MORE INFORMATION

When you create a two-input table, you specify input cells in the Row Input Cell and Column Input Cell boxes in the Tables dialog box. To create a simple two-input table, follow these steps:
  1. Create a new workbook.
  2. In cells B15:B19, type the following data:
         Cell       Value
         ----------------
         B15          1   
         B16          2
         B17          3
         B18          4
         B19          5
    					
  3. In cells C14:G14, type the following data:
         Cell       Value
         ----------------
         C14          6   
         D14          7
         E14          8
         F14          9
         G14         10 
    					
  4. In cell B14, type the following formula:

    =A14*2+A15

    NOTE: A14 is the column input cell (which substitutes values 1, 2, 3, 4, and 5), and A15 is the row input cell (which substitutes values 6, 7, 8, 9, and 10). These input cells must be located outside the table; they may or may not contain data. Because this table is set up in cells B14:G19, and because A14 and A15 are outside the table, they are valid column input and row input cells.
  5. Select B14:G19.
  6. On the Data menu, click Table.
  7. In the Row Input Cell box, type A15. In the Column Input Cell box, type A14.
  8. Click OK.
You see the following results:
Two-Input table (with formulas displayed)
=========================================

NOTE: Due to screen display limitations, the following six-column 
table is shown in two parts.

(Left three columns of a six-column table)

      |      B    |        C      |       D
   ---|-----------|---------------|---------------
    14| =A14*2+A15|              6|             7
    15|          1|=TABLE(A15,A14)|=TABLE(A15,A14)
    16|          2|=TABLE(A15,A14)|=TABLE(A15,A14)
    17|          3|=TABLE(A15,A14)|=TABLE(A15,A14)
    18|          4|=TABLE(A15,A14)|=TABLE(A15,A14)
    19|          5|=TABLE(A15,A14)|=TABLE(A15,A14)

(Right three columns of a six-column table.)

      |        E       |       F       |       G
   ---|----------------|---------------|---------------
    14|              8 |              9|             10
    15| =TABLE(A15,A14)|=TABLE(A15,A14)|=TABLE(A15,A14)
    16| =TABLE(A15,A14)|=TABLE(A15,A14)|=TABLE(A15,A14)
    17| =TABLE(A15,A14)|=TABLE(A15,A14)|=TABLE(A15,A14)
    18| =TABLE(A15,A14)|=TABLE(A15,A14)|=TABLE(A15,A14)
    19| =TABLE(A15,A14)|=TABLE(A15,A14)|=TABLE(A15,A14)


Two-Input table (with values displayed)
=======================================

      | B | C | D | E | F | G |
   ---|---|---|---|---|---|---|
    14|   |  6|  7|  8|  9| 10|
    15|  1|  8|  9| 10| 11| 12|
    16|  2| 10| 11| 12| 13| 14|
    17|  3| 12| 13| 14| 15| 16|
    18|  4| 14| 15| 16| 17| 18|
    19|  5| 16| 17| 18| 19| 20|
				
NOTE: Take cell C15 as an example; the actual values that are used in the formula are from cells B15:B19 (the row input cells) and cells C15:G14 (the column input cells). The formula with the values in it would be: 1*2+6 (total of 8). Excel internally substitutes the values in the row and column input cells into the formula in cell B14.

0 appears in cell B14 although the cell B14 is not a number format. To duplicate the blank value in cell B14, follow these steps:
  1. Select cell B14.
  2. On the Format menu, click Cells.
  3. Click the Number tab.
  4. In the Category list, click Custom.
  5. In the Type box, type "" (two quotation marks).
  6. Click OK.

REFERENCES

For additional information about how to use data tables, click the article number below to view the article in the Microsoft Knowledge Base:

282851 XL: How to Use Microsoft Excel Data Tables to Analyze Information in a Database

282852 XL: An Overview of Data Tables in Microsoft Excel

282855 XL: How to Create and Use One-Input Data Tables in Microsoft Excel


Modification Type:MinorLast Reviewed:10/16/2006
Keywords:kbhowto KB282856