Presentation on theme: "Database Features. Lists n An Excel worksheet can be used like a table in a relational database. n In Excel, such a table is called a list. n Each row."— Presentation transcript:
Lists n An Excel worksheet can be used like a table in a relational database. n In Excel, such a table is called a list. n Each row of the list represents a record. n Each column contains the values of the different fields in the database.
n Excel treats any rectangular array of nonempty cells surrounded by empty rows and columns as a list. n The top row of the list contains the field names. n Throughout, we consider this example:
Filtering n If we want to see only a subset of the records satisfying some criteria, we can apply an appropriate filter. n If we do Data => Filter => AutoFilter, a drop-down menu button appears at each column heading. n Here we click the button on the Title field:
n To see all the records, select (All) from the drop-down menu on the Title column heading. n If we want to see only those records for employees making at least $50,000, we can do this by selecting (Custom…) from the Salary drop-down menu.
Criteria: Advanced Filter and database functions n The Advanced Filter feature and the database functions like DSUM, DAVERAGE, DCOUNT, DMAX, and DMIN use criteria specified in a range of cells on the worksheet itself. n In this example, we will use A16:F17 as our criteria range:
Subtotals n Suppose we would like to see the average salary for each category of employee. n We first sort according to the Title field to group records together according to their title. n Then we do Data => Subtotals… and specify in the resulting dialog box that we want to use the AVERAGE function on the Salary field. n This is what we get:
Pivot tables and pivot charts n A pivot table displays summarized values (sums, counts, or averages) of one field in a list, grouped by one set of field values along the rows and another set of field values along the columns of the worksheet. n A pivot chart displays the same information graphically.
n To create a pivot table and/or a pivot chart, do Data => PivotTable and PivotChart Report… and use the PivotTable Wizard. n Here is an example of a pivot table and corresponding pivot chart:
Importing data from other sources n You can import data in text form and make it an Excel list by using the Text Import Wizard. n To run this, either open the file (a.txt file) or do Data => Get External Data => Import Text File… n You can also convert an Excel list to a text file by doing File => Save As… and specifying the type of file as text.
n You can also import data from an Access database and make it into an Excel list by doing Data => Get External Data => New Database Query… n This brings up the Query Wizard.