An overview of data tables in Microsoft Excel (282852)



The information in this article applies to:

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

This article was previously published under Q282852

SUMMARY

You can use data tables (on the Data menu, click Table) to see how different input values affect the results of a formula. By doing so, you can test different input values for a formula, without having to retype or copy the formula for each value.

MORE INFORMATION

The following formula calculates tax on an item based on the item's cost (itemcost):

=itemcost*8.1%

One way to calculate tax for several items is to type the formula for each item, as shown in the following example:
   Table created manually (with formulas displayed)
   ================================================

         |     A      |   B
      ---|------------|-------
       1 |Item Cost   |Tax
       2 |          15|=A2*8.1%
       3 |        17.5|=A3*8.1%
       4 |       22.35|=A4*8.1%

   Table created manually (with values displayed)
   ==============================================

         |     A    |   B
      ---|----------|-------
       1 | Item Cost|Tax
       2 |    $15.00|  $1.22
       3 |    $17.50|  $1.42
       4 |    $22.35|  $1.81
				
In the previous examples, you must type or copy the tax formula for each item you want to evaluate. However, if you create a table with the Table command, you only have to type the formula once:
   Table created with the Table command (with formulas displayed)
   ==============================================================

         |     A     |     B
      ---|-----------|------------
       1 | Item Cost | =C1*8.1%    <--The formula is typed once; then the
       2 |         15| =TABLE(,C1) <--Table command puts the results here.
       3 |       17.5| =TABLE(,C1) 
       4 |      22.35| =TABLE(,C1) 

   C1 represents a variable. The values in cells A2:A4 are substituted for
   C1, and the corresponding result is placed in cells B2:B4.

   Table created with the Table command (with values displayed)
   ============================================================

         |     A         B
      ---|-----------|------
       1 |Item Cost  |Tax
       2 |     $15.00| $1.22
       3 |     $17.50| $1.42
       4 |     $22.35| $1.81
				
The values in cells A1 and B1 are number formats. To duplicate these values, follow these steps:
  1. Select cell A1.
  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 "Item Cost" (with the quotation marks).
  6. Click OK.
  7. Repeat steps 1-6 for cell B2, but type the format in step 5 as "Tax" (with the quotation marks).

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

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

282856 XL: How to Create and Use Two-Input Data Tables in Microsoft Excel


Modification Type:MajorLast Reviewed:5/18/2005
Keywords:kbhowto KB282852