Excel Project 5

advertisement

Excel Project 5

Creating, Sorting, and Querying a

List

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

2

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

3

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

4

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

5

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

6

Defining a Range as a list

7

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

8

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

9

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

10

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

11

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

12

This is the information for the first record

Daniel, K M 27 06/17/96 IL Outside 3,500,000 3,224,000

13

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

14

Roberts, K F 32 12/15/96 FL Inside

Madhu, D M 38 04/15/97 TX Outside

Wells, A

Nadir, N

F 37 03/19/99 NY

M 42 08/12/99 TX

Inside

Inside

Bright, S

Lopez, P

F 33 02/20/00 CA Outside

M 23 04/19/00 NY Outside

Gilbert, C M 40 07/15/01 TN Inside

Dresden, K M 39 10/22/01 IL Inside

Jablonski, C F 22 12/15/02 FL Outside

Lee, Y F 22 04/15/03 TN Outside

Smith, R M 25 06/17/03 CA Inside

2,525,000

3,975,000

5,235,000

3,325,000

4,555,000

4,800,000

3,675,000

4,623,000

3,125,000

2,175,000

3,312,000

1,853,000

4,115,000

4,015,000

1,963,000

4,354,000

3,873,000

2,555,000

1,856,000

2,150,000

1,550,000

2,150,000

15

Entering Records into a List

Using a Data Form

16

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

17

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

18

Adding New Fields to a List

19

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.

20

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.

21

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.

22

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.

23

Grade Table

% of Quota Grade

0%

60%

F

D

70%

80%

93%

C

B

A

24

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

25

Using the VLOOKUP Function to

Determine Letter Grades

26

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

27

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

28

Using the Toggle Total Row Button

29

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

30

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

31

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

32

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

33

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

34

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

35

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

36

Sorting a List on Multiple Fields Using the

Sort Command on the List Button Menu

37

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.

38

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

39

Displaying Automatic Subtotals in a List

40

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

41

Zooming Out on a Subtotaled List and Using the Outline Feature

42

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

43

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

44

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

45

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

46

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

47

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

48

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

49

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

50

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.

51

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

52

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

53

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

54

Enabling AutoFilter

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

• Click AutoFilter on the Filter submenu

55

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

56

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

57

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

58

Using the DAVERAGE and

DCOUNT Database Functions

59

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

60

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

61

Save the Workbook after printing

62

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

63

Saving a Workbook in CSV File Format

• Click the Select All button, point to the right border of the column A heading, and doubleclick 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

64

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

65

Saving a Workbook in CSV File Format

66

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

67

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

68

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

69

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

70

Excel Project 5 Complete

Download