home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1993 #2 / Image.iso / spread / xe0210.zip / XE0210.TXT
Text File  |  1993-05-18  |  31KB  |  866 lines

  1. ======================================================================
  2.   Microsoft(R) Product Support Services Application Note (Text File)
  3.                    XE0210: CREATING AND USING TABLES
  4. ======================================================================
  5.                                               Revision Date: 5/93
  6.                                                           No Disk
  7.  
  8. The following information applies to Microsoft Excel, version See
  9. Below.
  10.  
  11.  --------------------------------------------------------------------
  12. | INFORMATION PROVIDED IN THIS DOCUMENT AND ANY SOFTWARE THAT MAY    |
  13. | ACCOMPANY THIS DOCUMENT (collectively referred to as an            |
  14. | Application Note) IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY      |
  15. | KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO    |
  16. | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A     |
  17. | PARTICULAR PURPOSE. The user assumes the entire risk as to the     |
  18. | accuracy and the use of this Application Note. This Application    |
  19. | Note may be copied and distributed subject to the following        |
  20. | conditions: 1) All text must be copied without modification and    |
  21. | all pages must be included; 2) If software is included, all files  |
  22. | on the disk(s) must be copied without modification [the MS-DOS(R)  |
  23. | utility DISKCOPY is appropriate for this purpose]; 3) All          |
  24. | components of this Application Note must be distributed together;  |
  25. | and 4) This Application Note may not be distributed for profit.    |
  26. |                                                                    |
  27. | Copyright 1989-1993 Microsoft Corporation. All Rights Reserved.    |
  28. | Microsoft and MS-DOS are registered trademarks and Windows         |
  29. | is a trademark of Microsoft Corporation.                           |
  30.  --------------------------------------------------------------------
  31.  
  32. The information in this Application Note applies to:
  33.  
  34.  - Microsoft Excel versions 2.0, 2.01, 2.1, 2.1c, 2.1d, 3.0, 4.0, and
  35.    4.0a for Windows
  36.  - Microsoft Excel versions 1.0, 1.03, 1.04, 1.06, 1.5, 2.2, 3.0, and
  37.    4.0 for the Macintosh(R)
  38.  
  39. This Application Note describes how to create one-input and two-input
  40. data tables using the Table command on the Data menu. It also
  41. discusses how you can use one-input and two-input tables to evaluate
  42. database information obtained using database functions and comparison
  43. or computed criteria.
  44.  
  45.                           OVERVIEW OF TABLES
  46.                           ==================
  47.  
  48. When you create a formula, you may want to see the results of that
  49. formula with various values. Rather than re-creating the formula each
  50. time you want to test a new value, use the Table command on the Data
  51. menu to create a table. With the Table command, you can test a formula
  52. with different values without having to retype or copy the formula for
  53. each value you want to test.
  54.  
  55. For example, the formula "=itemcost *8.1%" will calculate tax on an
  56. item based on the item's cost (itemcost). If there are several items
  57. that you want to calculate tax for, you could type the formula in for
  58. each item, as shown in the example below.
  59.  Table created manually (with formulas displayed):
  60.  
  61.    |  A          B
  62.  --|---------------------
  63.  1 | Item Cost  Tax
  64.  2 | 15         =A2*8.1%
  65.  3 | 17.5       =A3*8.1%
  66.  4 | 22.35      =A4*8.1%
  67.    
  68. Table created manually (with values displayed):
  69.  
  70.       A         B
  71.  -|-----------------
  72.  1| Item Cost Tax
  73.  2| $15.00    $1.22
  74.  3| $17.50    $1.42
  75.  4| $22.35    $1.81
  76.  
  77. To create the tables in the previous examples, you have to type or
  78. copy the formula for each value you want to evaluate. However, if you
  79. create a table with the Table command, you only have to type the
  80. formula once.
  81.    
  82. Table created with Table command (with formulas displayed):
  83.  
  84.         A          B
  85.  --|---------------------
  86.  1 | Item Cost =C1*8.1%    <- The formula is typed in once.
  87.  2 | 15        =TABLE(,C1) <- The Table command puts the results here.
  88.  3 | 17.5      =TABLE(,C1) <-
  89.  4 | 22.35     =TABLE(,C1) <-
  90.    
  91. C1 represents a variable. The values in cells A2:A4 are substituted
  92. for C1 and the corresponding result is placed in cells B2:B4.
  93.  
  94. Table created with Table command (with values displayed):
  95.  
  96.       A         B
  97.  -|-----------------
  98.  1| Item Cost Tax
  99.  2| $15.00    $1.22
  100.  3| $17.50    $1.42
  101.  4| $22.35    $1.81
  102.  
  103. The values displayed in cells A1 and B1 are number formats. To
  104. duplicate these values, do the following:
  105.  
  106. 1. Select cell A1.
  107.  
  108. 2. From the Format menu, choose Number.
  109.  
  110. 3. In the Code box (the Format box in versions 2.x), type "Item Cost"
  111.    (without the quotation marks).
  112.  
  113. 4. Choose OK.
  114.  
  115. 5. Repeat the above procedure for cell B2, entering the format Tax.
  116.  
  117.  
  118.  
  119. CREATING A ONE-INPUT TABLE
  120. ==========================
  121.  
  122. A one-input table allows you to test for changes in a formula based on
  123. one variable. One-input tables can be organized in two ways: column
  124. input or row input.
  125.  
  126.  
  127. Entering the Input Values in a Column
  128. -------------------------------------
  129.  
  130. Column input tables are organized with the values listed in a vertical
  131. array and the formulas listed horizontally.
  132.  
  133. To create a simple column input table, do the following:
  134.  
  135. 1. In cells B3:B6, type 10, 13, 14, and 19.
  136.  
  137.     NOTE: These values are the variables that will be substituted into
  138.     the formulas.
  139.  
  140. 2. In cell C2, type the formula "=B1+2" (without the quotation marks).
  141.  
  142.     NOTE: In this formula, B1 is the column input cell. This column
  143.     input cell represents the variable value in the formula; this cell
  144.     must be located outside the table (it may or may not contain
  145.     data). This table is set up in cells B2:E6, and since B1 is
  146.     outside the table, it is a valid column input cell.
  147.  
  148. 3. In cell D2, type the formula "=B1*2" (without the quotation marks).
  149.  
  150. 4. In cell E2, type the formula "=INT(B1/2)" (without the quotation
  151.    marks).
  152.  
  153. 5. Select the range of cells B2:E6.
  154.  
  155. 6. From the Data menu, choose Table.
  156.  
  157. 7. In the Column Input Cell box, type "B1" (without the quotation
  158.    marks<). Leave the Row Input Cell box blank, since this is a one-
  159.    input table.
  160.  
  161. One-input table with input values in a column (with formulas
  162. displayed):
  163.  
  164.    A  B      C            D           E
  165. -|---------------------------------------------
  166. 1|    
  167. 2|      =B1+2        =B1*2         =INT(B1/2)
  168. 3|   10 =TABLE(,B1)  =TABLE(,B1)   =TABLE(,B1)
  169. 4|   13 =TABLE(,B1)  =TABLE(,B1)   =TABLE(,B1)
  170. 5|   14 =TABLE(,B1)  =TABLE(,B1)   =TABLE(,B1)
  171. 6|   19 =TABLE(,B1)  =TABLE(,B1)   =TABLE(,B1)
  172.  
  173. One-input table with input values in a column (with values displayed):
  174.  
  175.    A     B    C   D       E
  176.  -|-----------------------------
  177.  1|   
  178.  2|         #+2   #*2   INT(#≈2)
  179.  3|      10   12     20         5
  180.  4|      13   15     26         6
  181.  5|      14   16     28         7
  182.  6|      19   21     38         9
  183.  
  184. The values displayed in cells C2, D2, and E2 are number formats. To
  185. duplicate these values, do the following:
  186.  
  187. 1. Select cell C2.
  188.  
  189. 2. From the Format menu, choose Number.
  190.  
  191. 3. In the Code box (the Format box in versions 2.x), type "#+2" (you
  192.    must include the quotation marks).
  193.  
  194. 4. Choose OK.
  195.  
  196. 5. Repeat the above procedure with cells D2 and E2, entering the
  197.    formats "#*2" and "INT(#/2)", respectively. As in step 3, you must
  198.    enclose these entries in quotation marks.
  199.  
  200.  
  201. Entering the Input Values in a Row
  202. ----------------------------------
  203.  
  204. Row input tables are organized with the variable values listed in a
  205. horizontal array and the formulas listed vertically.
  206.  
  207. To create a simple row input table, do the following:
  208.  
  209. 1. In cells C9:F9, type 19.95, 20.98, 13.50, and 10.
  210.  
  211.     NOTE: These values are the variables that will be substituted into
  212.     the formulas.
  213.  
  214. 2. In cell B10, type the formula "=A10*7.8%" (without the quotation
  215.    marks).
  216.     
  217.     NOTE: In this formula, A10 is the row input cell. The row input
  218.     cell represents the variable value in the formula and must be
  219.     located in a cell outside the table; this cell may or may not
  220.     contain data. This table is set up in cells B9:F11, and since A10
  221.     is outside the table, it is a valid row input cell.
  222.  
  223. 3. In cell B11, type the formula "=A10+A10*7.8%" (without the
  224.    quotation marks).
  225.  
  226. 4. Select cells B9:F11.
  227.  
  228. 5. From the Data menu, choose Table.
  229.  
  230. 6. In the Row Input Cell box, type "A10" (without the quotation
  231.    marks). Leave the Column Input Cell box blank, since this is a one-
  232.    input table.
  233.  
  234.  
  235. One-input table with row input cell (with formulas displayed):
  236.  
  237.    A B              C             D             E             F
  238. --|----------------------------------------------------------------------
  239.   |    
  240. 9 |                 19.95         20.98         13.5          10
  241. 10|  =A10*7.8%      =TABLE(A10,)  =TABLE(A10,)  =TABLE(A10,)  =TABLE(A10,)
  242. 11|  =A10+A10*7.8%  =TABLE(A10,)  =TABLE(A10,)  =TABLE(A10,)  =TABLE(A10,)
  243.  
  244. One-input table with row input cell (with values displayed):
  245.  
  246.     A     B      C       D        E       F
  247.  --|------------------------------------------
  248.    |   
  249.  9 |          $19.95  $20.98   $13.50   $10.00
  250.  10|    Tax   $1.56   $1.64    $1.05    $0.78
  251.  11|    Total $21.51  $22.62   $14.55   $10.78
  252.  
  253. The values displayed in cells B10 and B11 are number formats. To
  254. duplicate these values, do the following:
  255.  
  256. 1. Select cell B10.
  257.  
  258. 2. From the Format menu, choose Number.
  259.  
  260. 3. In the Code box (the Format box in versions 2.x), type "TAX"
  261.    (without the quotation marks).
  262.  
  263. 4. Choose OK.
  264.  
  265. 5. Repeat the above procedure with cell B11, entering the format
  266.    Total.
  267.  
  268.  
  269.  
  270. CREATING A TWO-INPUT TABLE
  271. ==========================
  272.  
  273. A two-input table allows you to test how changes in two variables
  274. affect one formula. When you create a two-input table, you specify
  275. input cells for the Row Input Cell box and for the Column Input Cell
  276. box in the Tables dialog box.
  277.  
  278. To create a simple two-input table, do the following:
  279.  
  280. 1. In cells B15:B19, type 1, 2, 3, 4, and 5.
  281.  
  282. 2. In cells C14:G14, type 6, 7, 8, 9, and 10.
  283.  
  284. 3. In cell B14, type the formula "=A14*2+A15" (without the quotation
  285.    marks).
  286.  
  287.     NOTE: In this formula, A14 is the column input cell (which will
  288.     substitute values 1, 2, 3, 4, and 5) and A15 is the row input cell
  289.     (which will substitute values 6, 7, 8, 9, and 10). These input
  290.     cells must be located outside the table; they may or may not
  291.     contain data. Since this table is set up in cells B14:G19, and
  292.     since A14 and A15 are outside the table, they are valid column and
  293.     row input cells.
  294.  
  295. 4. Select B14:G19.
  296.  
  297. 5. From the Data menu, choose Table.
  298.  
  299. 6. In the Row Input Cell box, type "A15" (without the quotation
  300.    marks), and in the Column Input Cell box, type "A14" (without the
  301.    quotation marks).
  302.  
  303.  
  304. Two-input table (with formulas displayed):
  305.  
  306.    NOTE:  Due to character-based screen display limitations, the
  307.    following 6-column table is  shown in two parts.
  308.  
  309. (Left 3 columns of a 6 column table)
  310.  
  311.         B                C                D
  312.  - |-----------------------------------------------
  313.  14| =A14*2+A15   6                7
  314.  15| 1            =TABLE(A15,A14)  =TABLE(A15,A14)
  315.  16| 2            =TABLE(A15,A14)  =TABLE(A15,A14)
  316.  17| 3            =TABLE(A15,A14)  =TABLE(A15,A14)
  317.  18| 4            =TABLE(A15,A14)  =TABLE(A15,A14)
  318.  19| 5            =TABLE(A15,A14)  =TABLE(A15,A14)
  319.  
  320. (Right 3 columns of a 6 column table)
  321.  
  322.          E                F                G
  323.  -------------------------------------------------
  324.  8                9                10
  325.  =TABLE(A15,A14)  =TABLE(A15,A14)   =TABLE(A15,A14)
  326.  =TABLE(A15,A14)  =TABLE(A15,A14)   =TABLE(A15,A14)
  327.  =TABLE(A15,A14)  =TABLE(A15,A14)   =TABLE(A15,A14)
  328.  =TABLE(A15,A14)  =TABLE(A15,A14)   =TABLE(A15,A14)
  329.  =TABLE(A15,A14)  =TABLE(A15,A14)   =TABLE(A15,A14)
  330.  
  331. Two-input table (with values displayed):
  332.  
  333.     B    C    D    E    F   G
  334.  --|---------------------------
  335.  14|      6    7    8    9   10
  336.  15| 1    8    9   10   11   12
  337.  16| 2   10   11   12   13   14
  338.  17| 3   12   13   14   15   16
  339.  18| 4   14   15   16   17   18
  340.  19| 5   16   17   18   19   20
  341.  
  342. Note that the result in cell C15 is 1*2+6, which equals 8. The values
  343. in cells B15:B19 are internally substituted into the column input cell
  344. (A14), and the values in cells C14:G14 are internally substituted into
  345. the row input cell (A15).
  346.  
  347. The blank value in cell B14 is a number format. To duplicate this
  348. value, do the following:
  349.  
  350. 1. Select cell B14.
  351.  
  352. 2. From the Format menu, choose Number.
  353.  
  354. 3. In the Code box (the Format box in versions 2.x), type "" (that is,
  355.    two quotation marks).
  356.  
  357. 4. Choose OK.
  358.                                                                       
  359.                                    
  360.            USING TABLES TO ANALYZE INFORMATION IN A DATABASE
  361.           ==================================================
  362.  
  363. You can use database functions in one-input and two-input tables to
  364. analyze values obtained from a database using both comparison and
  365. computed criteria.
  366.  
  367.  
  368. WITH COMPARISON CRITERIA
  369. ========================
  370.  
  371. Comparison criteria is the type of criteria most commonly used to
  372. extract or analyze information from a Microsoft Excel database. The
  373. value you place under the column heading in your criteria range is
  374. compared against the records in your database. If a record matches
  375. that value, it is extracted or included in the group of records to be
  376. analyzed using the database functions. For the following two examples,
  377. you will need to create a sample database and a sample criteria range.
  378.  
  379. To create a sample database, type the following information in cells
  380. A1:C25 of a new worksheet. Then select cells A1:C25 and choose Set
  381. Database from the Data menu.
  382.  
  383.          A             B            C
  384.  --|--------------------------------------
  385.  1 | Type of Soda     Month      Consumed
  386.  2 | Pepup          January     946
  387.  3 | Diet Pepup     January     762
  388.  4 | Colo           January     224
  389.  5 | Diet Colo      January     1
  390.  6 | Splash         January     715
  391.  7 | Diet Splash    January     506
  392.  8 | Lime-Up        January     354
  393.  9 | Diet Lime-Up   January     542
  394.  10| Pepup          February    910
  395.  11| Diet Pepup     February    894
  396.  12| Colo           February    926
  397.  13| Diet Colo      February    471
  398.  14| Splash         February    493
  399.  15| Diet Splash    February    276
  400.  16| Lime-Up        February    45
  401.  17| Diet Lime-Up   February    301
  402.  18| Pepup          March       840
  403.  19| Diet Pepup     March       442
  404.  20| Colo           March       409
  405.  21| Diet Colo      March       205
  406.  22| Splash         March       109
  407.  23| Diet Splash    March       263
  408.  24| Lime-Up        March       603
  409.  25| Diet Lime-Up   March       555
  410.  
  411. To create a sample criteria range, type the following data in cells
  412. E1:G1 of the worksheet. Select E1:G2, and from the Data menu, choose
  413. Set Criteria.
  414.  
  415.           E             F          G
  416.  --|-------------------------------------
  417.  1 | Type of Soda     Month     Consumed
  418.  2 |
  419.  
  420.  
  421. In a One-Input Table
  422. --------------------
  423.  
  424. To find the cost of soda consumed per type in the entire period,
  425. create a one-input table using the data from the database:
  426.  
  427. 1. In cells E5:E12, type the different kinds of soda (because this
  428.    variable data is entered in a column, this will be a column input
  429.    table).
  430.  
  431.     NOTE: You can copy the types from the database and paste them into
  432.     the cells.
  433.  
  434. 2. In cell F4, type the formula:
  435.  
  436.  =DSUM(Database,"Consumed",Criteria)*0.45
  437.  
  438.     NOTE: This formula will add all the consumed sodas in the database
  439.     that match the specified criteria and multiply the result by 45
  440.     cents (the cost per can).
  441.  
  442. 3. Select cells E4:F12.
  443.  
  444. 4. From the Data menu, choose Table.
  445.  
  446. 5. In the Column Input Cell box, type "E2" (without the quotation
  447.    marks).
  448.  
  449.     NOTE: E2 is the cell in the criteria range where you would type
  450.     the name of a specific type of soda. Since you want to substitute
  451.     different types of soda to calculate the expense for each type, we
  452.     leave cell E2 blank in the actual criteria. The table will
  453.     automatically (internally) substitute each soda type that we have
  454.     listed in our table (E4:E12) into cell E2 and calculate the
  455.     formula based on that criterion.
  456.  
  457. One-input table with data from database (with formulas displayed):
  458.  
  459.          E               F
  460.  --|---------------------------------------------------------
  461.  4 | First Quarter  =DSUM(Database,"Consumed",Criteria)*0.45
  462.  5 | Pepup          =TABLE(,E2)
  463.  6 | Diet Pepup     =TABLE(,E2)
  464.  7 | Colo           =TABLE(,E2)
  465.  8 | Diet Colo      =TABLE(,E2)
  466.  9 | Splash         =TABLE(,E2)
  467.  10| Diet Splash    =TABLE(,E2)
  468.  11| Lime-Up        =TABLE(,E2)
  469.  12| Diet Lime-Up   =TABLE(,E2)
  470.  
  471. One-input table with data from database (with values displayed):
  472.  
  473.           E                   F
  474.  --|-----------------------------------------
  475.  4 | First Quarter   Money Spent on Beverages
  476.  5 | Pepup           $1,213.20
  477.  6 | Diet Pepup      $944.10
  478.  7 | Colo            $701.55
  479.  8 | Diet Colo       $304.65
  480.  9 | Splash          $592.65
  481.  10| Diet Splash     $470.25
  482.  11| Lime-Up         $450.90
  483.  12| Diet Lime-Up    $629.10
  484.  
  485. The value displayed in cell F4 is a number format. To duplicate this
  486. value, do the following:
  487.  
  488. 1. Select cell F4.
  489.  
  490. 2. From the Format menu, choose Number.
  491.  
  492. 3. In the Code box (the Format box in versions 2.x), type "MONEY SPENT
  493.    ON BEVERAGES" (without the quotation marks).
  494.  
  495. 4. Choose OK.
  496.  
  497.  
  498. In a Two-Input Table
  499. --------------------
  500.  
  501. For the following example, use the sample database and criteria that
  502. you previously created.
  503.  
  504. To find the cost of soda consumed per type per month, create a two-input table, as follows:
  505.  
  506. 1. In cells E15:E22, type the different types of soda. (This
  507.    represents the column input.)
  508.     
  509.     NOTE: You can copy the types from the database and paste them into
  510.     the cells.
  511.  
  512. 2. Type "January" (without the quotation marks) in cell F14,
  513.    "February" (without the quotation marks) in cell G14, and "MARCH"
  514.    (without the quotation marks) in cell H14.
  515.  
  516. 3. In cell E14, type the formula:
  517.  
  518.  =DSUM(Database,"Consumed",Criteria)*0.45
  519.     
  520.     NOTE: This formula will add all the consumed sodas in the database
  521.     based on the criteria and multiply the total by 45 cents (cost per
  522.     can).
  523.  
  524. 4. Select cells E14:H22.
  525.  
  526. 5. From the Data menu, choose Table.
  527.  
  528. 6. In the Row Input Cell box, type "F2" (without the quotation marks).
  529.    In the Column Input Cell box, type "E2" (without the quotation
  530.    marks).
  531.     
  532.     NOTE: F2 is the cell in the criteria range where you would type
  533.     the name of a specific month. Since you want to calculate the
  534.     expenses for each type of soda for each month and do not want to
  535.     limit your expense analysis to one particular month, leave F2
  536.     blank in the defined criteria range. The table will automatically
  537.     (internally) substitute each month that you have listed in the
  538.     table (F14:H14) into cell F2 and calculate the formula based on
  539.     that month. E2 is the cell in the criteria range where you would
  540.     type the name of a specific type of soda. Since you want to
  541.     calculate the expense for each type of soda , leave E2 blank in
  542.     the actual criteria. If, for example, you wanted to calculate the
  543.     expense for your diet sodas, you would place the word diet in cell
  544.     E2. The table will automatically (internally) substitute each soda
  545.     type that you have listed in the table (E15:E22) into cell E2 and
  546.     calculate the formula based on that type.
  547.  
  548.  
  549. Two-input table with data from database (with formulas displayed):
  550.  
  551.    NOTE:  Due to character-based screen display limitations, the
  552.    following 4-column table is  shown in two parts.
  553.  
  554. (Left  column of a 4 column table)
  555.  
  556.       E
  557.  --|--------------------------------------------
  558.  14|  =DSUM(Database,"Consumed",Criteria)*0.45
  559.  15|  Pepup
  560.  16|  Diet Pepup
  561.  17|  Colo
  562.  18|  Diet Colo
  563.  19|  Splash
  564.  20|  Diet Splash
  565.  21|  Lime-Up
  566.  22|  Diet Lime-Up
  567.  
  568. (Right 3 columns of a 4 column table)
  569.  
  570.        F                    G                H
  571.  -----------------------------------------------------
  572.  January              February       March
  573.  =TABLE(F2,E2)        =TABLE(F2,E2)  =TABLE(F2,E2)
  574.  =TABLE(F2,E2)        =TABLE(F2,E2)  =TABLE(F2,E2)
  575.  =TABLE(F2,E2)        =TABLE(F2,E2)  =TABLE(F2,E2)
  576.  =TABLE(F2,E2)        =TABLE(F2,E2)  =TABLE(F2,E2)
  577.  =TABLE(F2,E2)        =TABLE(F2,E2)  =TABLE(F2,E2)
  578.  =TABLE(F2,E2)        =TABLE(F2,E2)  =TABLE(F2,E2)
  579.  =TABLE(F2,E2)        =TABLE(F2,E2)  =TABLE(F2,E2)
  580.  =TABLE(F2,E2)        =TABLE(F2,E2)  =TABLE(F2,E2)
  581.  
  582.  Two-input table with data from database (with values displayed):
  583.  
  584.           E               F           G           H
  585.  --|--------------------------------------------------
  586.  14|  Cost per Month  January     February     March
  587.  15|  Pepup           $425.70     $409.50      $378.00
  588.  16|  Diet Pepup      $342.90     $402.30      $198.90
  589.  17|  Colo            $100.80     $416.70      $184.05
  590.  18|  Diet Colo       $0.45       $211.95      $92.25
  591.  19|  Splash          $321.75     $221.85      $49.05
  592.  20|  Diet Splash     $227.70     $124.20      $118.35
  593.  21|  Lime-Up         $159.30     $20.25       $271.35
  594.  22|  Diet Lime-Up    $243.90     $135.45      $249.75
  595.  
  596. The value displayed in cell E14 is a number format. To duplicate this
  597. value, do the following:
  598.  
  599. 1. Select cell E14.
  600.  
  601. 2. From the Format menu, choose Number.
  602.  
  603. 3. In the Code box (the Format box in versions 2.x), type "Cost Per
  604.    Month" (without the quotation marks).
  605.  
  606. 4. Choose OK.
  607.  
  608.  
  609.  
  610. WITH COMPUTED CRITERIA
  611. ======================
  612.  
  613. You can also use computed criteria in one-input and two-input tables
  614. to obtain and analyze values from a database. Computed criteria uses a
  615. formula to extract or obtain values for analysis.
  616.  
  617. When you use computed criteria, be aware of the following:
  618.  
  619.  - The field name of the computed criteria must be a label other than
  620.    a field name used in the database (or it can be left blank). In our
  621.    example, we have left cell H1 blank; it could contain the word
  622.    "month"or "formula" or any other text string as long as it is not
  623.    the name of a field in your database.
  624.  
  625.  - In the formula that uses the computed criteria, you must use a
  626.    relative reference to the first record in the field of the database
  627.    that you want to reference. In the following example, the formula
  628.    contains a relative reference to cell B2 in the formula
  629.    =MONTH(B2)=MONTH($H$3).
  630.  
  631.  - In most cases, any other references in the computed criteria must
  632.    be absolute. In the following example, the formula contains an
  633.    absolute reference to cell H3 in the formula
  634.    =MONTH(B2)=MONTH($H$3).
  635.  
  636. For the following examples, you will need to create a sample database
  637. and a sample criteria range.
  638.  
  639. To create a sample database, type the following information in cells
  640. A1:C15 of a new worksheet. Select cells A1:C15, and choose Set
  641. Database from the Data menu.
  642.  
  643.       A           B           C
  644.  --|---------------------------------
  645.  1 | Product #  DATE       AMOUNT SOLD
  646.  2 | 9865       1/2/90     91
  647.  3 | 9870       1/12/90    94
  648.  4 | 9875       1/22/90    76
  649.  5 | 9880       2/1/90     22
  650.  6 | 9865       2/11/90    82
  651.  7 | 9870       2/21/90    71
  652.  8 | 9870       3/3/90     50
  653.  9 | 9865       3/13/90    35
  654.  10| 9880       3/23/90    54
  655.  11| 9875       4/2/90     80
  656.  12| 9865       4/12/90    33
  657.  13| 9880       4/22/90    83
  658.  14| 9875       5/2/90     62
  659.  15| 9870       5/12/90    15
  660.  
  661. To create a sample criteria range, type the following data in cells
  662. E1:H2 of the worksheet. Select cells E1:H2, and from the Data menu,
  663. choose Set Criteria. Select cells E1:H2, and choose Set Criteria from
  664. the Data menu.
  665.  
  666.         E       F         G                   H
  667.  -|------------------------------------------------------
  668.  1| PRODUCT #  DATE   AMOUNT SOLD
  669.  2|                                =MONTH(B2)=MONTH($H$3)
  670.  
  671. The formula =MONTH(B2)=MONTH($H$3) will return a value of either TRUE
  672. or FALSE, which will be displayed in H2:
  673.  
  674.         E       F         G         H
  675.  -|-------------------------------------
  676.  1| PRODUCT #  DATE   AMOUNT SOLD
  677.  2|                                TRUE
  678.  
  679.  
  680.  
  681. In a One-Input Table
  682. --------------------
  683.  
  684. If you want to find how many items were sold each month, how many days
  685. a sale was made, and the maximum number of items sold on one day in
  686. each month, you can create a one-input table from this data, as
  687. follows:
  688.  
  689. 1. Type 1/1/90 in cell E6, 2/1/90 in cell E7, 3/1/90 in cell E8,
  690.    4/1/90 in cell E9, and 5/1/90 in cell E10.
  691.     
  692.     NOTE: If you want only the name of the month to be displayed in
  693.     the table (as in the following example), change the number format
  694.     of cells E6:E10, by choosing Number from the Format menu and
  695.     typing  mmmm in the Code box (the Format box in versions 2.x).
  696.     With this format, E6 will be displayed as January, E7 will be
  697.     displayed as February, and so on.
  698.  
  699. 2. In cell F5, type the formula:
  700.  
  701.  =DSUM(Database,"Amount Sold",Criteria)
  702.  
  703. 3. In cell G5, type the formula:
  704.  
  705.  =DCOUNT(Database,,Criteria)
  706.  
  707. 4. In cell H5, type the formula:
  708.  
  709.  =DMAX(Database,"Amount Sold",Criteria)
  710.  
  711. 5. Select cells E5:H10.
  712.  
  713. 6. From the Data menu, choose Table.
  714.  
  715. 7. In the Column Input Cell box, type "H3" (without the quotation
  716.    marks).
  717.     
  718.     NOTE: Cell H2 contains the formula =MONTH(B2)=MONTH($H$3). This
  719.     formula checks to see if the month in the first record of the Date
  720.     field (B2) equals the month of cell H3 (cell H3 is the column
  721.     input cell). The table will automatically (internally) substitute
  722.     each month listed in the table (E5:E 10) into cell H3 and
  723.     calculate the formulas based on that month.
  724.  
  725.  
  726. One-input table with computed criteria (with formulas displayed):
  727.  
  728.    NOTE:  Due to character-based screen display limitations, the
  729.    following 4-column table is  shown in two parts.
  730.  
  731. (Left 2 columns of a 4 column table)
  732.  
  733.     E       F
  734.  --|-----------------------------------------------
  735.  5 |         =DSUM(Database,"Amount Sold",Criteria)
  736.  6 | 31412   =TABLE(,H3)
  737.  7 | 31443   =TABLE(,H3)
  738.  8 | 31471   =TABLE(,H3)
  739.  9 | 31502   =TABLE(,H3)
  740.  10| 31532   =TABLE(,H3)
  741.  
  742. (Right 2 columns of a 4 column table)
  743.  
  744.  G                            H
  745.  -------------------------------------------------------------------
  746.  =DCOUNT(Database,,Criteria)  =DMAX(Database,"Amount Sold",Criteria)
  747.  =TABLE(,H3)                  =TABLE(,H3)
  748.  =TABLE(,H3)                  =TABLE(,H3)
  749.  =TABLE(,H3)                  =TABLE(,H3)
  750.  =TABLE(,H3)                  =TABLE(,H3)
  751.  =TABLE(,H3)                  =TABLE(,H3)
  752.  
  753. One-input table with computed criteria (with values displayed):
  754.  
  755.         E           F                 G            H
  756.  --|------------------------------------------------------
  757.  5 |            Total Amount      # of Entries   Max Entry
  758.  6 | January    261               3              94
  759.  7 | February   175               3              82
  760.  8 | March      139               3              54
  761.  9 | April      196               3              83
  762.  10| May        77                2              62
  763.  
  764.  
  765.  The values displayed in cells F5:H5 are number formats. To duplicate
  766. these values, do the following:
  767.  
  768. 1. Select cell F5.
  769.  
  770. 2. From the Format menu, choose Number.
  771.  
  772. 3. In the Code box (the Format box in versions 2.x), type "TOTAL
  773.    AMOUNT" (without the quotation marks).
  774.  
  775. 4. Choose OK.
  776.  
  777. 5. Repeat with cells G5 and H5, entering the formats "# of Entries"
  778.    and Max Entry, respectively. (Note that you must include the
  779.    quotation marks with the first entry.)
  780.  
  781.  
  782. In a Two-Input Table
  783. --------------------
  784.  
  785. If you want to find how many items were sold each month for each
  786. product number, you can create a two-input table from this data, as
  787. follows:
  788.  
  789. 1. Type 1/1/90 in cell E13, 2/1/90 in cell E14, 3/1/90 in cell E15,
  790.    4/1/90 in cell E16, and 5/1/90 in cell E17.
  791.     
  792.     NOTE: If you want only the name of the month to be displayed in
  793.     the table (as in the following example), change the number format
  794.     of cells E13:E17, by choosing Number from the Format menu and
  795.     typing mmmm in the Code box (the Format box in versions 2.x). With
  796.     this format, E13 will be displayed as January, E14 will be
  797.     displayed as February, and so on.
  798.  
  799. 2. Type the product number 9865 in cell F12, 9870 in cell G12, 9875 in
  800.    cell H12, and 9880 in cell I12.
  801.  
  802. 3. In cell E12, type the formula:
  803.  
  804.  =DSUM(Database,"Amount Sold",Criteria)
  805.  
  806. 4. Select cells E12:I17.
  807.  
  808. 5. From the Data menu, choose Table.
  809.  
  810. 6. In the Row Input Cell box, type "E2" (without the quotation marks),
  811.    and in the Column Input Cell box, type" H3" (without the quotation
  812.    marks).
  813.     
  814.     NOTE: E2 is the cell in the criteria range where you would type a
  815.     specific product number. Since you want the total number of each
  816.     product sold broken down by each month, leave E2 blank in the
  817.     defined criteria range. The table will automatically (internally)
  818.     substitute each product number listed in the table (F12:I12) into
  819.     cell E2 and calculate the formula based on that product. Cell H2
  820.     contains the formula =MONTH(B2)=MONTH($H$3). This formula checks
  821.     to see if the month in the first record of the Date field (B2)
  822.     equals the month of cell H3, which is the column input cell.
  823.     Remember, the table will automatically (internally) substitute
  824.     each month listed in the table (E13:E17) into cell H3 and
  825.     calculate the formulas based on that month.
  826.  
  827.  
  828. Two-input table with computed criteria (with formulas displayed):
  829.  
  830.    NOTE:  Due to character-based screen display limitations, the
  831.    following 5-column table is  shown in two parts.
  832.  
  833. (Left 2 columns of a 5 column table)
  834.  
  835.     E                                       F
  836. --|-------------------------------------------------------
  837. 12|  =DSUM(Database,"Amount Sold",Criteria)  9865
  838. 13|  31412                                   =TABLE(E2,H3)
  839. 14|  31443                                   =TABLE(E2,H3)
  840. 15|  31471                                   =TABLE(E2,H3)
  841. 16|  31502                                   =TABLE(E2,H3)
  842. 17|  31532                                   =TABLE(E2,H3)
  843.  
  844. (Right 3 columns of a 5 column table)
  845.  
  846. G                H               I
  847. ----------------------------------------------
  848. 9870             9875            9880
  849. =TABLE(E2,H3)    =TABLE(E2,H3)   =TABLE(E2,H3)
  850. =TABLE(E2,H3)    =TABLE(E2,H3)   =TABLE(E2,H3)
  851. =TABLE(E2,H3)    =TABLE(E2,H3)   =TABLE(E2,H3)
  852. =TABLE(E2,H3)    =TABLE(E2,H3)   =TABLE(E2,H3)
  853. =TABLE(E2,H3)    =TABLE(E2,H3)   =TABLE(E2,H3)
  854.  
  855.  
  856. Two-input table with computed criteria (with values displayed):
  857.  
  858.      E        F     G      H       I
  859. --|------------------------------------
  860. 12|          9865   9870   9875    9880
  861. 13| January  91     94     76      0
  862. 14| February 82     71     0       22
  863. 15| March    35     50     0       54
  864. 16| April    33     0      80      83
  865. 17| May      0      15     62      0
  866.