extracting information from an excel list the purpose of creating a database, or list in excel, is...

Download Extracting Information from an Excel List The purpose of creating a database, or list in Excel, is to be able to manipulate the data elements in ways that

If you can't read please download the document

Upload: bertha-stevenson

Post on 18-Jan-2018

220 views

Category:

Documents


0 download

DESCRIPTION

Turn off the input messages - 1 First, highlight cells A2 through A9 which contain the input messages that we want to turn off. Second, select the Validation command from the Data menu. Extracting Information from an Excel List, Slide 3Copyright © 2004, Jim Schwab, University of Texas at Austin

TRANSCRIPT

Extracting Information from an Excel List The purpose of creating a database, or list in Excel, is to be able to manipulate the data elements in ways that provide support and assistance to the analyst and decision maker. There are three basic strategies for manipulating data: sorting, extracting subsets (filtering), and tallying the entries (pivot tables). Sorting changes the order of the records in the database. It is frequently used to determine whether or not a particular value is present in the database, e.g. a client named George Washington. Filtering displays a subset of record that have some particular value and hides the records that do not have the characteristic. It can be used to examine the characteristics of a subset of records, e.g. the gender breakdown of divorced clients. Pivot tables create summary tables of statistics on the fields in the database, e.g. what is the average age for males and females in the database. Frequently, pivot tables provide the input to Excel charts. Extracting Information from an Excel List, Slide 1Copyright 2004, Jim Schwab, University of Texas at Austin The list with input messages As useful as input messages may be in data entry, they can become very distracting during the analysis of the data because the input messages continue to pop up on the worksheet. We do not want to delete them because we may need them later for more data entry. Instead of deleting them, we will stop them from showing when a cell is selected. Extracting Information from an Excel List, Slide 2Copyright 2004, Jim Schwab, University of Texas at Austin Turn off the input messages - 1 First, highlight cells A2 through A9 which contain the input messages that we want to turn off. Second, select the Validation command from the Data menu. Extracting Information from an Excel List, Slide 3Copyright 2004, Jim Schwab, University of Texas at Austin Turn off the input messages - 2 First, click on the Input message tab to access the settings on that page. Second, clear the check box for Show input message when cell is selected. Third, click on the OK button to apply the change. Extracting Information from an Excel List, Slide 4Copyright 2004, Jim Schwab, University of Texas at Austin Turn off the input messages - 3 Selecting an ID Number cell no longer show the input message. The process for turning off the input messages for the remaining columns must be repeated one column at a time. Excel does not permit us to change validation across cell if they have different validation criteria. The process for turning off the input messages for the remaining columns must be repeated one column at a time. Excel does not permit us to change validation across cell if they have different validation criteria. Extracting Information from an Excel List, Slide 5Copyright 2004, Jim Schwab, University of Texas at Austin Sorting a database using a single field The list commands in the drop down menu make it easy to sort the data base. To sort the list by birth date, select Sort Ascending from the drop down menu to the right of the header. The list is now sorted by birth dates in ascending order. We specify the order of the sort as either Ascending (A to Z or 1 to 9) or Descending (Z to A or 9 to 1). Extracting Information from an Excel List, Slide 6Copyright 2004, Jim Schwab, University of Texas at Austin Sorting a database using more than one field To sort a database using more than one field, we select the Sort command from the Data menu to open the Sort dialog box. Extracting Information from an Excel List, Slide 7Copyright 2004, Jim Schwab, University of Texas at Austin Select multiple fields and directions for a sort - 1 We will sort the database by two fields: Sex in ascending order and Marital Status in descending order. First, we select Sex from the first drop down list as the first field to sort by. Second, we accept the default direction of the sort as Ascending. Extracting Information from an Excel List, Slide 8Copyright 2004, Jim Schwab, University of Texas at Austin Select multiple fields and directions for a sort - 2 First, we select Marital Status from the second drop down list as the second field to sort by. Second, we mark the Descending option button to sort marital statuses form z to a. Third, we click on the OK button to complete our sort specifications. Extracting Information from an Excel List, Slide 9Copyright 2004, Jim Schwab, University of Texas at Austin Results of the sort using multiple fields The first sort field was Sex, requested in ascending order. All females are listed before all males in column B. The second sort field was Marital Status, requested in descending order. Within the groups of females (B2 through B6), Married is listed before Divorced (D2 through D7). Within the group of males (B7 through B9), Never Married is listed before Married (D7 through D9). The second sort field was Marital Status, requested in descending order. Within the groups of females (B2 through B6), Married is listed before Divorced (D2 through D7). Within the group of males (B7 through B9), Never Married is listed before Married (D7 through D9). Extracting Information from an Excel List, Slide 10Copyright 2004, Jim Schwab, University of Texas at Austin Creating a custom list to use in sorting If we sorted the database by Marital Status in ascending order, Divorced would be listed before Married which would be listed before Never Married, which would be listed before Separated and Widowed. In descending order, the reverse would be true. If we wanted to sort the database so that Never Married were listed before Married which were listed before Divorced, who were listed before Separated and Widowed, neither the ascending or descending sort would produce this result. We can sort in the desired order in Excel if we create a custom list. If we sorted the database by Marital Status in ascending order, Divorced would be listed before Married which would be listed before Never Married, which would be listed before Separated and Widowed. In descending order, the reverse would be true. If we wanted to sort the database so that Never Married were listed before Married which were listed before Divorced, who were listed before Separated and Widowed, neither the ascending or descending sort would produce this result. We can sort in the desired order in Excel if we create a custom list. To create a custom list, we select the Options command from the Tools menu. Extracting Information from an Excel List, Slide 11Copyright 2004, Jim Schwab, University of Texas at Austin Selecting the custom list tab In the Options dialog box, we click on the Custom Lists tab. Extracting Information from an Excel List, Slide 12Copyright 2004, Jim Schwab, University of Texas at Austin Type in the entries for a custom list In the List entries text box, we type in the text labels in the order in which we want them to be listed. Second, after the list is typed in, we click on the Add button to add the new list to the end of the list of Custom Lists. First, click in the List entries list box to obtain a text insertion cursor. Type Never Married and press the Enter key. Type Married and press Enter. Type Divorced, followed by Separated and Widowed. First, click in the List entries list box to obtain a text insertion cursor. Type Never Married and press the Enter key. Type Married and press Enter. Type Divorced, followed by Separated and Widowed. Extracting Information from an Excel List, Slide 13Copyright 2004, Jim Schwab, University of Texas at Austin The new list added to custom lists When we click on the Add button, the list was added at the bottom of the list of custom lists. We click on the OK button to complete this operation. Extracting Information from an Excel List, Slide 14Copyright 2004, Jim Schwab, University of Texas at Austin Sorting a database using a custom list To sort the database using the custom sort order, we select the Sort command from the Data menu to open the Sort dialog box. Extracting Information from an Excel List, Slide 15Copyright 2004, Jim Schwab, University of Texas at Austin Selecting the field on which the sort will be based When we open the Sort dialog box again, the criteria for the last sort are still listed. First, we select Marital Status as the first sort field. Second, if necessary, set the remaining sort fields to blank by selecting (none). Third, we click on the Options button. Extracting Information from an Excel List, Slide 16Copyright 2004, Jim Schwab, University of Texas at Austin Selecting the custom list to use in the sort First, in the Sort Options dialog box, we select the Never Married, Married, Divorced, Separated, Widowed list from the drop down menu under the heading First key sort order. Second, with the marital status custom list selected, we click on the OK button. Extracting Information from an Excel List, Slide 17Copyright 2004, Jim Schwab, University of Texas at Austin Completing the sort specifications When we clicked on the OK button in the Sort Options dialog box, we are returned to the Sort dialog box. Having specified the custom list to use, we click on the OK button to do the sort. Extracting Information from an Excel List, Slide 18Copyright 2004, Jim Schwab, University of Texas at Austin Results of the sort using a custom list Our database is now sorted in the desired order. Never Married is listed before Married which is listed before Divorced. Sorting by custom lists will be especially useful to us when we want a pivot table entries to follow a logical order which cannot be accomplished with alphabetical sorting. Extracting Information from an Excel List, Slide 19Copyright 2004, Jim Schwab, University of Texas at Austin Returning the sorted database to its original order We can do a lot of sorting when we are exploring a database. After a lot of different sorts, we may decide we want the data returned to its original order. If we have a field like ID Number that occurs in a natural sequence, we can use it to restore the original order. If a database does not have such a field, we may want to add a field containing a numeric sequence for this very purpose. We can do a lot of sorting when we are exploring a database. After a lot of different sorts, we may decide we want the data returned to its original order. If we have a field like ID Number that occurs in a natural sequence, we can use it to restore the original order. If a database does not have such a field, we may want to add a field containing a numeric sequence for this very purpose. Extracting Information from an Excel List, Slide 20Copyright 2004, Jim Schwab, University of Texas at Austin Sorting the list by ID Number To sort the list by ID Number, select Sort Ascending from the drop down menu to the right of the header. The list is now sorted in the original ascending order by ID Number. Extracting Information from an Excel List, Slide 21Copyright 2004, Jim Schwab, University of Texas at Austin Extracting a subset of cases from a database If we are only interested in visually examining a subset of the cases in our database, we can extract that subset of the database by selecting a filter, or criteria that a case must meet in order to be displayed as part of the subset. The drop down menu next to the field contains a list of the different responses found in that column plus some special choices that we can select. If we are only interested in visually examining a subset of the cases in our database, we can extract that subset of the database by selecting a filter, or criteria that a case must meet in order to be displayed as part of the subset. The drop down menu next to the field contains a list of the different responses found in that column plus some special choices that we can select. Extracting Information from an Excel List, Slide 22Copyright 2004, Jim Schwab, University of Texas at Austin Selecting a filter criteria from the column drop down list To display a subset of the database, we select one of the criteria from a field's drop down menu. To display records for the females in our database, we select Female from the Sex field drop down menu. To display a subset of the database, we select one of the criteria from a field's drop down menu. To display records for the females in our database, we select Female from the Sex field drop down menu. Extracting Information from an Excel List, Slide 23Copyright 2004, Jim Schwab, University of Texas at Austin Results of selecting a filter criteria The filter criteria results in a display of the records that meet the criteria, in this case, records that had Female in the Sex field. There are several visual clues that a filter is in effect. The drop down arrow in the column and the row numbers change from black to blue. In the status bar at the bottom of the window, Excel shows a count of the number of records in the database that met the filter criteria. Extracting Information from an Excel List, Slide 24Copyright 2004, Jim Schwab, University of Texas at Austin Adding a second filter criteria We can use multiple criteria for selecting a subset of case by selecting filter criteria from more than one column. The resulting subset will only include cases that meet all of the specified criteria. To create a subset of women whose marital status is married, we add a filter criteria from the Marital Status field. We select Married from the Marital Status drop down list. Extracting Information from an Excel List, Slide 25Copyright 2004, Jim Schwab, University of Texas at Austin Results from adding a second filter criteria The results show us that there are four cases in our database where the Sex is Female and the Marital Status is Married. Extracting Information from an Excel List, Slide 26Copyright 2004, Jim Schwab, University of Texas at Austin Changing a filter criteria We are free to change the filter criteria as we explore our database. The worksheet will be updated to display the cases that satisfy the last specified filter criteria. We can request a list of Females who are divorced by selecting Divorced from the Marital Status drop down list. We are free to change the filter criteria as we explore our database. The worksheet will be updated to display the cases that satisfy the last specified filter criteria. We can request a list of Females who are divorced by selecting Divorced from the Marital Status drop down list. Extracting Information from an Excel List, Slide 27Copyright 2004, Jim Schwab, University of Texas at Austin The results of the changed filter criteria The results show us that there is one case in our database where the Sex is Female and the Marital Status is Divorced. We can contrast this with the four cases that are Female and Married. If we want a quick count of how many records in a database have certain characteristics, filtering is one strategy for obtaining this information. The results show us that there is one case in our database where the Sex is Female and the Marital Status is Divorced. We can contrast this with the four cases that are Female and Married. If we want a quick count of how many records in a database have certain characteristics, filtering is one strategy for obtaining this information. Extracting Information from an Excel List, Slide 28Copyright 2004, Jim Schwab, University of Texas at Austin Removing filter criteria from a single field To remove a filter criteria from our sub-setting specifications, we select (All) from the drop down menu. (All) refers to the values in the selection criteria, i.e. show all values of Marital Status. Extracting Information from an Excel List, Slide 29Copyright 2004, Jim Schwab, University of Texas at Austin Results of removing a filter criteria from a single column Marital Status is no longer a filtering criteria. Excel displays the list of cases that meet the remaining filter criteria, in this case, subjects whose Sex is Female. When we remove a filter criteria by selecting (All), Excel changes the color of the drop down arrow from blue back to black. Marital Status is no longer a filtering criteria. Excel displays the list of cases that meet the remaining filter criteria, in this case, subjects whose Sex is Female. When we remove a filter criteria by selecting (All), Excel changes the color of the drop down arrow from blue back to black. Extracting Information from an Excel List, Slide 30Copyright 2004, Jim Schwab, University of Texas at Austin Removing filter criteria from all columns To remove the filtering criteria from all columns in our database, we select Filter from the Data menu, and Show All from the submenu. Extracting Information from an Excel List, Slide 31Copyright 2004, Jim Schwab, University of Texas at Austin Results of removing filter criteria from all columns Selecting Show All from the Filter submenu displays all of the cases in our database. All eight of the records in the database are displayed. All blue coloration indicating active filtering is removed from the display Note that Show All is not the same as turning Autofilter off. Autofilter is still active in this database, as shown by the drop down arrows next to the field names. Selecting Show All from the Filter submenu displays all of the cases in our database. All eight of the records in the database are displayed. All blue coloration indicating active filtering is removed from the display Note that Show All is not the same as turning Autofilter off. Autofilter is still active in this database, as shown by the drop down arrows next to the field names. Extracting Information from an Excel List, Slide 32Copyright 2004, Jim Schwab, University of Texas at Austin Creating a compound filter with a custom autofilter A compound filter involves more than one relationship to a filter criteria, e.g. we want to display cases that one value or have a second value. We can create a compound, or combination, filter for a column by selecting (Custom) from a field's drop down menu. A compound filter involves more than one relationship to a filter criteria, e.g. we want to display cases that one value or have a second value. We can create a compound, or combination, filter for a column by selecting (Custom) from a field's drop down menu. Extracting Information from an Excel List, Slide 33Copyright 2004, Jim Schwab, University of Texas at Austin The custom autofilter dialog box - 1 The compound criteria that we want to set is that marital status be either Married or Divorced. We can divide this criteria into two halves. The first half is that marital status be Married. First, we set the relationship for the first half of the criteria by selecting the default equals from the drop down list. Second, we select the value to match for the first half of the criteria. Extracting Information from an Excel List, Slide 34Copyright 2004, Jim Schwab, University of Texas at Austin The custom autofilter dialog box - 2 We specify the relationship between the first and second half of our criteria as an Or relationship because we want to select cases that are married or divorced. Extracting Information from an Excel List, Slide 35Copyright 2004, Jim Schwab, University of Texas at Austin The custom autofilter dialog box - 3 We set the relationship for the second half of the criteria by selecting equals from the drop down list. Extracting Information from an Excel List, Slide 36Copyright 2004, Jim Schwab, University of Texas at Austin The custom autofilter dialog box - 4 Next, we select the value to match for the second half of the criteria, Divorced. Finally, we click on the OK button (hidden under the drop down menu) to complete our specifications. Extracting Information from an Excel List, Slide 37Copyright 2004, Jim Schwab, University of Texas at Austin Results of the custom autofilter The worksheet displays records where the value for Marital Status is either Married or Divorced. Extracting Information from an Excel List, Slide 38Copyright 2004, Jim Schwab, University of Texas at Austin Turning filtering off To turn all filtering off for a database, we click on the check mark in front of the Autofilter submenu item. Clicking on the check mark removes it, turning off the autofilter. Extracting Information from an Excel List, Slide 39Copyright 2004, Jim Schwab, University of Texas at Austin Results of turning filtering off When we turn off filtering, the drop down arrows for each field are removed from the display. The thick blue border indicates that Excel still defines the cells as a list. To turn filtering back on, we select the AutoFilter command from the Data > Filter menu. When we turn off filtering, the drop down arrows for each field are removed from the display. The thick blue border indicates that Excel still defines the cells as a list. To turn filtering back on, we select the AutoFilter command from the Data > Filter menu. Extracting Information from an Excel List, Slide 40Copyright 2004, Jim Schwab, University of Texas at Austin Select PivotTable Report to create a tally for Sex First, select a cell within the list, e.g. A1. Second, select the PivotTable and PivotChart Report command from the Data menu to open the PivotTable and PivotChart Wizard dialog box. If we are interested in tallying how many cases fall into each category of a variable, we can create a pivot table that gives us this information. Extracting Information from an Excel List, Slide 41Copyright 2004, Jim Schwab, University of Texas at Austin Step 1: verify the source of data and kind of report Since the data for the table is in a Excel list from which we want to create a PivotTable, we accept the default data source and Kind of report to create. Click on the Next button. Since the data for the table is in a Excel list from which we want to create a PivotTable, we accept the default data source and Kind of report to create. Click on the Next button. Extracting Information from an Excel List, Slide 42Copyright 2004, Jim Schwab, University of Texas at Austin Step 2: verify the location of the data for the table Excel shows the range as the entire list, including the row for the headers, A1 through D9. Selecting the entire table will enables us to choose any field in the list for our table in a later step. Since the list is the data source, click on the Next button to go to Step 3. Extracting Information from an Excel List, Slide 43Copyright 2004, Jim Schwab, University of Texas at Austin Step 3: locate the table on a new worksheet Accept the default location for the table to a new worksheet which Excel will add to the workbook. Click on the Finish button to complete the table. Extracting Information from an Excel List, Slide 44Copyright 2004, Jim Schwab, University of Texas at Austin Adding sex to the table as the row variable Click on the variable Sex in the Pivot Table Field List as the field that we want to add to the table. Extracting Information from an Excel List, Slide 45Copyright 2004, Jim Schwab, University of Texas at Austin Adding sex to the table as the row variable - 2 Hold the mouse button down on the icon by the Sex variable, drag the icon to the left and drop it on the section of the table marked Drop Row Fields Here. Extracting Information from an Excel List, Slide 46Copyright 2004, Jim Schwab, University of Texas at Austin Adding sex to the table as the row variable - 3 When Sex as dropped as a row variable, Excel updated the pivot table, using the variable name as a header for the row variable, each category as a row in the table, and including grand total as the last row in the table. Extracting Information from an Excel List, Slide 47Copyright 2004, Jim Schwab, University of Texas at Austin Adding sex to the table as the data item - 1 Since we want a tally of the different categories of sex, we add sex to the table as a data item as well as the row variable. Click on the variable Sex in the Pivot Table Field List as the field that we want to add to the table. Since we want a tally of the different categories of sex, we add sex to the table as a data item as well as the row variable. Click on the variable Sex in the Pivot Table Field List as the field that we want to add to the table. Extracting Information from an Excel List, Slide 48Copyright 2004, Jim Schwab, University of Texas at Austin Adding sex to the table as the data item - 2 Hold the mouse button down on the icon by the Sex variable, drag the icon to the left and drop it on the section of the table marked Drop Data Items Here. Extracting Information from an Excel List, Slide 49Copyright 2004, Jim Schwab, University of Texas at Austin The complete table showing a breakdown of sex When Sex was dropped as a data item, Excel updated the pivot table, and added Count of Text to the table, shown in the row above the row variable, with the tallies shown in the column to the right of the row categories. This is the basic one variable pivot table. It tells us how many subjects were in each category of sex. There are many modifications we can make to the table so that it is formatted more attractively and gives us different views of the data, which we will see in future tutorials. This is the basic one variable pivot table. It tells us how many subjects were in each category of sex. There are many modifications we can make to the table so that it is formatted more attractively and gives us different views of the data, which we will see in future tutorials. We can close the PivotTable command bar and the PivotTable Field List window. Extracting Information from an Excel List, Slide 50Copyright 2004, Jim Schwab, University of Texas at Austin