ICDL Module 4

Spreadsheets using OpenOffice.org Calc

David Varley

ICDL Foundation
IMPORTANT NOTICE
DISCLAIMER
License

2004


Table of Contents

1. Using the Application
First stages with spreadsheets
Open Calc in Linux
Open Calc in Windows
Close Calc
Components of the Calc screen
Create a new spreadsheet (default template)
Save a spreadsheet to a location on a drive in Linux
Save a spreadsheet under another name
Save a spreadsheet in another file type such as: text file, HTML, template, software specific file extension, version number
Switch between worksheets, open spreadsheets
Use available Help functions
Close a spreadsheet
Adjust settings
Page Width
Display, hide built-in toolbars
Freeze, unfreeze row and / or column titles
Modify basic options / preferences in the application user name, default directory / folder to open, save spreadsheets
2. Cells
Insert data
Data types
Entering data
Select cells
Select a row, range of adjacent rows, range of non-adjacent rows
Select a column, range of adjacent columns, range of non-adjacent columns
Rows and columns
Insert a single row
Insert several rows
Insert one or more columns
Delete rows, columns in a worksheet
Modify column widths, row heights
Edit data
Edit existing content of a cell
Replace content of a cell
Use the undo, redo command
Duplicate, Move, Delete
Within a worksheet, between worksheets, between spreadsheets
Duplicate within a worksheet
Duplicate between worksheets
Duplicate between open spreadsheets
Use autofill tool/copy to copy, increment data entries
Move the content of a cell, cell range within a worksheet, between worksheets, between spreadsheets
Delete cell contents
Search and Replace
Use the replace command for specific content in a worksheet
Important Find and replace options
Sort Data
Numeric sorts
Alphabetic sorts
Multiple sort criteria
3. Worksheets
Handling worksheets
Insert a new worksheet
Rename a sheet
Delete a worksheet
Duplicate a worksheet within a spreadsheet, between spreadsheets
Duplicate a worksheet between spreadsheets
Move a worksheet within a spreadsheet, between spreadsheets
4. Formulas and Functions
Arithmetic formulas
Indicating a calculation
Arithmetic operators
Arithmetic using cell references: Automatic recalculation
Recognise and understand error values associated with using formulas
Cell referencing
Relative addressing
Absolute addressing
Mixed addressing
Working with functions
SUM
AVERAGE
MAX and MIN
COUNT
Using functions in a spreadsheet
Generate formulas using logical function IF yielding one of two specific values
5. Formatting
Number, Date
Decimal Places
Format cells to display a date style
Format cells as currency style
Format cells to display numbers as percentages
Contents
Apply formatting to cell contents such as: bold, italic, underline, double underline
Apply different colours to cell content, cell background
Copy the formatting from a cell, cell range to another cell, cell range
Apply text wrapping to contents within a cell
Alignment, Border Effects
Centre a title over a cell range
Adjust cell content orientation
Add border effects to a cell, cell range
6. Charts
Using Charts and Graphs
Creating graphs with more than one data series
Add / Remove a title, label to the chart/graph
Change the background colour in a chart/graph
Change the column, bar, line, pie slice colours in the chart/graph
To change the colours of an existing chart
Change the chart/graph type
Duplicate, move charts/graphs within a worksheet, between open spreadsheets
Resize, delete charts/graphs
7. Prepare Outputs
Worksheet Setup
Change worksheet orientation: portrait, landscape
Adjust page setup to fit worksheet contents on one page, on a specific number of pages
Add, modify text in Headers, Footers in a worksheet
Insert fields: page numbering information, date, time, file name, worksheet name into Headers, Footers
Preparation
Calculations
Text
Preview a worksheet
Turn on, off display of gridlines, display of row and column headings for printing purposes
Apply automatic title row(s) printing on every page of a printed worksheet
Printing

Chapter 1. Using the Application

First stages with spreadsheets

Abstract

Open and close a spreadsheet application

Open Calc in Linux

  1. Click on Start Applications

  2. Click Office

  3. Click Spreadsheets

  4. Click OpenOffice.org Calc

This will load Calc

Open Calc in Windows

  1. Click on Start

  2. Click Programs

  3. Click Open Office.org

  4. Click Spreadsheet

Close Calc

  • Click on File then click Exit.

OR

  • Click on the Exit icon in the top right hand corner of the screen,

Components of the Calc screen

Menu Bar

The menu bar displays global commands. These commands that are grouped according to categories.

For example, the File menu item consists of a set of commands related to file operations such as open existing files, creating new files, saving files, closing files and so on.

Function Bar

The function bar displays the path and name of the current file as well as a series of icons representing commonly used commands.

Object Bar

The object bar contains commands that are used to format cells.

Formula Bar

The formula bar contains the address of the current cell. It is also used as the entry point for text, numbers and formulas that will be entered into the cells.

Toolbar and Work Area

The toolbar down the left hand side provides a quick method of accessing common spreadsheet functions.

The work area of the spreadsheet consists of a grid formed by the intersection of rows and columns. The columns are named by letters of the alphabet A, B, C, ..... Z, AA, AB, AC, ..... The rows are numbered 1,2,3,4, .....

Each cell is identified by its row and column. For example, the cell C11 is the cell lying at the intersection of column C and row 11.

C11 is also referred to as the address of the cell..

Tabs

Each spreadsheet consists of one or more worksheets. These can be accessed by clicking on the tabs at the bottom of the work area.

Open one, several spreadsheets

A spreadsheet consists of text, values and formulas inserted into the cells of the work area. Spreadsheets are saved on disk as files, just as in the case of Writer documents.

More than one spreadsheet can be opened at a time.

Open a spreadsheet under Linux
  1. Click on File.

  2. Click on Open.

    This brings up the Open Dialogue window:

    The dialogue lists a series of directories and files. To view the contents of a directory, click on the directory. To move up a level, click on the Up one level icon, .

    Suppose you have located the directory in which the desired file is located.

  3. Highlight the file.

  4. Click Open.

Open a spreadsheet under Windows

The process of opening files under Windows is essentially the same.

The essential difference between Windows and Linux is that in Linux all computers, disks and directories are all part of a large tree. In the case of Windows, each drive forms the root of a separate root structure.

The current directory is the Open dialogue above is shown as /home/david. The direction of the separators and the absence of a drive indicate that this is a Linux directory.

If you were opening a file in Windows, the Windows Open dialogue would appear:

Open several spreadsheets

If you now repeat this process without closing the first spreadsheet all of them will be loaded and you may switch between them. The process of doing this will be described shortly.

An alternative is to open several spreadsheets at once.

  1. Click on File then Open.

  2. Locate the directory containing the files you wish to open.

  3. Click on the first file.

  4. Hold down the Ctrl key and click on each of the additional files you wish to open.

  5. Click Open.

    The last of the files loaded will appear in the window. This will be the active spreadsheet. The others are also loaded but are in the background.

You can make one of the other spreadsheets active as follows:

  1. Click on Window.

    This will list the spreadsheets that are loaded.

  2. Click on the spreadsheet you wish to make active.

Create a new spreadsheet (default template)

Suppose you wish to create a spreadsheet from scratch.

  • Click on File then click on New then Spreadsheet.

You can do this whether other spreadsheets are loaded or not.

This will display a blank spreadsheet.

You will learn how to enter data later. At this stage we are concerned with the mechanics of opening and saving spreadsheets.

Save a spreadsheet to a location on a drive in Linux

For the time being imagine that the spreadsheet you have opened contains data. At this stage your work is located in the RAM of the computer. Since RAM is volatile, the contents will be lost is the computer is switched off.

In order to preserve your spreadsheet for later use it must be saved on the hard drive of the computer.

To do so:

  1. Click on File, then Save as ...

    This will bring up the Save as dialogue.

  2. Locate the directory in which you wish to save the file.

  3. Enter the name of the file name window.

  4. Click Save.

Saving to a floppy disk in Linux

If you wished to save a file to a floppy disk, you would use the directory /mnt/floppy.

Saving a file in Windows

If you are working with Calc running under Windows, the Windows Save as ... dialogue would appear when you save the file.

  1. Select the drive on which you wish to save the file.

  2. Select the directory on the drive and, if appropriate, the relevant sub-directory.

  3. Enter the name for the file in the File name window.

  4. Click Save.

Saving files to floppy disk in Windows

  1. Select Floppy (A:) in the Save as ... dialogue.

  2. Use the same procedure for saving on the hard disk.

Save a spreadsheet under another name

Sometimes we may want to have the same spreadsheet saved under a number of different names. Alternatively, we may want to save a spreadsheet before making changes. We would then have a copy of the new version as well as the version before changes were made.

Suppose we have a spreadsheet loaded as shown on the next screen. In this case the spreadsheet already has the name demog.sxc.

We can now save what is displayed on the screen in two ways.

Overwrite existing file

After loading the spreadsheet from disk, we may have made some changes. In this case, the changes will not automatically be made to the file that is located on the hard disk.

To replace the version on hard disk with the contents as displayed on the screen:

  • Click on File, then Save.

This updates the file on disk.

Save under another name

Suppose we do not wish to overwrite the contents on disk but would still like to save what is on the screen:

  • Click on File, then Save as ...

This will bring up the Save as dialogue. You use this in exactly the same way as you would if you were saving a completely new file.

Save a spreadsheet in another file type such as: text file, HTML, template, software specific file extension, version number

A spreadsheet is a tool for doing calculations. Consequently, the format of the spreadsheet is structured around this aspect.

Sometimes it is useful to convert the spreadsheet format into another format such as, for example, a text file which can be manipulated using a word processor.

Alternatively, you may wish to save the spreadsheet in a format use by another spreadsheet program such as Microsoft Excel.

To save a spreadsheet in a different format:

  1. Click on File, then Save as ...

  2. Click on the File Type window.

    This will display a list of file types.

  3. Use the vertical scroll bar to view all the file formats.

The following table list some of the main file formats and a brief explanation of each.

File type

Extension

Explanation

OpenOffice.org Spreadsheet

sxc

This is the format of Calc itself.

OpenOffice.org Spreadsheet template

stc

A template is an outline for new templates. This may include text, values and formulas that are automatically inserted when a new template is created using the template. It could also include formatting of cells such as font type and colour.

dBase

dbf

This would save the spreadsheet in a format used by some database programs. These databases would then be able to access the data in the spreadsheet and work with it as if it had been created by a database.

Microsoft Excel

xls

Although Microsoft Excel is also a spreadsheet, it uses a different format. By saving the spreadsheet in the xls format, it could be opened directly by Microsoft Excel.

Web pages

html

In order to read files, web browsers need them to be saved in a special format known as HTML or HyperText Markup Language. Calc is able to save a spreadsheet in this format.

Text CSV

csv

This format is what is also called a comma delimited file. In this format, each row is converted into a paragraph. The columns of the spreadsheet are separated by commas. A word processor will read this file as an ordinary text file.

Data Interchange Format

dif

A DIF file is an industry standard for exchanging data between different types of application.

Portable Document Format

pdf

Pdf files are a common way of sending documents that you do not wish the receiver to be able to edit. These files can be read with Acrobat Reader. Unlike the previous formats which are created using the Save as ... function, pdf files are created using the Export as pdf ... option in the File menu.

On the file menu there is an option called Version which allows you to save different versions of the spreadsheet in the same file. You are asked to give the version a name and this is recorded along with the date and time of the changes that were made. If you want to open another version of a file simply click on File->Version and choose the version you want to open.

Switch between worksheets, open spreadsheets

Switching between open spreadsheets was covered in the section called “Open one, several spreadsheets” above.

To understand the difference between a spreadsheet and a worksheet, think of a spreadsheet as a book. The worksheets correspond to the pages of a book. However, in the case of spreadsheets, many of them comprise a single page or worksheet.

The spreadsheet shown in the following screen is made up of three worksheets. Each of these has a name indicated on the tabs at the bottom of the work area.

  • To switch between the different worksheets, you would click on the tab.

Use available Help functions

Calc provides a range of help features. The most useful of these is Find.

To access help:

  1. Click on Help, then Contents.

  2. Click on the Contents tab.

  3. Double click on the book icon next to Help about OpenOffice.org Calc.

    This lists the main headings in help for Calc. Sections with a book icon contain further subdivisions.

  4. Double click on Shortcut Keys in OpenOffice.org.

  5. Click on the Index tab.

  6. If you type some text such as sum into the Search item window, the index will automatically scroll down to index items beginning with the word sum.

  7. If you were to double click on an item in the left hand pane or click the Display button, help would be displayed in the right hand pane.

Calc also provides a comprehensive search facility.

  1. Click on the Find tab.

  2. Type a key work or part of a key word into the Search item window, for example, sum.

  3. Click the Display button.

    A list of items in the index that make reference to the word sum.

    Once again you could highlight the item you wish to read and click the Display button.

Note that the two check boxes that appear under the Search item window.

The Bookmarks tab takes you to a section which allows you to create references to specific help items that you might wish to refer to at a later time. These named references are called bookmarks.

Close a spreadsheet

  • Click on File.

There are two menu items that need to be distinguished.

Close closes the current spreadsheet, but leaves Calc open. If version of the spreadsheet on the screen differs from that saved on disk, Calc will ask you if you wish to save before closing the spreadsheet.

Exit closes all open spreadsheets as well as the Calc program itself. Once again, if any spreadsheets are open, Calc will ask you if you wish to save them before closing.

It is important that you adopt good habits and close Calc before you start shutting down the system.

Adjust settings

Abstract

Use magnification / zoom tools

Often when working with spreadsheets it is convenient to enlarge or reduce the spreadsheet in the work area.

Suppose the spreadsheet Demog.sxc is loaded.

To change the scale of the spreadsheet:

  1. Click on View, then Zoom.

    This displays the Zoom dialogue.

  2. Click the appropriate radio button to scale the spreadsheet.

    Values less than 100% will reduce the spreadsheet, while values greater than 100% will enlarge it.

  3. Click 150%.

  4. Experiment with the other values in the Zoom dialogue.

Page Width

A useful zoom is Page width. This displays the width of the printed page on the screen. The degree of enlargement or reduction depends on whether the page setup is portrait or landscape. To see the difference follow the instructions below.

Page width in portrait

  1. Click on Format, then Page.

  2. Click the Page tab, then under Orientation click the Portrait radio button.

  3. Click on View, then Zoom.

  4. Click the Page width radio button, then click OK.

Page width in landscape

  1. Click on Format, then Page.

  2. Click the Page tab, then under Orientation click the Landscape radio button.

  3. Click on View, then Zoom.

  4. Click the Page width radio button, then click OK.

Display, hide built-in toolbars

Calc has a number of standard toolbars. Which of these are displayed depends on how your system was et up. You can decide which toolbars you wish to have displayed.

  1. Click on View, then Toolbars.

    A list of toolbars is displayed. The ticked toolbars are visible.

    If you click on a toolbar that is ticked it will be hidden. If you click on an unticked toolbar, it will be displayed.

  2. Click on Function bar.

    The function bar is now hidden. To unhide the function bar:

    1. Click on View, then Toolbars.

    2. Click on Function bar.

An operation such as this is called a toggle. A toggle is a switch which reverses the status. If it is on, the toggle switches it off. If it is off, the toggle switches it on.

A related function is Full screen.

  • Click on View, then Full screen.

To restore the toolbars

  • Click the Full Screen icon in the top left hand corner.

Freeze, unfreeze row and / or column titles

Certain rows and columns are often used as headings. If you scroll down or to the right, these headings will scroll off the screen. To keep headings on the screen will data scrolls off the screen, we can freeze the rows or columns containing our headings.

Consider the spreadsheet shown on the next screen.

Notice the column headings in row 3 and the row headings in column A.

If we were to scroll down and across these headings would disappear off the screen.

We can freeze the headings as follows:

  1. Position the cursor in the cell immediately below the column heading and in the column immediately to the right of the row headings. In this case it is cell B4.

  2. Click on Window, then Freeze.

If we were to scroll down and across, the headings would remain on the screen as shown below.

In this case both rows and columns are frozen.

If you wish to freeze only rows, position the cursor in column A, then Windows->Freeze.

If you wish to freeze only columns, position the cursor in row 1, then Windows->Freeze.

Modify basic options / preferences in the application user name, default directory / folder to open, save spreadsheets

User name and data

The default user data can be set as follows:

  1. Click on Tools, then Options.

  2. Expand OpenOffice.org by clicking on the + symbol.

  3. Click on User Data.

  4. Fill in the user data and Click OK.

[Note]

This user information will be used for all the applications in the OpenOffice.org suite.

Default directory

When opening or saving files, Calc will by default look in a certain directory. This can be set as follows:

  1. Click on Tools, then Options.

  2. Expand OpenOffice.org by clicking on the + symbol.

  3. Click on Paths.

  4. Double click on My Documents.

  5. Locate the desired path using the Select path dialogue.

  6. Click Select.

Default spreadsheet type

The default, Calc saves spreadsheets in Calc format. This will have an sxc extension. You may have to share your work with users who use other spreadsheet programs. In this case you could change the default format to that of another product, for example, Microsoft Excel.

  1. Click on Tools, then Options.

  2. Expand Load/save.

  3. Click on General.

  4. Under Document type, select Spreadsheets.

  5. Under Always save as select the format you wish to use.

  6. Click OK.

Other settings

  1. Click on Tools, then Options.

  2. Expand Spreadsheets.

    A number of other important settings can be set in the different sections. For example:

    General: Use to set measurement units and tab stops.

    View: Use to change the colour of gridlines; whether formulas or values are shown.

  3. Scroll through the different options to get a feel of the range of settings.

Chapter 2. Cells

Insert data

Data types

Data entered into cells can be of three types: numeric, text or date.

If a set of pure digits (0,1,2,3,4,5,6,7,8,9) are typed in a cell, Calc will normally treat the data as numeric. In this case arithmetic operations can be performed on the numbers.

If the ' symbol is typed in front of a set of digits, then Calc will treat the number as if it were ordinary text. In this case you will not be able to do arithmetic. You will however be able to format the numbers in the way you do text.

Text can be entered by clicking on the cell where you want to start at and typing normally. The text will flow over from one cell to the next, but will be contained in the cell where you started typing, eg if you wanted to type in a heading and you clicked on cell A1 and typed, the information may be longer than one cell and would carry on over into the adjacent cells, but if you wanted to edit it later you would have to activate cell A1 to work with it.

If you enter numbers in the format that Calc would recognise as a date, Calc will treat these as a date and reformat the contents of the cell in the default date format. For example, 20 Sept 2003, 20 September 2003 and 20-09-2003 will all be interpreted by Calc as dates. If the default date format is Short date, then Calc will reformat these as 20/09/03 in all cases. If you wish these not to be interpreted as dates, precede the entry with the ' symbol.

If the contents of a cell are interpreted as data, then certain types of date arithmetic can be performed. For example, two dates can be subtracted to yield the number of days between the dates. If a number is added to a date, this is interpreted as a number of days and the result will be another date.

Entering data

Data can be entered into the current cell. As you type, numbers and text will be entered into a cell. At the same time these appear on the Input line of the Formula bar.

When you have completed your data entry, Press Enter to move to the cell below or Tab to move to the cell to the right.

You may also use the direction arrows to move to an adjacent cell.

Changing the direction of Enter

By default, when you Press Enter, the cursor moves to the next cell down. This can be changed using:

Tools->Options->Spreadsheet->Input

[Note]Note on notation

To simplify the text in future, where there is no possibility of ambiguity, the notation:

Tools->Options->Spreadsheet->Input will be used instead of the longer form\:

  1. Click on Tools, then Options.

  2. Expand the Spreadsheets option by clicking on the + symbol

  3. Click on Input

Select cells

Abstract

Select a cell, range of adjacent cells, range of non-adjacent cells, entire worksheet

When a cell or group of cells is selected, actions can be performed on these cells. These operations include deleting the cells, copying them to the clipboard, changing their font and so on.

Select a single cell

  • To select a single cell, simply click of the cell.

Select a range of adjacent cells

  1. Click on the first cell of the range.

  2. Hold down the left mouse button and drag the cursor to the last cell of the range

OR

  • Hold down the Shift key and use the direction arrows to move to the last cell of the range.

OR

  • Hold down the Shift key and click on the last cell of the range.

    The selected cells will be highlighted on the worksheet.

Select a range of non-adjacent cells

  1. Hold down Shift and click on the first cell.

  2. Release the Shift key.

  3. Hold down the Ctrl key and click on each of the cells you wish to select.

    The following screen shows the selection of a number of non-adjacent cells.

Select an entire worksheet

  • Edit->Select All (Click on Edit, then click on Select All – see Note on notation above)

OR

  • Hold down Ctrl and press A.

Select a row, range of adjacent rows, range of non-adjacent rows

Select an entire row

  • Click on the row number.

Select a range of adjacent rows

  1. Click on the row number of the first of the rows.

  2. Hold down the Shift key and click on the row number of the final row.

Select a range of non-adjacent rows

  1. Click the row number of the first row you wish to select.

  2. Hold down the Ctrl key and click on the row numbers of the other rows you wish to select.

Select a column, range of adjacent columns, range of non-adjacent columns

Select an entire column

  • Click on the column letter.

Select a range of adjacent columns

  1. Click on the column letter of the first of the columns.

  2. Hold down the Shift key and click on the column letter of the final column.

Select a range of non-adjacent columns

  1. Click the column letter of the first column you wish to select.

  2. Hold down the Ctrl key and click on the column letters of the other columns you wish to select.

    The following screen illustrates a number of non-adjacent columns selected.

Rows and columns

Abstract

Insert rows, columns in a worksheet

Insert a single row

Suppose we have the file Demog.sxc displayed:

We now wish to insert a row after % Urban with the row heading % High school education.

  1. Position the cursor anywhere in row 8.

  2. Insert->Rows

    [Note]

    Note when you execute this command, the new row is inserted before the current row. Row 8 is now a blank row.

  3. Click on A8 and type the text % High school education.

Insert several rows

Suppose you wished to insert three rows after % Urban.

  1. Select rows 8 to 10.

  2. Insert->Rows

    This will insert three new rows 8 to 10. The previous rows 8 to 10 will be shifted down.

Insert one or more columns

The process of inserting one or more columns is done in a similar way:

  1. Select the columns.

  2. Insert->Columns

Existing columns will be shifted to the right.

Delete rows, columns in a worksheet

  1. Select the rows or columns to be delete. These may be adjacent or not.

  2. Edit->Delete cells

    This will bring up the Delete cells dialogue.

  3. Click on the Delete entire row(s) or Delete entire column(s) radio button as appropriate.

  4. Click OK.

Modify column widths, row heights

Resize column widths using the mouse

  1. Position the cursor on the right hand border on the column letter box.

  2. Hold down the left hand mouse button and drag the border to the left or right.

    As you do the width of the column will be displayed.

[Important]

You can only use the right hand border for adjusting the column width.

Resize rows heights using the mouse

  1. Position the cursor on the lower border of the row number.

  2. Hold down the left hand mouse button and drag the border down or up.

[Important]

You must use the lower border of the cell. If you drag the upper border of a cell, you will change the row height of the cell above. For example, instead of making the lower cell wider, you will make the upper cell narrower.

Resize one or more columns using Format

  1. Select the column(s) whose width you wish to change (or press Ctrl+A to select all the columns).

  2. Format->Column->Width

    This brings up the Format column width dialogue.

  3. Enter a value in the Width window and click OK.

OR

  • Check the Default value check box to select the default column width and Click OK.

Resize one or more rows using Format

  1. Select the row(s) whose height you wish to change (or press Ctrl+A for all the rows).

  2. Format->Row->Height. This brings up the Format row height dialogue.

  3. Check the Default value check box to select the default row height and Click OK.

OR

  • Enter a height into the Height window and click OK.

Edit data

Abstract

Insert additional cell content, replace existing cell content

Edit existing content of a cell

Suppose we click on a cell, for example A8 in the following screen. The contents of cell A8 are also display in the Input line of the Formula bar. If you wish to add text to the existing contents of the cell:

  1. Click at the end of the text in the Input line.

  2. Press Enter, Tab or an arrow key when you are done.

Alternatively, you could edit the contents of the Input line as you would any text. You can insert text or delete text.

Replace content of a cell

  1. Click on the cell whose content you wish to replace.

  2. Type your new content.

When you do this, the existing content of the cell will automatically be replaced by your new entry.

[Note]

The difference between the method for editing existing content and replacing existing content is that to edit the content you click on the input line whereas to replace you do not.

Use the undo, redo command

Suppose you delete a line of text, then immediately realise you have made a mistake. The undo command allows you to go back a step to the point before the previous command. To use this command:

  • Edit->Undo

OR

  • Press Ctrl-Z.

In fact the undo command has a history. If you repeat the command it will undo the second last command. If you repeat it once more it will undo the third last command, and so on.

The redo command reverses the effect of the last undo. To use this command:

  • Edit->Redo

Suppose you had used the undo command three times. In effect you would have undone your previous three command. If you now use the redo, it will re-instate these actions.

The best way of understanding how undo and redo work is to practice using them.

Duplicate, Move, Delete

Abstract

Duplicate the content of a cell, cell range

Within a worksheet, between worksheets, between spreadsheets

The process of duplicating data involves a number of simple steps:

  1. Select the cells to be duplicated.

  2. Copy them to the clipboard. Usually we refer to this simply as copy.

  3. Select the target (where the cells are to be copied to).

  4. Paste the data from the clipboard.

[Warning]

When you paste data, the contents of the target cells will be overwritten.

Duplicate within a worksheet

Suppose you have the following spreadsheet displayed on your screen.

Suppose you now wish to insert another set of headings above Group 11.

  1. Insert a blank row at row 14.

  2. Select cells B3 to K3. (We represent a range of cells such as this with the notation B3:K3)

  3. Copy the selected cells using one of the following methods:

    1. Press Ctrl-C.

    2. Edit->Copy

      Click the Copy icon,

  4. Position the cursor at the start of the target range. (It is not necessary to highlight the entire range.)

  5. Paste the copied cells using one of the following methods:

    1. Press Ctrl-V.

    2. Edit->Paste.

      Click the Paste icon,

Duplicate between worksheets

When you create a new spreadsheet, Calc creates three worksheets by default. You can think of each worksheet as a page of the spreadsheet. Pages can be added to or removed from the spreadsheet very simply. You can move between the worksheets of an open spreadsheet by clicking on the appropriate tab at the bottom of the work area.

Suppose you wish to copy cells A3:K5 from Sheet 1 to B7 on Sheet 3.

  1. Select cells A3:K5

  2. Edit->Copy

  3. Click on the Sheet 3 tab.

  4. Select cell B7.

  5. Edit->Paste

Duplicate between open spreadsheets

It is possible to have several spreadsheets open at the same time. The difference between spreadsheets and worksheets is that the spreadsheets are stored in different files, whereas the worksheets of a particular spreadsheet are all stored in the same file.

You can switch between spreadsheet using the Window menu item.

Suppose you have two spreadsheets open. The first is called ObservationsByGroupSector and the other is called Obs2. You now wish to copy the cells A3:K10 from the first into the second starting at B5.

  1. Click on Window.

  2. Click on ObservationsByGroupSector.sxc

    This will display this spreadsheet.

  3. Select cells A3:K10.

  4. Edit->Copy.

  5. Window->Obs2

  6. Select cell B5.

  7. Edit->Paste.

Use autofill tool/copy to copy, increment data entries

  1. Open a new spreadsheet.

  2. Type 1 in A1 and 2 in A2.

  3. Select A1 and A2.

    A fill handle will appear at the bottom right hand corner of A2.

  4. Drag the highlight across the adjacent cells.

  5. Deselect the cells by clicking elsewhere in the spreadsheet.

    Calc will attempt to complete the series based on the values in the first two cells as shown on the next screen.

  6. Now type 100 in B1 and 101 in B2

  7. Drag the fill handle across the adjacent cells.

    Calc assumes you wish to insert a series of numbers will a common difference between the cells.

  8. Type 5 in C1 and 8 in C2.

  9. Drag the fill handle across the adjacent series.

    In this case the difference between the first two cells is 3. Calc assumes each cell must have a value 3 greater than the previous cell.

  10. Type Jan into D1 and Feb into D2.

  11. Drag the fill handle across adjacent cells.

    Calc now assumes you wish the series to be the names of months.

  12. Type January into E1 and February into E2.

  13. Drag the fill handle across adjacent cells.

    At this point your screen will appear as follows:

You can create your own sort lists as follows:

  1. Tools->Options->Spreadsheets->Sort lists

  2. Click the New button.

  3. Type the entries into the Entries window as shown on the next screen. You will need to Press Enter after each entry.

  4. Click Add when complete.

  5. Type Alpha in A10 and Beta in B10.

  6. Drag the fill handle across adjacent cells.

You can use this method to create your own sort lists.

Move the content of a cell, cell range within a worksheet, between worksheets, between spreadsheets

The procedure for moving the content of cell(s) is exactly the same as that for duplicating the content of cell(s) except that you use the Cut function instead of the copy function.

  1. Select the cell(s) whose content is to be moved

  2. Cut the selected cells using one of the following methods:

    1. Press Ctrl-X.

    2. Edit->Cut

    3. Click the Cut icon,

  3. Position the cursor at the start of the target range. (It is not necessary to highlight the entire range.)

    [Note]

    The target may be in the same worksheet, or a different worksheet within the same spreadsheet or within a different spreadsheet.

  4. Paste the copied cells using one of the following methods:

    1. Press Ctrl-V.

    2. Edit->Paste.

    3. Click the Paste icon,

Delete cell contents

Use the Delete key

  1. Open a spreadsheet.

  2. Select a range of cells.

  3. Press the Delete key.

The effect is as shown on the following screen. As this screen shows the contents of the cell are emptied. No cells are moved in the process.

Use Edit->Delete Cells

  1. Highlight a range of cells.

  2. Edit->Delete Cells

    You are now offered a range of options:

The operation of Edit->Delete cells is quite different to the action of the Delete key. You are offered a number of options as shown on the previous screen. All of these will involve movement of cells to the right and / or below the highlighted cells.

  • Click the Shift cells up radio button and click OK.

    Notice that the cells in C15:G15 have been moved up to C10:G10 as shown on the next screen.

Search and Replace

Abstract

Use the search command for specific content in a worksheet

In practical situations spreadsheets are often quite large and we need quick methods of locating items.

Suppose you have a spreadsheet loaded as shown on the next screen and you wish to locate an item.

  1. Edit->Find and replace

  2. Type the item in the Search for window.

  3. Click Find all to highlight all occurrences of the item.

    The effect of using Find all is shown on the previous screen.

OR

  1. Click Find.

    This will select the first occurrence of the item.

  2. Click Find repeatedly to locate further occurrences.

Use the replace command for specific content in a worksheet

The Find command simply locates occurrences of an item. It does not change these in any way. You may do so manually, if you wish.

The Replace command on the other hand is useful when we wish to change entries.

The Replace command provides us with two methods of replacement.

Replace all replaces all occurrences of the item with the new entry without further prompting.

Replace gives you the option of changing each occurrence or not.

  1. Edit->Find and replace

  2. Type appropriate entries in the Search for window and the Replace with window.

Global replacement

  • Click Replace all.

In this case all occurrences of Andiswa will be replaced by Andisa without any further prompting.

Selective replacement

  1. Click Find to locate the first occurrence.

  2. Click Replace if you wish to replace this item or Click Find to locate the next occurrence.

  3. Repeat this process until you have cycled through all the occurrences.

Important Find and replace options

The check boxes allow you to refine the Find and replace procedures.

Backwards

By default, the Find procedure moves to the right and down the spreadsheet, ie forwards. If you wish to move backwards, check this option.

Match case

By default, the Find procedure ignores the case of text. This is called case insensitive. Where you wish to match the case of text, check this box. The Search is then said to be case sensitive.

Entire cells

By default, the Find procedure looks anywhere in the cell for the search data. The following screen shows the effect of using the default.

If, however, the Entire cells box had been checked, the result of this search would have been the following message:

Sort Data

Abstract

Sort a cell range by one criterion in ascending, descending numeric order, ascending, descending alphabetic order

Sorting a range of cells is a straight forward process involving the following steps:

  1. Highlight the range of cells to be sorted.

  2. Data->Sort

  3. Set the criteria in the Sort dialogue.

  4. Click OK.

[Important]

Select the entire block to be sorted. If columns are omitted, the resulting data could become a meaningless jumble.

Numeric sorts

Suppose we have the following spreadsheet displayed on our screen. We wish to sort the data on this in the order of the points with the lowest at the top. Here we wish to sort according to values, hence this is a numeric sort.

In this case, the data is located in the range A4:F36. We call each row between columns A and F a record and each column a field.

  • Highlight the range A4:F36

If we omitted any rows, the records would not be sorted. If we omitted any columns, the values in the omitted fields would be associated with the wrong records.

  • Data->Sort

In the Sort by window select Column F. This is the column that contains the values that we wish to sort according to.

  1. Check the adjacent Ascending radio button.

  2. Click OK.

If you wished to sort the data by points in descending order, that is with the highest number first, you would have checked the Descending radio button.

Alphabetic sorts

Suppose we had wished to sort the data in the previous example in alphabetic order of name you would proceed as follows:

  1. Highlight A4:F36

  2. Data->Sort

  3. Select Column A in the Sort by window. This is the column containing the name field.

  4. Check the Ascending radio button.

  5. If you wished to sort with the names sorted in reverse order from Z to A, you would check the Descending radio button.

  6. Click OK.

Multiple sort criteria

If you look at the above screen you will see that there are two names Andiswa. The first has higher points than the second. You can sort on multiple criteria so that, where there are multiple occurrences of the first sort criteria, these can then be sorted according to the second criteria. The following screen shows how to do this in the Sort dialogue.

Chapter 3. Worksheets

Handling worksheets

Insert a new worksheet

A spreadsheet consists of one or more worksheets. The worksheets can be thought of as pages of the spreadsheets. By default, a spreadsheet consists of three worksheets. These are labelled Sheet1 to Sheet3.

New worksheets can be added to a spreadsheet.

  1. Click on the tab adjacent to the new worksheet.

  2. Insert->Sheet ...

    This displays the Insert worksheet dialogue.

  3. Choose the Position, before or after the selected sheet.

  4. Choose the No of sheets you wish to insert.

  5. If you choose to insert only one sheet, you may (optionally) enter the name of the sheet in the Name window.

  6. Click OK.

Rename a sheet

The default names of worksheets are Sheet1, Sheet2, and so on. You may change the name of a worksheet as follows:

  1. Right click on the tab of the worksheet that you wish to rename.

  2. Select Rename in the contextual menu that appears.

  3. Enter the new name in the dialogue.

  4. Click OK.

Delete a worksheet

  1. Right click on the tab of the worksheet you wish to delete.

  2. Select Delete in the contextual menu that appears.

    A dialogue will appear asking you to confirm that you wish to permanently delete the worksheet and its contents.

  3. Click Yes to confirm that you wish to delete the worksheet or Cancel if you do not wish to.

Duplicate a worksheet within a spreadsheet, between spreadsheets

There are two methods of duplicating a copy of a worksheet. One method is to copy the entire contents of a worksheet to the clipboard and then pasting this into another existing worksheet. In this section you will make a duplicate of the worksheet in a new worksheet.

Duplicate a worksheet within a spreadsheet

  1. Select the worksheet you wish to duplicate.

  2. Edit->Copy/Move worksheet .....

  3. Tick the Copy checkbox.

  4. Select the position for the duplicate in the Insert before window.

  5. Click OK.

  6. Rename the duplicate worksheet if you wish.

Duplicate a worksheet between spreadsheets

You may insert a copy of a worksheet in another open spreadsheet or into a new document.

  1. Select the worksheet you wish to duplicate.

  2. Edit->Copy/Move worksheet .....

  3. Click on the To Document drop down window.

  4. Select the name of the spreadsheet in which you wish to duplicate the worksheet and select the position in this spreadsheet.

OR

  1. Select New document in the To document window if you wish to create a new spreadsheet for the duplicate.

  2. Tick the Copy check box.

  3. Click OK.

Move a worksheet within a spreadsheet, between spreadsheets

The process of moving a worksheet within a spreadsheet or between spreadsheets is virtually the same as duplicating a worksheet, except that you do NOT tick the Copy checkbox in the Move/Copy Sheet dialogue.

Chapter 4. Formulas and Functions

Arithmetic formulas

Abstract

Generate formulas using cell references and arithmetic operatorsPlus (+), minus (-), division (/) and multiplication (*)

The main purpose of a spreadsheet is to automate numeric work and to store the calculations and their results for later use.

At the heart of any numeric work are the calculations themselves. In their simplest form, these are made up of numbers separated by the usual arithmetic operators of addition, subtraction, division and multiplication. The only difference is that the symbols we use in spreadsheets may be different from those you are used to.

Indicating a calculation

Calculations are done within cells. In order to indicate that we wish to do a calculation in a cell, we preface the cell entry with the = symbol. This indicates to Calc that it must treat the cell entry as a calculation.

Calc records the entry in a cell as you enter it, but normally displays the result of the calculation.

For example, a cell could contain the entry: =7+8

Calc however displays the result 15. You need to make a distinction between the actual contents of a cell and what is displayed.

Arithmetic operators

The four basic operations are as follows:

Addition

=7+8

Subtraction

=7-8

Multiplication

=7*8

Division

=7/8

Arithmetic using cell references: Automatic recalculation

If we simply performed arithmetic using numbers, we may as well use a calculator. Suppose we have a simple situation in which one cell contains an amount of money and another an interest rate. If a third contains the product of the two (a product is the result of multiplying two numbers), this cell will in fact display the interest that would be earned on the capital. This is illustrated in the following screen:

The contents of cell C2 are: =A2*B2

Notice that the formula bar contains the actual contents of a cell. If the cell contains a calculation, the result of the calculation is displayed in the cell.

The = sign indicates that C2 contains a calculation. This calculation involves multiplying the contents of A2 with those of B2.

Now suppose we change the contents of cell B2, without making any change to C2, and press Enter as shown in the following screen:

The value in C3 automatically changes to reflect the changed value in B2. This tool is called automatic recalculation.

When you save a spreadsheet, the formulas are displayed so that they can be reused at a later stage.

Arithmetic operations using the values of cells are written down in the same way as arithmetic operations between values.

Addition

=A2+B2

Subtraction

=A2-B2

Multiplication

=A2*B2

Division

=A2/B2

More complex calculations are carried out using the normal rules of arithmetic.

Suppose cell A2 contains the value 12, B2 the value 6 and C2 the value 8. The following table illustrates how these can be combined into arithmetic formulas.

Cell entryEquivalent arithmetic expressionCell display

=A2 + B2 - C2

12 + 6 - 8

10

=A2 + B2*C2

12 + 6*8

60

=(A2+B2)*C2

(12 + 6)*8

144

=A2/B2 - C2

12/6 - 8

-2

=A2/B2 + A2*C2

12/2 + 12*8

98

[Important]

When you carry out arithmetic involving the different operators, remember that different operations have different priorities. The order is as follows:

  1. Work out the contents of brackets

  2. Carry out the multiplications and divisions

  3. Do the additions and subtractions

Recognise and understand error values associated with using formulas

If you enter a formula and Calc is not able to interpret it, it will display an error in the cell. The main errors that you will come across are shown below.

Error message

Cause of error

#NAME

An identifier could not be evaluated. This usually means that the reference to a cell or row or column was invalid. This is also known as error 525

#VALUE

Calc was unable to evaluate one of the cell references in the formula as a number. This error usually occurs when one of the cells referenced in a formula contains text rather than a number. This is also known as error 519.

#REF

This indicates that the formula contains a reference to a cell, row or column that was deleted. It is also known as error 524.

Invalid floating point operation

A formula contains division by zero. A common misunderstanding is that because multiplication by zero results in zero, so does division by zero. Division by zero is however impossible. This is also known as error 503.

Cell referencing

Abstract

Understand and use relative, mixed and absolute cell referencing in formulas

Relative addressing

Suppose cell D4 contains the formula =D1-D2. Suppose we now copy the contents of D4 to E4:G6.

The result is shown on the following screen:

If you look at this screen, you will see that both the column letters and row numbers can change when the cell D4 is copied.

Cell D4 contains the formula =D1-D2. This means find the difference between the cell three rows up in the same column and the cell two rows up in the same column. When D4 is copied, the formula will be adjusted so that the cell references in the target cells have the same relationship.

For example, F6 contains the formula =F3-F4. This also means the difference between the cell three rows up in the same column and the cell two rows up in the same column. When cell references such as this can be changed when the cell is copied, we say that we are using relative addresses.

Absolute addressing

If we put the $ symbol in front of a column letter or row number, then the reference will not change. The following screen indicates this type of addressing known as absolute addressing.

As this screen shows the addresses in the target cells are identical to that in the source cell.

Mixed addressing

You may make either the column or row absolute. When you do this the column or row reference will remain fixed when the cell is copied. This is referred to as mixed addressing.

The following two screens illustrate mixed addressing.

Working with functions

Abstract

Generate formulas using SUM, AVERAGE, MINIMUM, MAXIMUM and COUNT functions

SUM

A function is an inbuilt utility that simplifies the creation of arithmetic expressions involving cell ranges.

For example, we could add up the contents of all the cells in the range B4: D7 with the expression:

=B4+B5+B6+B7+C4+C5+C6+C7+D4+D5+D6+D7

Obviously, the bigger the cell range we wish to add the more terms there will be in the expression.

The SUM function simplifies the process considerably. All we have to enter is the function:

=SUM(B4:D7)

[Important]

The = symbol in front of the SUM function.

This means add the contents of all the cells in the range B4:D7.

The SUM function can be used in an arithmetic expression as shown in the following examples:

=SUM(C4:F8) + B6

=B6 – SUM(B7:B12)

=SUM(A3:B6) + SUM(C3:D9)

Syntax

The syntax of a function is the formal structure of the function. We write the syntax of the SUM function as:

=SUM(range)

Where range is the range of cells that are being averaged as, for example, B4:D7.

AVERAGE

Syntax: =AVERAGE(range)

AVERAGE functions in exactly the same way as SUM, except that it calculates the average value of the cells in range.

MAX and MIN

Syntax: = MAX(range), =MIN(range)

These functions determine the maximum and minimum values in a range of cells.

COUNT

Syntax: =COUNT(range)

COUNT returns the number of cells that contain values in range.

=AVERAGE(range) is actually the same as =SUM(range) / COUNT(range).

Using functions in a spreadsheet

Often functions are used to summarise data in a spreadsheet. When you create a spreadsheet, it is good practice to put your summary information at the top of the spreadsheet and the data on which the summary is based below.

Suppose we wish to summarise the data in the spreadsheet below.

In this we may wish to find the sum, average, maximum and minimum of each column as well as the number of data entries in each column. We start by inserting four rows below row 2.

  1. Select rows 2 to 6.

  2. Insert->Rows

  3. Enter the following in A3:A7

    A3:

    SUM

    A4:

    MAXIMUM

    A5:

    MINIMUM

    A6:

    ENTRIES

    A7:

    AVERAGE

  4. Enter the following in B3:B6

    B3:

    =SUM(B9:B39)

    B4:

    =MAX(B9:B39)

    B5:

    =MIN(B9:B39)

    B6:

    =COUNT(B9:B39)

    B7:

    = AVERAGE(B9:B39)