
Computer Science АС (ГСФ) / CS Work at lab classes / 5 Intro Excel - Formatting
.doc
Microsoft Excel - Lists
-
In cell A1, type the title for your spreadsheet: Top 20
-
In cell A2, type: VH1
-
In cell A3, type these dates: 12/14/08-12/21/08
-
Starting in cell A5, enter this data into your spreadsheet:
-
Position
Artist
Title
1
David Archuleta
Crush
2
David Cook
Light On
3
Britney Spears
Womanizer
4
AlterBridge
Watch Over You
5
Beyonce
Single Ladies
6
Kid Rock
Roll On
7
Jennifer Hudson
Spotlight
8
Safetysuit
Someone Like You
9
Lifehouse
Broken
10
Katy Perry
Hot n Cold
11
The All-American Rejects
Gives You Hell
12
Beyonce
If I Were a Boy
13
Coldplay
Lovers In Japan
14
Eric Hutchinson
Rock & Roll
15
Rihanna
Rehab
16
O.A.R.
Shattered
17
The Killers
Human
18
Missy Higgins
Where I Stood
19
Fall Out Boy
I Don’t Care
20
Pink
Sober
-
Format the list in any way that you want.
-
H
ighlight your chart from A5 to C25. From the Datatab, select Sort. The 'Sort' window will appear.
-
M
ake sure that the box that says “My Data has Headers” is selected at the top right of the Sort window
-
Click on the down arrow in the 'Sort By' box. A list of your column titles will appear. Choose Artist.
-
Click on “Add Level”, when the Then By box appears, click on the down arrow and choose Title.
-
Click OK.
-
The list should be sorted alphabetically by artist and then by song title.
-
Click the Undo button
(Found in top left corner)
We can filter lists so that only certain information is displayed.
-
Click on any cell in your chart below Row 5.
-
In the Data tab, click Filter.
-
A
rrows should appear next to each column heading.
-
C
lick the down arrow to the right of the Artist heading.
-
Select onlyBeyonce, by unchecking the box next to “select all” and checking the box next to Beyonce
-
You should only see two songs in your list ("Single Ladies" and "If I Were a Boy").
-
Click on the down arrow to the right of Artist again.
-
Choose (Select All).
-
Your list should look complete again.
Imagine we want to filter the list to see the Top 10 songs for the week.
-
Click the down arrow next to Position, select Number Filters and Top 10.
1 2 3
-
Choose (Top 10…). You should see a dialog box come up.
-
Click OK.
-
The songs 11 through 20 will be displayed because these are the highest numbers. This isn’t the Top 10 we want!
-
Click on the down arrow by Position, and then click on the box next to Select All
-
Click OK. Your list should look complete again.
-
Again click on the down arrow next to Position.
-
C
lick on Numbers Filter and then select Top 10
-
This time, in the dialog box, use the down arrow and change Top to Bottom.
-
Click OK.
-
The list should show songs 1 through 10 now.
-
Save your work as Exercise 7.
Exercise-Advanced Functions
Imagine you have been asked to create a spreadsheet for Mr. Blogg, a teacher, so he can keep track of his students and their grades.
-
Type “Joe Blogg’s High School Class” in cell A1.
-
Type “2009 Student Grades” in cell A2.
-
Enter this raw data as follows:
Student |
Term 1 |
Term 2 |
Term 3 |
Term 4 |
Jean Peterson |
15 |
12 |
14 |
17 |
John Archer |
18 |
14 |
17 |
16 |
James Smith |
23 |
22 |
19 |
21 |
Chris Pearson |
8 |
11 |
7 |
6 |
Jeff Sinclair |
19 |
19 |
18 |
14 |
Kathryn Jackson |
13 |
12 |
10 |
12 |
Ben Coleman |
16 |
22 |
20 |
19 |
John Sheridan |
22 |
20 |
24 |
21 |
Lisa Alexander |
23 |
21 |
28 |
21 |
-
Format the chart however you wish. If you want to, you can use the Autoformat option.
-
In cell A14, type AVERAGE.
-
In cell F3, type YEAR TOTAL.
-
Complete the addition for each student’s yearly total.
-
Click in cell B14.
-
Type =AVERAGE(B4:B12). Make sure all the Term 1 grades are highlighted.
-
Press Enter. You should get the answer. 17.44444.
-
Calculate the average for Terms 2, 3, 4 and the Year Totals as well.
Using an If Function
An If function selects from two different possibilities based on criteria that you supply. In this grades example, we will create an If function that determines if each student is passing or failing. A student will pass if their total grade is at or over 50, and will fail if their grade is below 50.
-
Click in cell G3 and type Pass/Fail.
-
Click in cell G4.
-
Enter the following: =If(
-
Type: F4>=50
-
This asks if F4 is greater than or equal to 50.
-
-
Type a comma.
-
Commas separate functions into sections.
-
-
Type“Pass” in quotation marks.
-
This specifies that if the first section is true (F4 is greater than or equal to 50), the textPass will be displayed.
-
-
Type a comma.
-
Type “Fail” in quotation marks.
-
This specifies that if the first section is false (F4 is less than 50), the text Fail will be displayed.
-
-
Type a closing parenthesis.
-
The equation should look like this:=If(F4>=50,”Pass”,”Fail”)
-
Press Enter.
-
You can use the fill handle to calculate all of the If functions.
-
If you see a mistake, look in the formula bar and make any corrections.
Using a LookUp Function
Lookup functions allow Excel to choose from several different options in a table. We will use a lookup function to determine each student’s letter grade.
-
Complete this table in cells G17 to H21.
-
0
F
35
D
50
C
65
B
80
A
-
Click in cell H3 and type Grade.
-
Click in cell H4.
-
Enter the following =VLOOKUP(
-
The V stands for Vertical. You can also do a horizontal lookup depending on the type of table you create.
-
-
Type F4 (the cell with Jean Peterson’s yearly total)
-
Type a comma to end the first section.
-
Highlight cells G17 to H21 (the grades table)
-
Press the F4 function key at the top of your keyboard. K4:L8 will change to look like $K$4:$L$8.
-
This is called absolute referencing. Excel usually uses relative referencing. When you used the fill handle to complete all of the If functions earlier, the cells the formula referred to changed to fit each new location.
-
For this formula, we always want to refer to cells K4:L8, even when we calculate grades for a different student.
-
The first section where you typed F4 is not absolute, it is still relative. That is because we DO want the first section (the yearly total) to change as we calculate grades for DIFFERENT students.
-
-
Type another comma and then the number 2.
-
The number 2 refers to the fact that the grades table (K4:L8) is a two-column table and the answers we want are in the second column (the letter grades).
-
-
Type another comma and then the word TRUE.
-
Typing the word TRUE tells Excel that if an exact match for a number can’t be found in your grades table, to find the closest match instead.
-
The complete formula should look like:
-
=VLOOKUP(F4,$K$4:$L$8,2,TRUE)
-
-
Press Enter.
-
Use the fill handle to find the letter grades of each student.
-
Your students should have 3 A’s, 3 B’s, 1 C, 1 D and 1 F.
-
If it doesn’t seem right, check your equation in the formula bar and make corrections if necessary.