• A "spreadsheet" is common way of organizing data on a computer
• Everyone should be able to do basic things spreadsheets
• "paradigm" .. fancy word, but it applies here
• Numbers and formulas on paper is one paradigm
• Numbers in computer code is another paradigm
• Spreadsheet is about organizing your data within a paradigm of rows and columns
• This paradigm supports common math without requiring programming .. a truly world changing invention
• History: Visicalc, then Lotus, then Excel

Note about getting software: Google docs has a free spreadsheet in the browser, and now Microsoft has a free browser one too with skydive. There's also the free application you can install LibreOffoce. Any of these will work for our spreadsheets. With this competition, few people need to buy Office any more.

## Monster Example

Monster example in google docs (File > Copy to edit). Here it is in completed form

## 1. Spreadsheet Cells and Naming

• Spreadsheet is a rectangle of individual cells
• Each cell can contain number, date, text, .. whatever
• Addressing: columns are named: A, B, C, D, ...
• Addressing: rows are numbered: 1, 2, 3, 4, 5, ...
• So one cell can be identified like: B3, C12, A1, ..

Experiment: click on a cell, note its "address" B1 or whatever, type in a word or number

## 2. Columns of Numbers

• Very common to have a few columns of numbers
• e.g. the Red Castle and Blue Castle numbers here
• These are just raw numbers without computation

## 3. Add Computation: sum()

• Suppose you want to know the total number of monsters in the blue castle
• Click on the B8 cell, a couple rows below the last blue castle number
• Type in the following "formula" (with the equal sign): =sum(B1:B6)
• The equal sign = at the start means this cell is computed from other cells
• The sum() adds up all the numbers in a range of cells
• The B1:B6 means the whole vertical group of cells from B1 down through B6 (lowercase letters like b1:b6 work too)
• Type in "Total Count" in the cell to the left (A8) to serve as a label
• Notice: once you type in the =sum(...) in the cell, it is replaced with the computed sum number (28 in this case)
• Notice: when you change a number up above, the sum is automatically updated
• Notice: the cell just shows 28, but if you click it, you can see the full formula
• Using =sum() to add up a bunch of numbers is probably the single most common use of spreadsheets
• From today's headlines: Reinhart and Rogoff economics paper supporting austerity had a significant spreadsheet bug .. essentially they wrote something like sum(a1:a8) when they intended (a1:a11), so they left out some numbers. It sure seems like austerity is not a great strategy for getting out of a recession. Note when you double-click a cell, it shows you what it depends on to help avoid this sort of thing.

## 4. Add Computation: + - * /

• Suppose every monster pays \$120 per night and we want to compute the \$ income per night, i.e. count*120
• We can write an arithmetic formula like =B1 * B2 in a cell to compute a number based on the values of other cells
• Click the B9 cell just below the sum
• Type in the formula (with the equal sign): =B8 * 100
• Probably the easiest way to edit an existing formula such as in B8 and B9 is double clicking the cell
• Trick: while typing in the formula, instead of typing "B8", just click the cell you mean
• Type in "Total \$/night" as a label to the left
• This is similar to the earlier sum() computation, but with basic + - * / type arithmetic

## 5. Extreme Magic: Fill Right

• Once you have the B8 and B9 formulas working the way you want, how to replicate them for the Red Castle?
• Easy!
• Click on B8 and drag right to highlight C8
• Type ctrl-R, the Fill Right command .. this is extreme magic
• Fill Right duplicates the formula over to the right
• The formulas are all spatially relative, so when copied to the right, they work on the Red Castle data
• Notice: click on the C8 sum. Notice that it refers to C1:C8 but the original referred to B1:B8
• The Fill Right operation copies over the sum() part, but updates the cell references to refer to the new column (changing B to C basically). Complex to explain, but actually the most intuitive way for the sheet to work.
• Do Fill Right for the Total \$/night formula as well

## 6. Chart Magic

• Finally we'll add a chart
• Click on A1 (the upper left of the data) and drag down to the lower right of the data (C6)
• Don't include the totals, just the raw numbers at the top
• Select Insert Chart
• You can keep all the chart defaults, or maybe add a title, try bar vs. line, resize it a bit
• Position the chart below all the numbers
• Notice that changing a number updates the chart (google docs does a little animation)
• As you can see .. making pretty charts with your data is pretty easy

Here's a picture of it in done form:

## 2. Radiation Example

• Geiger counter, counts ionizing radiation flashes, makes a "click" sound
• There's a little radiation everywhere all the time .. don't worry about it
• radiation-example.xlsx Spreadsheet shows counts every 60 seconds in my office
• Here it is in google docs:radiation-example.xlsx (make a copy to edit)
• 1. Use sum() to total up the counts
• 2. Compute the average counts-per-minute across the whole data set
• 3. Create a line graph of the raw data