Article ID: 282851 - Last Review: May 17, 2007 - Revision: 6.2 How to use Microsoft Excel data tables to analyze information in a databaseThis article was previously published under Q282851 On This PageSUMMARY
This article describes how to use Microsoft Excel tables to analyze information contained in a database.
MORE INFORMATION
You can use database functions in one-input
(http://support.microsoft.com/kb/q282855/)
and two-input
(http://support.microsoft.com/kb/q282856/)
tables to analyze values obtained from a database, by using both comparison and computed criteria.
Comparison CriteriaComparison criteria are the most commonly used criteria to extract or analyze information from a Microsoft Excel database. The value that you place under the column heading in your criteria range is compared against the records in your database. If a record matches that value, the record is extracted or included in the group of records to be analyzed by the database functions.To create a sample database and a sample criteria range, follow these steps:
In a One-Input TableTo find the cost of soda consumed per type the entire period, create a one-input table that uses the data from the database:
One-Input table with data from database (with formulas displayed)
=================================================================
| E | F
---|---------------|----------------------------------------
4 | First Quarter |=DSUM(Database,"Consumed",Criteria)*0.45
5 | Pepup |=TABLE(,E2)
6 | Diet Pepup |=TABLE(,E2)
7 | Colo |=TABLE(,E2)
8 | Diet Colo |=TABLE(,E2)
9 | Splash |=TABLE(,E2)
10| Diet Splash |=TABLE(,E2)
11| Lime-Up |=TABLE(,E2)
12| Diet Lime-Up |=TABLE(,E2)
One-Input table with data from database (with values displayed)
===============================================================
| E | F
---|---------------|------------------------
4 | First Quarter |Money Spent on Beverages
5 | Pepup | $1,213.20
6 | Diet Pepup | $944.10
7 | Colo | $701.55
8 | Diet Colo | $304.65
9 | Splash | $592.65
10| Diet Splash | $470.25
11| Lime-Up | $450.90
12| Diet Lime-Up | $629.10
In a Two-Input TableFor the following example, use the sample database and criteria that you created earlier. To create a two-input table and use it to find the cost of soda consumed per type per month, follow these steps:
Two-input table with data from database (with formulas displayed)
=================================================================
NOTE: Due to screen display limitations, the following four-column table is
shown in two parts.
(Left column of a four-column table.)
| E
---|-----------------------------------------
14| =DSUM(Database,"Consumed",Criteria)*0.45
15| Pepup
16| Diet Pepup
17| Colo
18| Diet Colo
19| Splash
20| Diet Splash
21| Lime-Up
22| Diet Lime-Up
(Right three columns of a four-column table.)
| F | G | H
---|---------------|--------------|-------------
14| January |February |March
15| =TABLE(F2,E2) |=TABLE(F2,E2) |=TABLE(F2,E2)
16| =TABLE(F2,E2) |=TABLE(F2,E2) |=TABLE(F2,E2)
17| =TABLE(F2,E2) |=TABLE(F2,E2) |=TABLE(F2,E2)
18| =TABLE(F2,E2) |=TABLE(F2,E2) |=TABLE(F2,E2)
19| =TABLE(F2,E2) |=TABLE(F2,E2) |=TABLE(F2,E2)
20| =TABLE(F2,E2) |=TABLE(F2,E2) |=TABLE(F2,E2)
21| =TABLE(F2,E2) |=TABLE(F2,E2) |=TABLE(F2,E2)
22| =TABLE(F2,E2) |=TABLE(F2,E2) |=TABLE(F2,E2)
Two-input table with data from database (with values displayed)
===============================================================
| E | F | G | H
---|----------------|--------|---------|--------
14| Cost per Month |January |February |March
15| Pepup |$425.70 | $409.50 | $378.00
16| Diet Pepup |$342.90 | $402.30 | $198.90
17| Colo |$100.80 | $416.70 | $184.05
18| Diet Colo | $0.45 | $211.95 | $92.25
19| Splash |$321.75 | $221.85 | $49.05
20| Diet Splash |$227.70 | $124.20 | $118.35
21| Lime-Up |$159.30 | $20.25 | $271.35
22| Diet Lime-Up |$243.90 | $135.45 | $249.75
Computed CriteriaYou can also use computed criteria in one-input and two-input tables to obtain and analyze values from a database. Computed criteria use a formula to extract or obtain values for analysis.When you use computed criteria, be aware of the following:
| A | B | C
---|-----------|---------|------------
1 | Product # |Date |Amount Sold
2 | 9865| 1/2/90| 91
3 | 9870| 1/12/90| 94
4 | 9875| 1/22/90| 76
5 | 9880| 2/1/90| 22
6 | 9865| 2/11/90| 82
7 | 9870| 2/21/90| 71
8 | 9870| 3/3/90| 50
9 | 9865| 3/13/90| 35
10| 9880| 3/23/90| 54
11| 9875| 4/2/90| 80
12| 9865| 4/12/90| 33
13| 9880| 4/22/90| 83
14| 9875| 5/2/90| 62
15| 9870| 5/12/90| 15
| E | F | G | H
---|-----------|-----|-------------|---------------------
1 | Product # |Date |Amount Sold |
2 | | | |=MONTH(B2)=MONTH($H$3)
The formula =MONTH(B2)=MONTH($H$3) returns a value of either TRUE or
FALSE, which is displayed in H2:
| E | F | G | H
---|-----------|-----|-------------|---------
1 |Product # |Date |Amount Sold |
2 | TRUE
In a One-Input TableIf you want to find out how many items were sold each month, how many days a sale was made, and the maximum number of items sold on one day in each month, create a one-input table from this data, as follows:
One-Input table with computed criteria (with formulas displayed)
================================================================
NOTE: Due to screen display limitations, the following four-column table is
shown in two parts.
(Left two columns of a four-column table.)
| E | F
---|------- |--------------------------------------
5 | |=DSUM(Database,"Amount Sold",Criteria)
6 | 1/1/90 |=TABLE(,H3)
7 | 2/1/90 |=TABLE(,H3)
8 | 3/1/90 |=TABLE(,H3)
9 | 4/1/90 |=TABLE(,H3)
10| 5/1/90 |=TABLE(,H3)
(Right two columns of a four-column table.)
| G | H
---|-----------------------------|-------------------------------------
5 | =DCOUNT(Database,,Criteria) |=DMAX(Database,"Amount Sold",Criteria)
6 | =TABLE(,H3) |=TABLE(,H3)
7 | =TABLE(,H3) |=TABLE(,H3)
8 | =TABLE(,H3) |=TABLE(,H3)
9 | =TABLE(,H3) |=TABLE(,H3)
10| =TABLE(,H3) |=TABLE(,H3)
One-Input table with computed criteria (with values displayed)
==============================================================
| E | F | G | H
---|---------|-------------|-------------|----------
5 | | Total Amount| # of Entries| Max Entry
6 | January | 261| 3| 94
7 | February| 175| 3| 82
8 | March | 139| 3| 54
9 | April | 196| 3| 83
10| May | 77| 2| 62
In a Two-Input TableIf you want to find how many items were sold each month for each product number, you can create a two-input table from this data, as follows:
Two-Input table with computed criteria (with formulas displayed)
================================================================
Due to screen display limitations, the following five-column table is shown
in two parts.
(Left two columns of a five-column table.)
| E | F
---|----------------------------------------|-------------
12| =DSUM(Database,"Amount Sold",Criteria) |9865
13| 1/1/90 |=TABLE(E2,H3)
14| 2/1/90 |=TABLE(E2,H3)
15| 3/1/90 |=TABLE(E2,H3)
16| 4/1/90 |=TABLE(E2,H3)
17| 5/1/90 |=TABLE(E2,H3)
(Right three columns of a five-column table.)
| G | H | I
---|---------------|--------------|-------------
12| 9870| 9875| 9880
13| =TABLE(E2,H3) |=TABLE(E2,H3) |=TABLE(E2,H3)
14| =TABLE(E2,H3) |=TABLE(E2,H3) |=TABLE(E2,H3)
15| =TABLE(E2,H3) |=TABLE(E2,H3) |=TABLE(E2,H3)
16| =TABLE(E2,H3) |=TABLE(E2,H3) |=TABLE(E2,H3)
17| =TABLE(E2,H3) |=TABLE(E2,H3) |=TABLE(E2,H3)
Two-Input table with computed criteria (with values displayed)
==============================================================
| E | F | G | H | I
---|----------|-----|-----|-----|----
12| | 9865| 9870| 9875|9880
13| January | 91| 94| 76| 0
14| February | 82| 71| 0| 22
15| March | 35| 50| 0| 54
16| April | 33| 0| 80| 83
17| May | 0| 15| 62| 0
REFERENCES
For more information about how to use data tables, click the following article number to view the article in the Microsoft Knowledge Base:
282852
(http://support.microsoft.com/kb/282852/
)
An overview of data tables in Microsoft Excel
282855
(http://support.microsoft.com/kb/282855/
)
How to create and use one-input data tables in Microsoft Excel
282856
(http://support.microsoft.com/kb/282856/
)
How to create and use two-input data tables in Microsoft Excel
| Article Translations
|
Back to the top
