Excel 2000: Database Management and Analysis © 2002 ComputerPREP, Inc. All rights reserved. Lesson 1: Working with Databases © 2002 ComputerPREP, Inc. All rights reserved. Objectives • Define database components • Add database components • Modify database records Defining Database Components • Database – an organized collection of information that pertains to a particular subject or purpose • Database components: – Field – a single unit of information – Record – one or more related fields that compose a complete database entry – Field name – a column label that identifies a column of information (field) – Header row – the row in the database that contains the field names Defining Database Components (cont’d) • Two rules when creating databases in Excel: – The first record in the database must be in the row directly below the header row – Each field name must be contained in only one cell. Use the text wrap feature to break a long field name into what appears to be two or more rows. • You can create a database from scratch or by using an existing list (Excel data displayed in row and column format) Adding Database Components • Determine what fields you need to store your data • Store data in the smallest possible fields that make sense to provide flexibility in sorting, grouping and manipulating data • Use data validation to specify permissible data for specific fields – Data validation – restricts database entries to whole numbers, decimal numbers, ranges of numbers or dates, specific text, or any other set of criteria you specify Modifying Database Records • Data form – a window that displays database data one record at a time • Use a data form to: – Add records – Edit records – Delete records – Search the database – Search for records that match specific criteria Lesson 2: Sorting Database Data © 2002 ComputerPREP, Inc. All rights reserved. Objectives • • • • Sort records from top to bottom Sort field data from left to right Sort by four or more columns Specify custom sort orders Sorting Records from Top to Bottom • Sorting – rearranges database records according to a specific order • Perform a single-column sort: – Select a cell in the field and click on the Sort Ascending or Sort Descending button • Sort records by two or three fields simultaneously: – Display the Sort dialog box – Specify sort keys and sort orders using the Sort by and Then by drop-down lists and options – Specify whether or not the database contains a header row Sorting Field Data from Left to Right • Select the field names and associated data • Display the Sort Options dialog box and specify to sort from left to right • Specify sort keys and sort orders in the Sort dialog box as needed Sorting by Four or More Columns • Sort by the three least significant fields first using the Sort dialog box • Select a cell in the most significant column and click the Sort Ascending or Sort Descending button Specifying Custom Sort Orders • Use the Custom Lists card of the Options dialog box to create a custom list that reflects the desired sort order for the field • Use the Sort Options dialog box to select the custom list to specify the sort order • Use the Sort dialog box to specify the sort order for any records not found in the custom list Lesson 3: Using Database Functions © 2002 ComputerPREP, Inc. All rights reserved. Objectives • • • • Use the DAVERAGE function Use the DCOUNT and DSUM functions Use the DMIN and DMAX functions Use the VLOOKUP function Using Database Functions • You can use database functions to return a value determined by: – The function type – The database field you specify – The set of criteria you use to screen field values • Database function – a built-in formula you use to perform database calculations • Criteria – conditions you specify, which must be satisfied by the data in a record in order to include that record in the calculation Using Database Functions (cont’d) • Syntax: DFUNCTION(database, “field,” criteria) – database – the cell range that makes up the database – “field” – identifies the database field to use in the calculation. Field names must be entered as they appear in the database and be enclosed within quotation marks. – criteria – the range or range name of cells that contain the database criteria, consisting of a row containing field names followed by one or more rows containing values used to select records from the database Using Database Functions (cont’d) • DAVERAGE function – averages the values in a database column that match specified criteria • DCOUNT function – counts the cells that contain numbers in the database column that match specified criteria • DSUM function – adds the numbers in a database column that match specified criteria • DMIN function – returns the smallest number in a database column that match specified criteria • DMAX function - returns the largest number in a database column that match specified criteria Using the VLOOKUP Function • VLOOKUP function – searches for a value in one part of a database for use in another area of the worksheet – Syntax: VLOOKUP(lookup_value,table_array,col_index_num, range_lookup) – Function arguments: • lookup_value – used to find a value in the lookup table • table_array – the range that contains the lookup table • col_index_num – the array column number containing the resultant data • range_lookup – a logical value (TRUE or FALSE) that specifies whether the resultant value is approximate or an exact match Lesson 4: Using Filters and Queries © 2002 ComputerPREP, Inc. All rights reserved. Objectives • • • • • • Use the AutoFilter feature Use the Advanced Filter feature Extract data Work with extracted data Query an external database Work with queried data Using the AutoFilter Feature • Filter – displays only those database records that meet a set of criteria that you specify • AutoFilter – filters database records by specifying single comparison criteria or as many as two custom criteria • Comparison criteria – a set of search conditions with which data is compared Using the AutoFilter Feature (cont’d) To activate AutoFilter: • Click on Data, Filter, AutoFilter – Drop-down arrows appear to the right of each column label • The AutoFilter drop-down list contains the following options: – (All) – displays all records in the database – (Top 10…) – displays the top n records in the database, where n is any number you specify – (Custom…) – specifies a custom filter – Remaining list items – list the current data items in the selected field Using the AutoFilter Feature (cont’d) • Single comparison criteria – criteria that consists of a single search condition for a field • Custom criteria – a set of search conditions (consisting of a comparison operator and a value) to which data is compared. You can: – Specify one or two custom criteria at a time – Specify whether matching entries must meet both or either criteria • Comparison operator – a mathematical expression you use to compare two values, such as “is greater than” Using the AutoFilter Feature (cont’d) • To remove a filter from one field: – Click on (All) in the AutoFilter drop-down list • To remove all existing filters from a list: – Click on Data, Filter, Show All • To disable the AutoFilter feature: – Click on Data, Filter, AutoFilter Using the Advanced Filter Feature • Advanced Filter – a feature you use to specify a criteria range and multiple comparison criteria • Use the Advanced Filter dialog box to specify: – The location in which to display the filtered data – The database range – The criteria range – To exclude duplicate records Extracting Data • Extract – a feature that copies filtered data from a database and places it in another area of the worksheet • You must filter data before you can extract it: – You can filter data using AutoFilter, then copy and paste the filtered data to another location or – You can use the Advanced Filter feature to extract data in one step • When you extract records, you can specify to include only certain fields, rather than all fields contained in the database Working with Extracted Data • You can edit, sort and filter extracted data without affecting the data in the original database • One disadvantage of working with extracted data: – Formulas in extracted records appear as values, not formulas; you cannot change values in extracted data to determine their effect on other fields Querying an External Database and Working with Queried Data • You can query an external database (such as an Access database), specifying criteria that records in the external database must meet in order to be imported into Excel • Extracting data from an external database lets you: – Apply formatting to the data – Update the external data to match the most current data in the external database – Edit the data in Excel, which does not change the data in the external database Lesson 5: Using Automated Features © 2002 ComputerPREP, Inc. All rights reserved. Objectives • Use the Automatic Subtotals feature • Use conditional formatting • Use the AutoFormat feature Inserting Automatic Subtotals • Automatic Subtotals – a feature that summarizes data in a database by grouping and automatically performing specific calculations on the data • Organize the data so that the records you want to subtotal are grouped together • Use the Subtotal dialog box to: – Specify the field you want to summarize – Specify the function to use in calculating subtotals – Specify the fields containing the values you want to subtotal – Place the subtotal and grand total rows above or below the detail data Choosing Multiple Summary Functions • After you have inserted subtotals, you can insert additional subtotals and display them in the database • In the Subtotal dialog box, turn off the “Replace current subtotals” option to insert new subtotals while keeping existing subtotals Hiding and Showing Record Detail • When you insert automatic subtotals, outline symbols display in the left margin of the worksheet window • Use the row level symbols or the plus and minus signs to hide or display the level of record detail that you want Using Conditional Formatting • Conditional formatting – formats a range of cells based on criteria you specify • To apply conditional formatting, display the Conditional Formatting dialog box: – Use the Condition drop-down lists and text boxes to specify the comparison criteria – Click on the Format button to select formatting attributes – Click on the Add button to add as many as two more conditions Using the AutoFormat Feature • AutoFormats – a predefined set of formatting commands you can apply to selected cells To apply AutoFormats: – Select the range of cells you want to format – Display the AutoFormat dialog box – Select an AutoFormat • AutoFormats affect the display of worksheet data; they do not change the values of the data Lesson 6: Using PivotTables © 2002 ComputerPREP, Inc. All rights reserved. Objectives • • • • • Create PivotTables Edit PivotTables Use PivotTable AutoFormat Change PivotTable field names and functions Format numbers in PivotTable fields Creating PivotTables • PivotTable – an interactive worksheet table containing fields created from columns of data in a list or data in another part of the worksheet • To create a PivotTable: – Click on Data, PivotTable and PivotChart Report… – Specify the database range and location in which to place the PivotTable – Display the Layout dialog box and drag the fields buttons to the appropriate sections of the blank PivotTable diagram Editing PivotTables • Edit a PivotTable by: – Dragging field buttons to different sections of the PivotTable to rearrange the data display – Adding field buttons to the PivotTable – Removing field buttons from the PivotTable – Hiding and displaying data items for specific fields in the PivotTable Using PivotTable AutoFormat • To apply AutoFormats to PivotTables: – Display the AutoFormat dialog box from the PivotTable toolbar – Select any of the 22 predefined AutoFormats Changing PivotTable Field Names and Functions • Use the PivotTable Field dialog box to change PivotTable field names and functions: – Type a new name for the selected field in the Name text box – Specify a different summary function from the Summarize by list box • You can view the underlying source data for a PivotTable item by double-clicking on the cell that contains the item Formatting Numbers in PivotTable Fields • To format numbers in a PivotTable: – Click on a cell containing the data whose number formatting you want to change – Display the PivotTable Field dialog box, and click on the Number button to display the Format Cells dialog box – Specify the desired formatting • The subtotals and grand totals of the selected data will automatically display in the new format Lesson 7: Modifying PivotTable Data © 2002 ComputerPREP, Inc. All rights reserved. Objectives • • • • • Delete PivotTable data Display and hide PivotTable data Refresh PivotTable data Sort PivotTable data Use the GETPIVOTDATA function Deleting PivotTable Data • Deleting PivotTable data does not affect the source data • You can delete: – Individual field items, or – Entire PivotTable fields • Delete PivotTable field items by: – Displaying the PivotTable field drop-down list, then turning off the check box next to the field • Delete PivotTable fields by: – Dragging the field out of the PivotTable Displaying and Hiding PivotTable Data • You can hide detail items in a PivotTable to display only summary data • To hide PivotTable data: – Right-click on the cell containing the data you want to hide, then click on Group and Outline, Hide Detail, or – Double-click on the cell • To display PivotTable data: – Right-click on the cell containing the data you want to display, then click on Group and Outline, Show Detail, or – Double-click on the cell Refreshing PivotTable Data • PivotTables do not update automatically when you change the source data • Click on the Refresh Data button in the PivotTable toolbar to update the PivotTable • Persistent formatting, which is a feature that retains formatting when you refresh a PivotTable or change its layout, is on by default for all PivotTables Sorting PivotTable Data • PivotTable data is automatically sorted in ascending order according to their labels • You can use the Sort Ascending and Sort Descending buttons in the Standard toolbar to specify to sort PivotTable data by titles or values Using the GETPIVOTDATA Function • GETPIVOTDATA function – retrieves summary data from a PivotTable, provided the summary data is visible in the PivotTable • Syntax: GETPIVOTDATA(pivot_table, “name”) – pivot_table – references a cell in the PivotTable that contains the data you want to retrieve – “name” – a text string enclosed in doublequotation marks that describes the value that you want to retrieve Lesson 8: Using Advanced Data Analysis to Audit Worksheets © 2002 ComputerPREP, Inc. All rights reserved. Objectives • • • • • Trace precedents, dependents and errors Remove arrows Find cells with specific characteristics or entries Use the Goal Seek feature Use the Solver feature Tracing Precedents, Dependents and Errors • Auditing – the process of displaying the flow of worksheet computations • Tracer – an arrow that indicates cell precedents, dependents or errors in a worksheet • Precedent – a cell referred to by a formula in another cell • Dependent – a cell containing a formula that refers to other cells • Error cell – a cell that displays an error value Tracing Precedents, Dependents and Errors (cont’d) • To trace precedents, dependents and errors: – Display the Auditing toolbar – Click on the cell to which you want to add tracers – Click on the Trace Precedents button – Click on the Trace Dependents button – Click on the Trace Error button Removing Arrows • To remove precedent arrows: – Select a cell for which you have traced precedents – Click on the Remove Precedent Arrows button • To remove dependent arrows: – Select a cell for which you have traced dependents – Click on the Remove Dependent Arrows button • To remove all arrows: – Click on the Remove All Arrows button Finding Cells with Specific Characteristics or Entries • Click on the cell for which you want to find precedent or dependent cells • Display the Go To Special dialog box: – Select Precedents and click on OK to locate and select precedent cells or – Select Dependents and click on OK to locate and select dependent cells Using the Goal Seek Feature • Goal Seek – a feature that determines the required input value of a single cell to return a desired formula result • To use the Goal Seek feature: – Display the Goal Seek dialog box – Specify the cell to change – Specify the value to which to change the cell – Specify the adjustable cell Using the Solver Feature • Solver – a feature that determines the possible input values of multiple cells needed to calculate a desired formula result • To use the Solver feature: – Display the Solver Parameters dialog box – Specify the cell to change – Specify the value to which to change the cell – Specify the adjustable cells – Specify any desired constraints Lesson 9: Working with Scenarios © 2002 ComputerPREP, Inc. All rights reserved. Objectives • • • • • Create scenarios Display scenarios Edit and delete scenarios Protect scenarios Create scenario summary reports Creating Scenarios • Scenario – a set of input values, called changing cells, that you can substitute automatically in a worksheet • To create a scenario: – Display the Add Scenario dialog box – Specify a scenario name – Specify the changing cells – Specify a comment (optional) – Display the Scenario Values dialog box – Specify the different values you want to display in the changing cells Displaying Scenarios • To display a scenario: – Display the Scenario Manager dialog box: • Click on the name of the scenario you want to display and click on the Show button or • Double-click on the name of the scenario you want to display Editing and Deleting Scenarios • To edit a scenario: – Display the Scenario Manager dialog box – Click on the name of the scenario you want to edit and click on the Edit button – Make the desired changes • To delete a scenario: – Display the Scenario Manager dialog box – Click on the name of the scenario you want to delete and click on the Delete button Protecting Scenarios • To prevent a scenario from being edited: – Display the Scenario Manager dialog box: • Click on the scenario you want to protect and click on the Edit button • Turn on “Prevent changes” if necessary – Activate worksheet protection Protecting Scenarios (cont’d) • To hide a scenario: – Display the Scenario Manager dialog box: • Click on the scenario you want to hide and click on the Edit button • Turn on “Hide” – Activate worksheet protection Creating Scenario Summary Reports • Scenario summary report – a report that summarizes the input values and results of all available scenarios in a worksheet • To create a scenario summary report: – Display the Scenario Summary dialog box – Specify the summary report type: either a Scenario summary or a Scenario PivotTable report – Specify the result cell(s) Lesson 10: Creating Reports © 2002 ComputerPREP, Inc. All rights reserved. Objectives • Create custom reports • Print custom reports • Create PivotChart reports Creating Custom Reports • You can combine worksheets, scenarios and views into custom reports using the Report Manager Add-In – View – a set of display settings you can apply to a workbook (for example, if you have two scenarios, you can print one with a summary view and the other with a detail view) • A custom report can contain one or more sections – Section – any combination of sheet, view and/or scenario you include in the report Printing Custom Reports • To print a custom report: – Display the Report Manager dialog box – Select the custom report you want to print – Click on the Print button • You can control the orientation, margins and headers by adjusting the page setup before printing Creating PivotChart Reports • PivotChart report – an interactive chart that provides a graphical representation of the data in a PivotTable • The PivotChart and its associated PivotTable are interrelated; any change you make to one is automatically reflected in the other