excel project 5 creating, sorting, and querying a list

71
Excel Project 5 Creating, Sorting, and Querying a List

Upload: tabitha-sherman

Post on 25-Dec-2015

220 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Excel Project 5 Creating, Sorting, and Querying a List

Excel Project 5

Creating, Sorting, and Querying a List

Page 2: Excel Project 5 Creating, Sorting, and Querying a List

2

Objectives

• Create and manipulate a list

• Delete sheets in a workbook

• Validate data

• Add computational fields to a list

• Use the VLOOKUP function to look up a value in a table

Page 3: Excel Project 5 Creating, Sorting, and Querying a List

3

Objectives

• Use the Toggle Total Row in a list

• Print a list

• Use a data form to display, add, and delete records and change field values in a list

• Sort a list on one field or multiple fields

• Display automatic subtotals

Page 4: Excel Project 5 Creating, Sorting, and Querying a List

4

Objectives

• Use Group and Outline features to hide and unhide data

• Query a list

• Apply database functions, the SUMIF function, and the COUNTIF function to generate information from a list

• Save a workbook in different file formats

Page 5: Excel Project 5 Creating, Sorting, and Querying a List

5

Defining a Range as a list

• Open the file:– Soccer Gear Sales Rep List.xls

• Select the range A8:H8• Click Data on the menu bar and then point

to List on the Data menu• Click Create List on the List submenu• When Excel displays the Create List dialog

box, click the My list has headers check box

Page 6: Excel Project 5 Creating, Sorting, and Querying a List

6

Defining a Range as a list

• Click the OK button• If Excel does not display the List toolbar

automatically, right-click any toolbar at the top of the Excel window and then click List on the shortcut menu

• Dock the List toolbar immediately below the Formatting toolbar

• Scroll down until row 7 is at the top of the worksheet window and then select cell A9

Page 7: Excel Project 5 Creating, Sorting, and Querying a List

7

Defining a Range as a list

Page 8: Excel Project 5 Creating, Sorting, and Querying a List

8

Formatting the Insert Row in an Empty List

• Select the range A9:H9 and then click the Bold button on the Formatting toolbar

• Select the range B9:H9 and then click the Center button on the Formatting toolbar

• Right-click cell D9. Click Format Cells on the shortcut menu. When Excel displays the Format Cells dialog box, click the Number tab, click Date in the Category list, click 03/14/01 in the Type list, and then click the OK button

• Select the range G9:H9 and then click the Comma Style button on the Formatting toolbar. Click the Decrease Decimal button on the Formatting toolbar twice so columns G and H will display whole numbers

Page 9: Excel Project 5 Creating, Sorting, and Querying a List

9

Validating Data

• Select cell B9, the cell in the insert row below the Gender column heading in cell B8

• Click Data on the menu bar• Click Validation on the Data menu• When Excel displays the Data Validation

dialog box, click the Settings tab, click the Allow box arrow, and then click List in the Allow list

Page 10: Excel Project 5 Creating, Sorting, and Querying a List

10

Validating Data

• Type F, M in the Source box

• Click In-cell dropdown to clear it

• Click the Error Alert tab

• If necessary, click Show error alert after invalid data is entered

Page 11: Excel Project 5 Creating, Sorting, and Querying a List

11

Validating Data

• Click the Style box arrow and then click Stop in the Style list

• Type Gender Invalid in the Title box

• Type Gender code must be an F or M. in the Error message box

• Click the OK button

Page 12: Excel Project 5 Creating, Sorting, and Querying a List

12

Entering Records into a List Using a Data Form

• If necessary, select cell A9 to activate the list

• Click Data on the menu bar

• Click Form on the Data menu

• Enter the first sales rep’s record into the data form as shown in next slide

• Click the New button

Page 13: Excel Project 5 Creating, Sorting, and Querying a List

13

This is the information for the first record

Daniel, K M 27 06/17/96 IL Outside

3,500,000

3,224,000

Page 14: Excel Project 5 Creating, Sorting, and Querying a List

14

Entering Records into a List Using a Data Form

• Using the technique in the previous step, enter the remaining records as shown in the next slide

• Click the Close button to complete the last record entry

• Click the Save button on the Standard toolbar to save the workbook using the file name, Soccer Gear Sales Rep List

Page 15: Excel Project 5 Creating, Sorting, and Querying a List

15

Roberts, K F 32 12/15/96 FL Inside 2,525,000 1,853,000

Madhu, D M 38 04/15/97 TX Outside 3,975,000 4,115,000

Wells, A F 37 03/19/99 NY Inside 5,235,000 4,015,000

Nadir, N M 42 08/12/99 TX Inside 3,325,000 1,963,000

Bright, S F 33 02/20/00 CA Outside 4,555,000 4,354,000

Lopez, P M 23 04/19/00 NY Outside 4,800,000 3,873,000

Gilbert, C M 40 07/15/01 TN Inside 3,675,000 2,555,000

Dresden, K M 39 10/22/01 IL Inside 4,623,000 1,856,000

Jablonski, C F 22 12/15/02 FL Outside 3,125,000 2,150,000

Lee, Y F 22 04/15/03 TN Outside 2,175,000 1,550,000

Smith, R M 25 06/17/03 CA Inside 3,312,000 2,150,000

Page 16: Excel Project 5 Creating, Sorting, and Querying a List

16

Entering Records into a List Using a Data Form

Page 17: Excel Project 5 Creating, Sorting, and Querying a List

17

Adding New Fields to a List

• Select cell I8, type % of Quota, click cell J8, type Grade, click cell H8, click the Format Painter button on the Standard toolbar, and then drag through the range I8:J8

• Select cell I9, enter =h9/g9 as the formula, click the Percent Style button on the Formatting toolbar, and then click the Increase Decimal button on the Formatting toolbar twice

• Select the range I9:J9, click the Bold button on the Formatting toolbar, and then click the Center button on the Formatting toolbar

Page 18: Excel Project 5 Creating, Sorting, and Querying a List

18

Adding New Fields to a List

• Select the range A7:J7, right-click the selected range, click Format Cells on the shortcut menu, click the Alignment tab, click the Horizontal box arrow, click Center Across Selection, and then click the OK button

• Click cell I9 and then drag the fill handle down through cell I20

Page 19: Excel Project 5 Creating, Sorting, and Querying a List

19

Adding New Fields to a List

Page 20: Excel Project 5 Creating, Sorting, and Querying a List

20

Create the lookup table using these instructions

• Select column headings L and M. Point to the boundary on the right side of the column M heading above row 1 and then drag to the right until the ScreenTip indicates, Width: 11.00 (82 pixels).

• Select cell L1 and then enter Grade Table as the table title.

Page 21: Excel Project 5 Creating, Sorting, and Querying a List

21

Create the lookup table using these instructions

• With cell L1 selected, click the Font box arrow on the Formatting toolbar and then click Broadway (or a font of your choice) in the Font list. Click the Font Size box arrow on the Formatting toolbar and then click 14 in the Font Size list. Click the Bold button on the Formatting toolbar. Click the Font Color button arrow on the Formatting toolbar and then click Blue (column 6, row 2) on the Font Color palette.

Page 22: Excel Project 5 Creating, Sorting, and Querying a List

22

Create the lookup table using these instructions

• Drag through cell M1 and then click the Merge and Center button on the Formatting toolbar.

• Select the range I8:J8. While holding down the CTRL key, point to the border of the range I8:J8 and drag to the range L2:M2 to copy the column headings, % of Quota and Grade.

Page 23: Excel Project 5 Creating, Sorting, and Querying a List

23

Create the lookup table using these instructions

• Enter the table entries from the next slide in the range L3:M7. Select the range L3:M7, click the Bold button on the Formatting toolbar, and then click the Center button on the Formatting toolbar. Select cell J9 to deselect the range L3:M7.

Page 24: Excel Project 5 Creating, Sorting, and Querying a List

24

Grade Table % of Quota Grade

0% F

60% D

70% C

80% B

93% A

Page 25: Excel Project 5 Creating, Sorting, and Querying a List

25

Using the VLOOKUP Function to Determine Letter Grades

With cell J9 selected, type =vlookup(i9, $l$3:$m$7,2) as the cell entry and click the Enter box

• With cell J9 selected, drag the fill handle through cell J20 to copy the function to the range J10:J20

• Select cell A22 to deselect the range J9:J20• Scroll down until row 7 is at the top of the

worksheet window

Page 26: Excel Project 5 Creating, Sorting, and Querying a List

26

Using the VLOOKUP Function to Determine Letter Grades

Page 27: Excel Project 5 Creating, Sorting, and Querying a List

27

Using the Toggle Total Row Button

• Select cell A9 to make the list active. Click the Toggle Total button on the List toolbar

• Select cell H22

• When Excel displays an arrow on the right side of the cell, click the arrow

• Click Sum in the list

Page 28: Excel Project 5 Creating, Sorting, and Querying a List

28

Using the Toggle Total Row Button

• Select cell G22, click the arrow on the right side of the cell, and then click Sum in the list

• Select cell C22, click the arrow on the right side of the cell, and then click Average in the list

• Select cell A9• Click the Toggle Total Row button on the

List toolbar

Page 29: Excel Project 5 Creating, Sorting, and Querying a List

29

Using the Toggle Total Row Button

Page 30: Excel Project 5 Creating, Sorting, and Querying a List

30

Using the Print List Button

• With the list active, click the Toggle Total Row button to show the total row

• Click the Print List button on the List toolbar

• Click the Toggle Total Row button to hide the total row

Page 31: Excel Project 5 Creating, Sorting, and Querying a List

31

Viewing a Record Using a Data Form

• With the list active, click the List button on the List toolbar and then click Form on the List button menu

• When Excel displays the data form, click the Find Next button until the sixth record in the list appears on the data form

Page 32: Excel Project 5 Creating, Sorting, and Querying a List

32

Sorting a List in Ascending Sequence by Name Using the Sort Ascending Button

• Select cell A9 and then point to the Sort Ascending button on the Standard toolbar

• Click the Sort Ascending button

Page 33: Excel Project 5 Creating, Sorting, and Querying a List

33

Sorting a List in Descending Sequence by Name Using the Sort Descending Button

• If necessary, select cell A9

• Click the Sort Descending button on the Standard toolbar

Page 34: Excel Project 5 Creating, Sorting, and Querying a List

34

Sorting a List Using the Sort Command on a Column Heading List• Click the Hire Date

arrow as shown• Click Sort Ascending

in the Hire Date list

Page 35: Excel Project 5 Creating, Sorting, and Querying a List

35

Sorting a List on Multiple Fields Using the Sort Command on the List Button Menu

• With a cell in the list active, click the List button on the List toolbar

• Click the Sort command on the List button menu

• When Excel displays the Sort dialog box, click the Sort by box arrow

• Scroll down the list and then click Sales Area. Click the first Then by box arrow and then click Gender

Page 36: Excel Project 5 Creating, Sorting, and Querying a List

36

Sorting a List on Multiple Fields Using the Sort Command on the List Button Menu

• Click the second Then by box arrow and then click Quota

• Click Descending in the second Then by area

• Click the OK button• After viewing the sorted list, click the Hire

Date arrow and then click Sort Ascending in the Hire Date list to sort the list into its original sequence

Page 37: Excel Project 5 Creating, Sorting, and Querying a List

37

Sorting a List on Multiple Fields Using the Sort Command on the List Button Menu

Page 38: Excel Project 5 Creating, Sorting, and Querying a List

38

Displaying Automatic Subtotals in a List

• Click the State arrow in cell E8 and then click Sort Ascending in the State list

• With cell A9 active, click the List button.

• When Excel displays the List button menu click Convert to Range.

• When Excel displays the Microsoft Excel dialog box, click the Yes button.

Page 39: Excel Project 5 Creating, Sorting, and Querying a List

39

Displaying Automatic Subtotals in a List

• Click Data on the menu bar• Click Subtotals on the Data menu.• When Excel displays the Subtotal dialog box,

click the At each change in box arrow and then click St.

• If necessary, select Sum in the Use function list.• In the Add subtotal to list, click Grade to clear it

and then click Quota and YTD Sales to select them.

• Click the OK button

Page 40: Excel Project 5 Creating, Sorting, and Querying a List

40

Displaying Automatic Subtotals in a List

Page 41: Excel Project 5 Creating, Sorting, and Querying a List

41

Zooming Out on a Subtotaled List and Using the Outline Feature

• Click the Zoom box on the Standard toolbar, type 90 as the new value, and then press the ENTER key

• Click the row level symbol 2 on the left side of the window

• Click each of the lower three show detail symbols (+) on the left side of the window

• Click the row level symbol 3 on the left side of the window to show all detail rows

• Click the Zoom box arrow on the Standard toolbar and then click 100% in the Zoom list

Page 42: Excel Project 5 Creating, Sorting, and Querying a List

42

Zooming Out on a Subtotaled List and Using the Outline Feature

Page 43: Excel Project 5 Creating, Sorting, and Querying a List

43

To remove automatic subtotals from a list

• Click Data on the menu bar and then click Subtotals

• Click the Remove All button

• Select the range A8:J20

• Click Data on the menu bar, point to List, and then click Create list

• When Excel displays the Create List dialog box, click the OK button

Page 44: Excel Project 5 Creating, Sorting, and Querying a List

44

To Sort a List into Its Original Order Using a Column Heading List

• Select Cell A9 to make the list active

• Click the Hire Date arrow and then click Sort Ascending in the Hire Date list

Page 45: Excel Project 5 Creating, Sorting, and Querying a List

45

To Find Records Using a Data Form

• Select cell A9 to activate the list• Click Data on the menu bar and then click form• Click the Criteria button in the data form• Type M in the Gender text box, >38 in the Age

text box, Inside in the Sales Area text box and <2,6000,000 in the YTD Sales text box

• Click the Find Next button to view the records in the list that pass the test

Page 46: Excel Project 5 Creating, Sorting, and Querying a List

46

Querying a List Using AutoFilter

• With the list active, click the arrow to the right of Gender in cell B8

• Click F in the Gender list

• Click the Sales Area arrow in row 8

• Click Inside in the Sales Area list

Page 47: Excel Project 5 Creating, Sorting, and Querying a List

47

Showing All Records in a List

• With the list active, click Data on the menu bar and point to Filter

• Click Show All on the Filter submenu

Page 48: Excel Project 5 Creating, Sorting, and Querying a List

48

To Enter Custom Criteria Using Autofilter

• With the list active click the Age arrow in cell C8

• Click (Custom…) in the Age list

• When Excel displays the Custom AutoFilter dialog box, click the top left box arrow, click is greater than or equal to in the list, and then type 30 in the top right box

Page 49: Excel Project 5 Creating, Sorting, and Querying a List

49

To Enter Custom Criteria Using Autofilter

• Click the bottom left box arrow, click is less than or equal to in the list, and then type 40 in the bottom right box

• Click the OK bottom in the Custom AutoFilter dialog box

• After viewing the records that meet the custom criteria, point to Filter on the Data menu, and then click Show All to display all records in the list

Page 50: Excel Project 5 Creating, Sorting, and Querying a List

50

To Create a Criteria Range on the Worksheet

• Select the range A7:J8 and then click the Copy button on the Standard toolbar

• Click Cell A1 and then press the ENTER key to copy the contents on the Office Clipboard to the destination area A1:J2

Page 51: Excel Project 5 Creating, Sorting, and Querying a List

51

To Create a Criteria Range on the Worksheet

• Change the title to Criteria Area in cell A1

• Enter M in cell B3, enter >35 in cell Cs, and then enter >C in cell J3.

• Select the range A2:J3, click the Name box in the formula bar, type Criteria as the range name, press the enter key, and then click cell J3.

Page 52: Excel Project 5 Creating, Sorting, and Querying a List

52

Querying a List Using the Advanced Filter Command

• Select cell A9 to activate the list

• Click Data on the menu bar and then point to Filter on the Data menu

• Click Advanced Filter on the Filter submenu

• Click the OK button in the Advanced Filter dialog box

• Notice the results and then show all records

Page 53: Excel Project 5 Creating, Sorting, and Querying a List

53

To Create an Extract Range and Extract Records

• Select range A7:J8, click the Copy button on the Standard toolbar, select cell A24, and then press the enter key to copy the contents to the area A24:J25

• Select cell A24 and then type Extract Area as the title

• Select the range A25:J25, type the name Extract in the Name box in the formula bar, and then press the ENTER key

Page 54: Excel Project 5 Creating, Sorting, and Querying a List

54

To Create an Extract Range and Extract Records

• Select call A9 to activate the list, click Data on the menu bar and then point to Filter

• Click Advanced Filter on the Filter submenu

• When Excel displays the Advanced Filter dialog box, click Copy to another location in the Action area

• Change the Copy to box to:$A$25:$J$25• Click the OK button

Page 55: Excel Project 5 Creating, Sorting, and Querying a List

55

Enabling AutoFilter

• Click Data on the menu bar and then point to Filter

• Click AutoFilter on the Filter submenu

Page 56: Excel Project 5 Creating, Sorting, and Querying a List

56

Using the DAVERAGE and DCOUNT Database Functions

• Select cell O1, and then enter Criteria as the criteria area title. Select cell L1, click the Format Painter button on the Standard toolbar, and then select cell O1

• Select cell O2 and then enter Gender as the field name. Select cell P2 and enter Gender as the field name. Select cell Q2 and then enter Grade as the field name. Select cell L2. Click the Format Painter button on the Standard toolbar. Drag through the range O2:Q2

• Enter F in cell O3 as the Gender code for female sales reps. Enter M in cell P3 as the Gender code for male sales reps. Enter A in cell Q3 as the Grade value. Select M3, click the Format Painter button on the Formatting toolbar, and then drag through the range O3:Q3

Page 57: Excel Project 5 Creating, Sorting, and Querying a List

57

Using the DAVERAGE and DCOUNT Database Functions

• Enter Average Female Age = = = = = > in cell O4. Enter Average Male Age = = = = = = => in cell O5. Enter Grade A Count = = = = = = = = = = > in cell O6

• Select cell R4 and then enter =daverage(a8:j20, “Age”, o2:o3) as the database function

• Select cell R5 and then enter =daverage(a8:j20, “Age”, p2:p3) as the database function

Page 58: Excel Project 5 Creating, Sorting, and Querying a List

58

Using the DAVERAGE and DCOUNT Database Functions

• Select cell R6 and then enter =dcount(a8:j20, “Age”, q2:q3) as the database function

• Select the range O4:R6 and then click the Bold button on the Formatting toolbar

• Select the range R4:R5 and then click the Comma Style button on the Formatting toolbar

• Widen Column Q to fit

Page 59: Excel Project 5 Creating, Sorting, and Querying a List

59

Using the DAVERAGE and DCOUNT Database Functions

Page 60: Excel Project 5 Creating, Sorting, and Querying a List

60

Using the SUMIF and COUNTIF Functions

• Enter Grade A YTD Sales Sum = = => in cell O8

• Enter Female Sales Rep Count = = > in cell O9

• Select cell R8 and then enter =SUMIF(j9:j20,”A”,h9:h20) as the function

• Select cell R9 and then enter =COUNTIF(b9:b20,”F”) as the function

Page 61: Excel Project 5 Creating, Sorting, and Querying a List

61

Using the SUMIF and COUNTIF Functions

• Select the range O8:R9 and then click the Bold button on the Formatting toolbar

• Select cell R8, click the Comma Style button on the Formatting toolbar, and then click the Decrease Decimal button on the Formatting toolbar twice

• Double-click the right border of column heading R to change the width of column R to best fit

• Print the worksheet on one page in landscape

Page 62: Excel Project 5 Creating, Sorting, and Querying a List

62

Save the Workbook after printing

Page 63: Excel Project 5 Creating, Sorting, and Querying a List

63

Saving a Workbook in CSV File Format

• Select the list in the range A8:I20

• Click the Copy button on the Standard toolbar

• Click the New button on the Standard toolbar

• With cell A1 selected in the new workbook, click the Paste button on the Standard toolbar

Page 64: Excel Project 5 Creating, Sorting, and Querying a List

64

Saving a Workbook in CSV File Format

• Click the Select All button, point to the right border of the column A heading, and double-click to set all column widths to best fit

• Select cell A15• With a floppy disk in drive A, click the Save

button on the Standard toolbar• When Excel displays the Save As dialog box,

type Soccer Gear Sales Rep List CSV in the File name text box

Page 65: Excel Project 5 Creating, Sorting, and Querying a List

65

Saving a Workbook in CSV File Format

• Click the Save as type box arrow and then scroll down and click CSV (Comma delimited) in the Save as type list

• If necessary, click 3½ Floppy (A:) in the Save in list, click the Save button in the Save As dialog box, and then click the OK button and the Yes button in the Microsoft Excel dialog boxes when they appear

• Click the workbook Close button on the right side of the Excel title bar

Page 66: Excel Project 5 Creating, Sorting, and Querying a List

66

Saving a Workbook in CSV File Format

Page 67: Excel Project 5 Creating, Sorting, and Querying a List

67

To Use Notepad to Open and Print a CSV file

• Start Notepad

• Click File on the menu bar, and then click Open

• When the Open dialog box appears, click the File of type box arrow and then click All Files

• When the file opens click File on the menu bar and then click print

Page 68: Excel Project 5 Creating, Sorting, and Querying a List

68

Summary

• Create and manipulate a list

• Delete sheets in a workbook

• Validate data

• Add computational fields to a list

• Use the VLOOKUP function to look up a value in a table

Page 69: Excel Project 5 Creating, Sorting, and Querying a List

69

Summary

• Use the Toggle Total Row in a list

• Print a list

• Use a data form to display, add, and delete records and change field values in a list

• Sort a list on one field or multiple fields

• Display automatic subtotals

Page 70: Excel Project 5 Creating, Sorting, and Querying a List

70

Summary

• Use Group and Outline features to hide and unhide data

• Query a list

• Apply database functions, the SUMIF function, and the COUNTIF function to generate information from a list

• Save a workbook in different file formats

Page 71: Excel Project 5 Creating, Sorting, and Querying a List

Excel Project 5 Complete