2. How this works
This PowerPoint presentation provides the instructions for an auto-grading Excel spreadsheet
requiring you to complete several tasks. The spreadsheet is a separate companion file you
should open and complete while you are viewing this slideshow. When you’ve successfully
finished the spreadsheet you’ll be given a secret code that contains your name and score,
which you’ll submit to your instructor to receive a grade.
The companion spreadsheet file is an Excel 2007/2010 macro-enabled spreadsheet file. The
file may or may not work with earlier versions of Excel (e.g., 2003)—so use these at your own
risk. Note that you must agree to enable macros in order to run the spreadsheet (you will be
prompted when you first try to run it). If you do not agree to run macros, or your computer for
some reason prevents them from running, you will not be able to complete this activity. The
spreadsheet file will not work on Apple computers or iPads.
In order to receive any credit for this activity you must complete the preliminary tasks in order,
must complete each one perfectly, and must complete all of them. The spreadsheet helps you
succeed by giving feedback on wrong answers. Once you have completed the preliminary tasks
you will be presented with one final task and given the opportunity to submit your grade to the
code generator. You can submit your grade at any time during the final task, but of course you’ll
probably want to wait until you’ve completed it perfectly and earned 100%.
2
3. Getting started
After completing this module you should be able
to:
Benton County •Open, manipulate, and save an Excel file
•Know how to use cell addresses in Excel
•Understand the difference between text,
numbers, and formulas in Excel cells
•Use some simple Excel functions.
You should also know
where Oregon is!
3
4. Overview: why use spreadsheets?
Geology, like other sciences, is a quantitative subject requiring some quantitative literacy.
Numbers are necessary to express sizes, distances, lengths of times, rates of processes, and
many other quantities. To learn geology, you must work with numbers. To some extent, you
must think with numbers. In your Hazards of the Earth’s Surface course, some of your working
and thinking with numbers will be done with spreadsheets.
Spreadsheets provide a convenient way to organize numbers and perform elementary
calculations. You many not have had an opportunity to use and make spreadsheets before, or
the time to learn how, so we are providing this module as a tutorial to introduce some of the
basic Excel skills for the spreadsheet activities that will be used in this course.
Once you get the hang of spreadsheets, and how to calculate with them, you will find yourself
using spreadsheets as your calculator of choice in other activities for this course, in others
courses, and outside the University.
4
5. How the spreadsheet modules work
Each of the spreadsheet modules you will do in this class has the same look and feel as this
one. This consistency will help you know exactly what to do.
Blue boxes contain the content of the module. They give you the relevant background and
explain how to perform tasks.
Supplementary, often important material will be shown in a red box like this one. Pay attention,
because the red boxes often contain important Excel tips that will make your job easier.
Actual instructions are given in green boxes, like this one. When you see a green box you know
you will have to do something that is part of your assignment.
All PowerPoint module files, like this one, have a companion Excel spreadsheet file where you
will do calculations. So here’s your first preliminary task: open the companion spreadsheet file
so you can work on it while you view this slideshow. The slideshow and spreadsheet are
designed to be viewed simultaneously.
Your second preliminary task: save the spreadsheet file you just opened under a unique name
(e.g., “Joe_Smith-Unit-1”) so you have a record of it. Remember, you will have to agree to allow
macros.
This module includes three tasks. The first two are required, and you must do them in order,
and complete them perfectly, in order to get access to the last one. So let’s get started!
5
6. The setting – Benton County, Oregon
Benton County is located in western Oregon, close to a large earthquake-generating area called the
Cascadia Subduction Zone. This zone is capable of producing gigantic earthquakes (perhaps akin to
the 2004 Sumatra earthquake that produced the tsunami that killed 220,000 people), and poses the
greatest risk to Benton County. Large earthquakes pose several kinds of risks:
•They can topple buildings directly;
•They can induce landslides;
•They can literally turn sediment into quicksand, causing overlying structures to collapse
From the USGS
All photos from the Oregon State archives website
6
7. Geology of Benton County
Benton County
contains many different
rocks and sediment.
This is important
because, as you will
learn later, earthquake
waves can be amplified
when they pass
through certain kinds of
sediments, and can
sometimes even
induce ‘liquefaction’—
the process of turning
sediment into
quicksand!
On a geologic map, different
kinds of rocks and sediments
are noted with different colors.
The important thing to note on
this map is the distribution of
sediment (as opposed to hard
rock), which is called variously
“alluvium” or “deposits”.
7
8. Topography of Benton County
As seen in this Google Earth view, the
western part of Benton County is rugged
and largely unpopulated, while the
lower, flatter eastern part contains most
of the development.
Topography matters because steeper
slopes are more prone to landslides.
8
9. Statement of the Problem
Benton County lies near the Cascadia Subduction Zone, which produces frequent earthquakes,
and is capable of producing giant earthquakes. Benton County officials make decisions that are
affected by this risk—for example, they create zoning laws which restrict activities in certain
locations.
Your task: calculate the annual risk produced by a giant
earthquake (magnitude M ≈ 9.0) for Benton County in terms of
both (a) fatalities; and (b) monetary losses, in dollars.
This is the first of two modules that will calculate the risk. This module will introduce you to Excel and
explain some of the tools you’ll use to do calculations. In the next module you’ll actually compute the
risk.
9
10. An introduction to Excel: spreadsheet components
When you first open Excel, you are presented with a grid of boxes. This is the spreadsheet on
which you will enter data. The file itself is called a workbook and is composed of several
spreadsheets which can be accessed by clicking on the tabs at the bottom of the spreadsheet.
You may add, delete, or change the name of tabs by right-clicking on the tabs themselves.
Above the spreadsheet is the toolbar, and above and below the spreadsheet is a series of
command and formatting buttons. Many of these are identical to those used in Microsoft Word.
Taking time to familiarize yourself with these first will make using them much easier later.
Toolbar and buttons
Spreadsheet tabs
10
11. Spreadsheet components, con’t.
Each box in the spreadsheet is called a cell, and each cell has its own unique alphanumeric cell
reference. The cell reference begins with a letter, indicating the column in which the cell is found.
The cell reference ends with a number, indicating its row. When you select a cell by clicking on it, the
column and row to which it belongs will automatically be highlighted, making it easier to identify its
cell reference. A field at the bottom-left of the toolbar also indicates the cell reference.
Cells are discrete units that can be loaded with text, numbers, or formulas. This tutorial will show you
the various ways cells can be used.
Cell reference (A1)
Cell
11
12. Spreadsheet components, con’t.
Another key component of the spreadsheet is the function bar. Here is where you can enter a label
(text), number, or cell formula (cell equation) into the highlighted cell (click on the cell to highlight it;
the address of the cell is in the box to the left of the function bar). You may also type the label,
number, or cell formula into the cell itself by selecting it and typing in what you want. If you enter a
cell formula into a cell and it is correctly formatted, what you type will disappear and be replaced with
the formula’s solution (a number); if it is not correctly formatted, the cell will show an error message.
In either case, click on the cell and you can view the cell formula in the function bar.
Function bar
12
14. An introduction to Excel: formulas
Entering a label or a number is straightforward. Simply
type what you want. What you type is what you get.
Entering a formula is only slightly more complicated.
The Big Thing is to remember to start with the equals
symbol (=). Again, what you type is what you get. If
you type and enter
=(2*6)+3
Excel will tell you what you get when you multiply 2
times 6 and then add 3, which is what the operation
symbols in the formula say. In these activities, we will
always use orange to indicate
But if you omit the equals symbol, Excel will think you
a cell with a formula.
mean text and display (2*6)+3.
Excel uses the five standard number
In our example of =(2*6)+3, the parentheses are
operations. Using the numbers 6 and 2, what
unnecessary because multiplication takes precedence
numbers should be produced for each of the
over addition (Excel multiplies before it adds). Go to
following five cell formulas?
any blank cell and enter =2*6+3 without the parentheses
and check that you get the same result. For addition, =6+2
For subtraction, =6-2
Sometimes the parentheses are very necessary. What For multiplication, =6*2
do you get when you type the following? For division, =6/2
=2+6*3 For exponentiation, =6^2
=(2+6)*3 Check your answers with Excel
Excel uses the rules for order of operations.
14
15. Task #1: Using formulas in Excel
Your first task is to complete the table on
rows 5 – 13 of your spreadsheet. This
table summarizes the distribution of In these
structures in Benton County based on activities, we
their use. Your ultimate goal is to compute will always
the percentage of each class of structure, use yellow to
indicate a cell
but to do this you’ll first need to compute
with a
the sum of all structures into Cell C13. number.
You can find the sum by typing in a
formula that adds the numbers and places We will always use orange to
indicate a cell with a formula.
the result in cell C13 (look in the function
These should always start with
bar). =
But why do it that way? Use cell addresses instead
of numbers! What do you get when you enter :
The lesson? You should always use
= C6 + C7 + C8 + C9 + C10 + C11 + C12 cell addresses in formulas when you
into Cell C13 or the function bar? can! That way, if you make a change
in one number you don’t have to
Oops! Suppose we miscounted schools. . . there are change the formula. (Now go and
actually 200. What happens to the total if we just change 200 back to 198!)
change 198 to 200?
15
16. Task #1, con’t.
It is an immense convenience to use cell addresses. Let’s take another example. Look what
happens when we use them to calculate the percentage of each type of structure.
This column has already been created for you on your
embedded spreadsheet, and labeled %. Note that Cell D6 is
highlighted. The number shown in the cell is the percentage
of buildings that are happened?!? got that number by
Yikes! What residential. We
typing inWhy formula shownhave function bar, =C6/C13.
the do all the cells in the
errors (Excel’s way of telling
We could now go and error in to use
you there’s an type is formulas for all the other cells
in column C; e.g., =C7/C13 for cell D7, etc. But in Excel
the # symbol)
there’s an easier way: we can copy the formula!
There are a couple of ways to copy a formula. Here is one of them: Select the cell containing
the formula you wish to copy. Click the small black box in the lower-right corner of the
highlighted cell (your cursor should turn into a thin black cross when you’ve in the right spot)….
…. and drag down until the box extends to the desired row. When you release the mouse
button, your formula will be copied into the selected cells.
To understand what went wrong, highlight any of the cells with errors and study the formula in
the function bar. What’s wrong with the formula?
16
17. Task #1, con’t.
The solution in Excel is to use an absolute cell
address, which is indicated by dollar signs ($)
before the column and row identifier; e.g., $C$13
This error highlights one of the key properties of Excel cell
references: by default they’re relative.
For example, you may have thought that the formula =C6/
C13 meant, “divide the contents of cell C6 by the contents
of C13 . . . But that’s wrong! What it actually means is,
“Divide the contents of the cell one column over
by the contents of the cell one column over and seven
rows down, and then put the result into
this cell”
Repair yourformula inin Cell D6
Check the formula this
But that’s not what you wanted! When you wrote C13 you cell. Doesn’t it instruct
then copy it down to cells D7
meant C13—always C13! In fact, what you wanted to tell throughto do exactly what’s
Excel D12. Is it better now?
Excel to do is: written on the left?
See Endnote 1 for other ways to
“Divide the contents of the cell one column over by the copy and paste.
contents of cell C13, and put the result here”
17
18. Task #1, con’t.
Then click on one of the format
styles. In this case we click on ’%’
To change the
formatting of a block
of cells, first select
them using the mouse
You can adjust the number
of decimal places by clicking
on either of these butons
You may have been wondering how Excel knew to express the contents of column D as
percents. After all, we just told it to divide whatever’s in column C by the contents in C13, which
could have been expressed as a fraction; i.e., 0.91.
In Excel, percentage is a formatting option. (You should know that percentage is a fraction, with
denominator equal to 100.)
18
19. Task #1, con’t.
A function is one of the most important concepts in
quantitative literacy. The quantitative literacy book
Understanding our Quantitative World 1 starts with
functions in its chapter 1. That book defines a function as
a “rule” that, for each valid input, assigns one and only
one output.
In math classes, you have probably seen functions written
in terms of x’s and y’s. For example, consider
y = x / 20992
Here, x is the input variable, and y is the output variable.
Now consider what’s written in
You obtain a value of y by dividing the value of x by
the function bar. Instead of
20992. That’s the rule that defines this function.
writing y and x for the output
and input variables, Excel writes
More succinctly, you can say y is a function of x, which
C6 and C13, respectively. The
you can write as y = f(x). The rule for this example then is
rule connecting them is
given by
C6 = B6/20992
f(x) = x / 20992.
Or, since 20992 represents the
Janet Anderson and Todd Swanson, 2005, Mathematics Association of America.
1 contents of cell C13, we can
write the function as
C6 = C6/$C$13
19
20. Task #1, con’t.
Your formula is a function!
In addition to functions that you can create such as f(x)
= C3/C13, you can use many functions that Excel has
built in. One of these is the function that totals a range
of numbers.
In Excel, a range of numbers is indicated with a colon
(:) between two cell references. For example, the range
of numbers that represents the number of structures of
different type is C6:C12 (outlined in red).
The function that calculates the sum of numbers in a
range is called—unsurprisingly—the SUM function. For
example, we could have used the SUM function in cell This is how you use the SUM
C13 instead of having to enter all the numbers above function: =SUM(C6:C12).
into a long formula. You should always use the sum
function when you’re adding more than 2 or 3 numbers. Use the SUM function to check
that the percents you calculated
in column D sum to 100%.
20
21. How the auto-graded spreadsheets work
A key feature of these modules is that they are automatically graded; you will earn points by
doing things correctly, and only then will the next problem be revealed. The program is also
designed to give you help and hints if needed, and of course you are also encouraged to
consult with your TA or instructor if you’re lost.
Here’s the first task, partially completed.
Oops! It’s not quite right.
At any time you can check to see how well
Napoleon forgot to fill in Cell D13
you’ve done by clicking on the blue button.
and cells D6-D12 lack absolute
cell references. Remember
them? (See Slide 17).
This example makes an important point: not only do
you have to get all your numbers correct, but you have
to get them correct in the correct way! So what’s in the
cell equation is as important as the result.
Pressing <ctrl>-a will bring up a short help screen
which hopefully will tell you how to fix the mistake.
21
22. How the auto-graded spreadsheets work, con’t.
When you’ve completed Task #1 perfectly, pushing the Blue Button
will bring happy news . . . first a congratulatory message box:
40
. . . and then 40 well-earned points, plus
the opportunity to start on Task #2,
which has been revealed in rows 15-18
22
23. Task #2, More about built-in functions
The next two slides will explain more about functions,
which you need to use to complete Task #2.
Numerous other functions apply to fields of data. This
spreadsheet (which is not yours) shows four of them:
=AVERAGE(B3:B9)
=MAX(B3:B9)
=MIN(B3:B9)
=COUNT(B3:B9)
You can also write formulas that do
arithmetic with built-in functions.
For example, can you recognize what
other function this formula mimics? If you’re not sure how to
=SUM(B3:B9)/COUNT(B3:B9) use a function, select the
cell with the function and
then click on the Function
. . . and a window will appear telling you what the function button (fx) to the left of the
does and what kind of arguments it takes. function bar . . .
23
24. Task #2, con’t.
5
If you just want to explore the various functions
available, click on the Function button (fx) while
selecting a blank cell . . .
Click to select blank
cell, then click fx
… and a window will appear that allows What does the function PRODUCT() do?
you to search for a function, select Hint: this is a ‘Math & Trig” function; you
functions from a category, and shows you need to choose this category
how you how to format its formula.
24
25. Task #2, con’t.
So here’s what you have to do for Task #2: enter the
correct formulas into cells C15-C18 to compute the
average, maximum, minimum, and count of the
building classes in cells C6-C12. If you understood
the last few slides this should be very easy!
Once again, click on the Blue Button to check your
work. If you’ve done it all correctly you’ll earn another
20 points and move onto Task 3, the final task.
25
26. Final Task
The final task is a little different than the preliminary tasks.
•First, you don’t have to do it, though this will obviously hurt your final score.
•Second, partial credit is awarded, and reflected in the Total Score box. So every time you click
on the Blue Box to check your work your score is reevaluated and displayed. Just like always,
the spreadsheet will give you feedback on incorrect answers, and you can (and should!) keep
tinkering with your spreadsheet until it is perfect.
If you do final task perfectly, you’re done—the program will calculate your secret code and
display it for you. The maximum score on the spreadsheets is 100.
Clicking the Blue Box will If you’re satisfied with your score, even though it’s not 100,
check your answers, just just click on the red box to end the module and get your code.
like for the other Tasks. But note that you can only choose this option once—once
you’re done, you will no longer be able to improve your score.
60
When you finish Task #2 correctly, this
final task will be revealed. Hopefully you
can immediately see how to do it, since
it simply requires you to apply what
you’ve learned on the previous tasks.
26
27. Final Task
For example, here’s what Napoleon sees after he bailed with 60 points.
Once you’ve obtained your code, This is his secret code, which he will need to supply to
write it down or, better yet, create a Blackboard when he takes the quiz for this module.
screen-shot of this page and save it The code contains his score (60/100) along with a
on your computer. You will need your bunch of other encrypted information that your
code to get credit for your instructor will decode to conclude, with a sigh, that
spreadsheet work. Napoleon really didn’t put much effort into Module 1.
27
28. Final Task
The structures in Benton County can also be classified on the basis of their construction, as
shown in the table below:
Type Count
Wood 17,050
Steel 457
Concrete 291
Precast concrete 266
Reinforced masonry 389
Unreinforced masonry 290
Mobile homes 2,249
Complete the spreadsheet table that computes the total number of structures, and the
percentage for each construction. Your table should look very similar to the one on Slide 22.
28
29. Endnotes
1. Excel gives you myriad ways to copy and paste. Most people find one they like, and
remember, and use it all the time. Here’s another way to do it.
a. Select the cell you want to copy (position the cursor on it and click);
b. Then right-click and select ‘Copy’;
c. Now position the cursor where you want to copy (which might include selecting a range
of cells); and
d. Right-click and select ‘Paste’
Go back to Slide 17.
29