Introduction to Computers Using Ubuntu
Spreadsheets

empty-sheet.png

LibreOffice has a spreadsheet tool called Calc. Why would you want to use it?

Spreadsheets do two things really well.

This section of the guide will show some basic examples of what you can do with Calc and give you a look at some fundamental spreadsheet concepts.

Start the Calc program so you can follow along with the guide and begin your exploration of this tool.

sheet-icon.png

There's a lot to see, but let's start with the most basic thing. The screen is subdivided by lines that are labelled with letters across the top and numbers down the side. Each little rectangle is called a cell. You can move around by clicking in any cell as the next two images show. The program opens with the top-left cell highlighted and then I clicked another cell.

spreadsheet cell A1    spreadsheet cell B4

Each cell is identified by the column letter and the row number. That makes the first cell A1 and the second one which I clicked B4, Every other spreadsheet cell has a similar way to identify it. The sheet layout is also sometimes called a table or a grid.

Cell Contents:
There are three fundamental kinds of information which can go into a spreadsheet cell. Cells with text/label do not calculate in basic ways.

Let's look at three very basic examples.

Do not do the answer by hand! (even if you put in the "right" answer)

add-wrong.png

Instead, create the addition by making reference to the cells containing the numbers we want to add.

add-correct.png

When you complete the entry by tapping the Enter key (or tab key or any arrow key) the correct sum will appear (9).

add-complete.png

Please notice that the completed cell has both the calculated answer (9) AND the formula which does the calculation (which shows in the edit box above). It's two "layers" of information in that cell.

Now use the arrow keys to move to either cell B1 or cell C2. Put in another number; replace the one that's there.
As soon as you enter that value, the contents of cell D1 will recalulate, updating to the new sum.

The important point
cells with formulas use references to calculate from other cells. The "answer" cell is "live" and immediately updates to reflect changes.

The use of the plus character and the minus/hyphen are familiar from our elementary arithmetic classes, but other calculations are not that obvious.

+ - use this "operator" to do addition.

- - use this operator to do subtraction.

* - use this operator to do multiplication, not an X.

/ - use this operator to do division. ÷ is not available on the keyboard.

Practice:
Fill in row two for a subtraction example.
Fill in row three for a multiplication example.
Fill in row four for a division example.

calculator.png

You can put words or numbers into any cell. Commonly the words are used as labels and the numbers are the data. Words and numbers are treated differently in spreadsheets. You can do calculations with the numbers, but routine calculations are not really done with the words, which might not be much of a surprise to you.

Lets take a look at the a small grid of data. This illustration shows "labels" and "values" which are two of the three most common kinds of information held in cells.

spreadsheet grid

The bottom of column B shows two values which are not the same as the others above. The final two values in the column are calculated values. They depend on the values entered above. The numbers 10, 20, 30 and 40 were entered directly into the cells. But, the numbers at the bottom were not entered by typing them directly. Instead, I entered a formula. The first formula takes the values from cells B2 through B5 and calculates a total which is also called a "sum." The formula looks like this: =SUM(B2:B5) (of course, "Total" is another name for "sum" so thats OK as a label.)

Don't overlook the beginning equal sign. That's a critical thing. If you leave it out, you are just typing a label. SUM(B2:B5) is just a label as far as Calc can tell. It is your job to be sure that the program "sees" the formula.

You can also see the formula shown in the "edit" space. That's the best place to work if you need to edit a complex formula.

spreadsheet formula - sum.png

Each formula is built much the same way, beginning with the equal sign and then a function name with parentheses around the cells to be used. The total did not need to list each cell. The designers/programmers of Calc use a colon to mean "through" so our formula was a reference to cells beginning with cell B2 and extending "through" B5.

A key term in the preceding sentence was "reference." It is important to understand that the forumula calculates the answer with the contents of the four cells B2, B3, B4 and B5. The numbers inside those cells can be changed and the formula will get evaluated right away with the new numbers. It isn't the hard-coded values entered into the formula. The formula did not say =SUM(10,20,30,40) even though that would be a valid formula. The problem with that formula is that it does not make sense within a spreadsheet. By using the exact numbers in the formula, you break the point of a spreadsheet. The strength of a spreadsheet is the ability to set a formula in place and then work with it over and over with many different sets of numbers.

As a matter of fact, prove it to yourself. If you have not done so, enter all the information in the cells we have discussed so far. Do a careful job with the formula in cell B6. Make sure it is =SUM(B2:B5) and then check that the total is 100. Right after that, change one or more of the numbers in the column so you are asking the formula to give you a total for new numbers. Check your answer if necessary. Spreadsheets are good with number calculations. You should feel comfortable trusting them to do a good job.

Let's take a quick look at another common formula. =AVERAGE(B2:B5) Once again, the answer of 25 shows in cell B7 even though I didn't type 25 there. I typed the formula for the average of cells B2 through B5. The spreadsheet evaluates the formula as a value for us to see. At the same time, you can look in the edit space and see what formula produced the value.

average formula

You probably noticed that the formulas are in caps, as are the cell references. In fact, I typed the formulas with lower case letters. LibreOffice converted them automatically for a consistent look, not because the case of the letters is significant.

OK. There are the fundamentals. Cells contain either labels or values or formulas. Formulas complete calculations on the contents of the cells which contain values.

There is a LOT more to learn.

You should feel empowered to explore building your own data grids with your own labels and values at this point. This guide has not told you all the different kinds of calculation that are possible. They go way beyond sums and averages. If you choose an empty cell and then click the button for the formula wizard, you can begin to examine the available calculation formulas. You may be more comfortable if you limit the list to a category you know about. The wizard will help you construct the formula properly. If you click on the wizard button, and you are in a cell with a current formula, you will see an explanation of the formula.

function wizard

function-wizard.png

If your focused cell is empty, clicking the wizard button will show you a list of available functions/formulas. It is a very extensive list, so you'll need to scroll down to find what's there.

function-wizard-list.png

© 2013- Algot Runeman - Shared using the Creative Commons Attribution license.
Source to cite: - filedate: