1 Introducing Calc
1 Introducing Calc
Chapter 1
Introducing Calc
Using Spreadsheets in LibreOffice
Copyright
This document is Copyright © 2005–2012 by its contributors as listed below. You may distribute it
and/or modify it under the terms of either the GNU General Public License
(http://www.gnu.org/licenses/gpl.html), version 3 or later, or the Creative Commons Attribution
License (http://creativecommons.org/licenses/by/3.0/), version 3.0 or later.
All trademarks within this guide belong to their legitimate owners.
Contributors
Barbara Duprey
Gabriel Godoy
Jean Hollis Weber
John A Smith
Feedback
Please direct any comments or suggestions about this document to:
[email protected]
Acknowledgments
This chapter is based on Chapter 1 of the OpenOffice.org 3.3 Calc Guide. The contributors to that
chapter are:
Rick Barnes Nicole Cairns Peter Kupfer
Jean Hollis Weber Krishna Aradhi Andy Brown
Alexandre Martins Anthony Petrillo Gary Schnabl
Barbara M Tobias
Introducing Calc 3
Moving and copying sheets....................................................................................................... 29
Deleting sheets.......................................................................................................................... 30
Renaming sheets....................................................................................................................... 30
Viewing Calc....................................................................................................................... 31
Using zoom................................................................................................................................ 31
Freezing rows and columns....................................................................................................... 31
Splitting the screen.................................................................................................................... 32
Using the Navigator........................................................................................................... 34
Moving quickly through a document........................................................................................... 35
Choosing a drag mode............................................................................................................... 36
Using document properties.............................................................................................. 36
4 Introducing Calc
What is Calc?
Calc is the spreadsheet component of LibreOffice. You can enter data (usually numerical) in a
spreadsheet and then manipulate this data to produce certain results.
Alternatively, you can enter data and then use Calc in a ‘What if...’ manner by changing some of
the data and observing the results without having to retype the entire spreadsheet or sheet.
Other features provided by Calc include:
• Functions, which can be used to create formulas to perform complex calculations on data.
• Database functions, to arrange, store, and filter data.
• Dynamic charts; a wide range of 2D and 3D charts.
• Macros, for recording and executing repetitive tasks; scripting languages supported include
LibreOffice Basic, Python, BeanShell, and JavaScript.
• Ability to open, edit, and save Microsoft Excel spreadsheets.
• Import and export of spreadsheets in multiple formats, including HTML, CSV, PDF, and
PostScript.
If you want to use macros written in Microsoft Excel using the VBA macro code in
Note LibreOffice, you must first edit the code in the LibreOffice Basic IDE editor. See
Chapter 12, Calc Macros.
If any part of the Calc window in Figure 1 is not shown, you can display it using the
View menu. For example, View > Status Bar will toggle (show or hide) the Status
Note Bar. It is not always necessary to display all the parts, as shown; show or hide any of
them, as desired.
Title bar
The Title bar, located at the top, shows the name of the current spreadsheet. When the
spreadsheet is newly created, its name is Untitled X, where X is a number. When you save a
spreadsheet for the first time, you are prompted to enter a name of your choice.
Menu bar
Under the Title bar is the Menu bar. When you choose one of the menus, a sub-menu appears with
other options. You can modify the Menu bar, as discussed in Chapter 14, Setting Up and
Customizing Calc.
• File contains commands that apply to the entire document such as Open, Save, Wizards,
Export as PDF, and Digital Signatures.
• Edit contains commands for editing the document such as Undo, Changes, Compare
Document, and Find and Replace.
• View contains commands for modifying how the Calc user interface looks such as
Toolbars, Full Screen, and Zoom.
• Insert contains commands for inserting elements such as cells, rows, columns, sheets,
and pictures into a spreadsheet.
• Format contains commands for modifying the layout of a spreadsheet such as Styles and
Formatting, Paragraph, and Merge Cells.
• Tools contains functions such as Spelling, Word Count, Bibliography, Gallery, and
Macros.
• Data contains commands for manipulating data in your spreadsheet such as Define
Range, Sort, and Filter.
• Window contains commands for the display window such as New Window, and Close
Window.
• Help contains links to the Help file bundled with the software, What's This?, Help, and
License Information.
Toolbars
Calc has several types of toolbars: docked (fixed in place), floating, and tear-off. Docked toolbars
can be moved to different locations or made to float, and floating toolbars can be docked.
6 Introducing Calc
Four toolbars are located under the Menu bar by default: the Standard toolbar, the Find toolbar, the
Formatting toolbar, and the Formula Bar.
The icons (buttons) on these toolbars provide a wide range of common commands and functions.
You can also modify these toolbars, as discussed in Chapter 14, Setting Up and Customizing Calc.
Placing the mouse pointer over any of the icons displays a small box, called a tooltip. It gives a
brief explanation of the icon’s function. For a more detailed explanation, choose Help > What’s
This? and hover the mouse pointer over the icon. To turn this feature off again, click once or press
the Esc key twice. Tips and extended tips can be turned on or off from Tools > Options >
LibreOffice > General.
An example of a tear-off toolbar is shown in Figure 3. Tear-off toolbars can be floating or docked
along an edge of the screen or in one of the existing toolbar areas. To move a floating tear-off
toolbar, drag it by the title bar.
On some installations, drag and drop is another alternative. To dock a window, click on the title bar
of the floating window and drag to either side of the main window. A dotted frame will show the
area where it will be docked. See Figure 6.
8 Introducing Calc
Figure 6: Drag and drop to dock a window
Customizing toolbars
You can customize toolbars in several ways, including choosing which icons are visible and locking
the position of a docked toolbar.
To access a toolbar’s customization options, use the
down-arrow at the end of the toolbar or on its title bar.
To show or hide icons defined for the selected toolbar,
choose Visible Buttons from the drop-down menu.
Visible icons are indicated by a border around the icon
(Figure 7). Click on icons to hide or show them on the
toolbar.
You can also add icons and create new toolbars, as described in Chapter 16.
If any of the icons (buttons) in Figure 8 is not shown, you can display it by clicking the
small triangle at the right end of the Formatting toolbar, selecting Visible Buttons in
Note the drop-down menu, and selecting the desired icon (for example, Apply Style) in
the drop-down list. It is not always necessary to display all the toolbar buttons, as
shown; show or hide any of them, as desired.
Formula Bar
On the left hand side of the Formula Bar is a small text box, called the Name Box, with a letter and
number combination in it, such as A1 in Figure 9. This combination, called the cell reference, is the
column letter and row number of the selected cell.
The contents of the current cell (data, formula, or function) are displayed in the Input line, which is
the remainder of the Formula Bar. You can either edit the cell contents of the current cell there, or
you can do that in the current cell. To edit inside the Input line area, click in the area, then type your
changes. To edit within the current cell, just double-click the cell.
10 Introducing Calc
Right-click (context) menus
Right-click on a cell, graphic, or other object to open a context menu. Often the context menu is the
fastest and easiest way to reach a function. If you’re not sure where in the menus or toolbars a
function is located, you may be able to find it by right-clicking.
Individual cells
The main section of the screen displays the cells in the form of a grid, with each cell being at the
intersection of a column and a row.
At the top of the columns and at the left end of the rows are a series of gray boxes containing
letters and numbers. These are the column and row headers. The columns start at A and go on to
the right, and the rows start at 1 and go down.
These column and row headers form the cell references that appear in the Name Box on the
Formula Bar (see Figure 9). You can turn these headers off by selecting View > Column & Row
Headers.
Sheet tabs
At the bottom of the grid of cells are the sheet tabs. These tabs enable access to each individual
sheet, with the visible (active) sheet having a white tab. Clicking on another sheet tab displays that
sheet, and its tab turns white. You can also select multiple sheet tabs at once by holding down the
Control key while you click the names.
From Calc 3.4, you can choose colors for the different sheet tabs. Right-click on a tab and choose
Tab Color from the context menu to open a palette of colors (see Figure 10). To add new colors to
the palette, see “Color options” in Chapter 14, Setting up and Customizing Calc.
Page style ( )
Shows the page style of the current sheet. To edit the page style, double-click on this field. The
Page Style dialog opens.
Insert mode ( )
Click to toggle between INSRT (Insert) and OVER (Overwrite) modes when typing. This field is
blank when the spreadsheet is not in a typing mode (for example, when selecting cells).
Selection mode ( )
Click to toggle between STD (Standard), EXT (Extend), and ADD (Add) selection. EXT is an
alternative to Shift+click when selecting cells. See page 24 for more information.
Unsaved changes ( )
This icon replaces the standard icon if changes to the spreadsheet have not been saved.
Digital signature ( )
If the document has not been digitally signed, double-clicking in this area opens the Digital
Signatures dialog, where you can sign the document. See Chapter 6, Printing, Exporting, and
E-mailing, for more about digital signatures.
If the document has been digitally signed, an icon shows in this area. You can double-
click the icon to view the certificate. A document can be digitally signed only after it has been
saved.
12 Introducing Calc
When the cursor is on an object such as a picture or chart, the information shown includes the
size of the object and its location.
Zoom ( )
To change the view magnification, drag the Zoom slider or click on the + and – signs. You can
also right-click on the zoom level percentage to select a magnification value or double-click to
open the Zoom & View Layout dialog.
• From the Start Center. When LibreOffice is open but no document is open (for example, if
you close all the open documents but leave the program running), the Start Center is
shown. Click one of the icons to open a new document of that type, or click the Templates
icon to start a new document using a template. If a document is already open in
LibreOffice, the new document opens in a new window.
When LibreOffice is open, you can also start a new document in one of the following ways.
• Press the Control+N keys.
• Use File > New > Spreadsheet.
• Click the New button on the main toolbar.
14 Introducing Calc
Figure 15: Starting a new spreadsheet from a template
You can also open an existing document in one of the following ways. If a document is already
open in LibreOffice, the second document opens in a new window.
• Choose File > Open
• Click the Open button on the main toolbar.
• Press Control+O on the keyboard.
• Use File > Recent Documents to display the last 10 files that were opened in any of the
LibreOffice components.
• Use the Open Document selection on the Quickstarter.
In each case, the Open dialog box appears. Select the file you want, and then click Open. If a
document is already open in LibreOffice, the second document opens in a new window.
If you have associated Microsoft Office file formats with LibreOffice, you can also open these files
by double-clicking on them.
Figure 16: Text Import dialog, with Comma (,) selected as the separator and double quotation mark
(“) as the text delimiter.
You can preview the layout of the imported data at the bottom of the dialog. Right-click a
column in the preview to set the format or to hide the column.
If the CSV file uses a text delimiter character that is not in the Text delimiter list, click in the
box, and type the character.
6) The choices in the Other options section determine whether quoted data will always be
imported as text, and whether Calc will automatically detect all number formats, including
special number formats such as dates, time, and scientific notation. The detection depends
on the language settings.
7) Click OK to open the file.
16 Introducing Calc
Caution
If you do not select Text CSV (*csv;*txt) as the file type when opening the file, the
document opens in Writer, not Calc.
Saving spreadsheets
Spreadsheets can be saved in three ways.
• Press Control+S.
• Choose File > Save (or Save All or Save As).
• Click the Save button on the main toolbar.
If the spreadsheet has not been saved previously, then each of these actions will open the Save As
dialog. There you can specify the spreadsheet name and the location in which to save it.
If the spreadsheet has been previously saved, then saving it using the Save (or
Save All) command will overwrite an existing copy. However, you can save the
Note spreadsheet in a different location or with a different name by selecting File >
Save As.
From this point on, all changes you make to the spreadsheet will occur only in the
Caution
Microsoft Excel document. You have changed the name and file type of your
document. If you want to go back to working with the *.ods version of your
spreadsheet, you must open it again.
Saving spreadsheets 17
Figure 17. Saving a spreadsheet in Microsoft Excel format
4) In the Export Text file dialog, select the options you want and then click OK.
18 Introducing Calc
Figure 18: Choosing options when exporting to Text CSV
Password protection
Protecting a spreadsheet
Calc provides two levels of document protection: read-protect (file cannot be viewed without a
password) and write-protect (file can be viewed in read-only mode but cannot be changed without
a password). Thus you can make the content available for reading by a selected group of people
and for reading and editing by a different group. This behavior is compatible with Microsoft Excel
file protection.
1) Use File > Save As when saving the document. (You can also use File > Save the first
time you save a new document.)
2) On the Save As dialog, type the file name, select the Save with password option, and
then click Save.
Password protection 19
Figure 19: Two levels of password protection
Caution
LibreOffice uses a very strong encryption mechanism that makes it almost
impossible to recover the contents of a document if you lose the password.
20 Introducing Calc
2) In the General tab, click the Change Password button, which is located at the top right
corner next to the file name.
Use one of the two Alt+Arrow key combinations to resize the width of a cell. (For
Tip example: Alt+→ increases the width of a cell.)
In this release of Calc, Alt+Up Arrow and Alt+Down Arrow as key combinations to
Note alter row height, are not implemented in the Default key bindings.
22 Introducing Calc
Key Combination Movement
Control+→ To the next column to the right containing data in that row or to Column
AMJ
Control+← To the next column to the left containing data in that row or to Column A
Control+↑ To the next row above containing data in that column or to Row 1
Control+↓ To the next row below containing data in that column or to
Row 1048576
Control+Home To Cell A1
Control+End To lower right-hand corner of the rectangular area containing data
Alt+Page Down One screen to the right (if possible)
Alt+Page Up One screen to the left (if possible)
Control+Page Down One sheet to the right (in sheet tabs)
Control+Page Up One sheet to the left (in sheet tabs)
Tab To the next cell on the right
Shift+Tab To the next cell on the left
Enter Down one cell (unless changed by user)
Shift+Enter Up one cell (unless changed by user)
The sheet tab arrows that appear in Figure 23 only appear if you have some sheet
Note tabs that can not be seen. Otherwise, they appear faded.
Sheet tabs
Selecting cells
Cells can be selected using a number of methods and in a variety of combinations and quantities.
Single cell
Left-click in the cell. The result will look like the left side of Figure 21. You can verify your selection
by looking in the Name Box.
24 Introducing Calc
To select a range of cells without dragging the mouse:
1) Click in the cell which is to be one corner of the range of cells.
2) Move the mouse to the opposite corner of the range of cells.
3) Hold down the Shift key and click.
You can also select a contiguous range of cells by first clicking in the STD field on
the status bar and changing it to EXT, before clicking in the opposite corner of the
Tip range of cells. If you use this method, be sure to change EXT back to STD or you
may find yourself extending the selection unintentionally.
You can also directly select a range of cells using the Name Box. Click into the
Name Box as described in “Using a cell reference” on page 21. To select a range
Tip of cells, enter the cell reference for the upper left-hand cell, followed by a colon (:),
and then the lower right-hand cell reference. For example, to select the range that
would go from A3 to C6, you would enter A3:C6.
You can also select a non-contiguous range of cells by first clicking twice in the
STD field on the status bar to change it to ADD, before clicking on a cell that you
want to add to the range of cells in selected in step 3 above. This method works
Tip best when adding single cells to a range. If you use this method, be sure to
change ADD back to STD or you may find yourself adding more selections
unintentionally.
Entire sheet
To select the entire sheet, click on the small box between the A column header and the 1 row
header.
Selecting sheets
You can select either one or multiple sheets. It can be advantageous to select multiple sheets at
times when you want to make changes to many sheets at once.
Single sheet
Click on the sheet tab for the sheet you want to select. The tab for the selected sheet becomes
white (see Figure 23).
All sheets
Right-click any one of the sheet tabs and choose Select All Sheets from the context menu.
If a color has been set for the tab, then on selection the lower edge of the tab has
Note the color and the remainder of the tab is white.
26 Introducing Calc
Working with columns and rows
When you insert a single new column, it is inserted to the left of the highlighted
column. When you insert a single new row, it is inserted above the highlighted row.
Note
Cells in the new columns or rows are formatted like the corresponding cells in the
column or row before (or to the left of) which the new column or row is inserted.
Instead of deleting a row or column, you may wish to delete the contents of the
Tip cells but keep the empty row or column. See Chapter 2, Entering, Editing, and
Formatting Data, for instructions.
28 Introducing Calc
Moving and copying sheets
You can move or copy sheets within the same spreadsheet by using either the mouse (drag and
drop) or a dialog. Drag and drop does not work if you wish to move or copy a sheet to a different
spreadsheet; instead, you need to use the dialog.
Using a dialog
The Move/Copy dialog provides the opportunity to specify exactly where you want the sheet to go
(in the same or a different document, and what its name will be, at the same time as moving or
copying occurs.
When moving or copying sheets between different spreadsheets, be sure that both
Note documents are open.
Deleting sheets
Sheets can be deleted individually or in groups.
Single sheet
Right-click on the tab of the sheet you want to delete and choose Delete Sheet from the
context menu, or choose Edit > Sheet > Delete from the Menu bar. Either way, an alert will ask
if you want to delete the sheet permanently. Click Yes.
Multiple sheets
To delete multiple sheets, select them as described earlier, then either right-click over one of
the tabs and choose Delete Sheet from the context menu, or choose Edit > Sheet > Delete
from the Menu bar.
Renaming sheets
The default name for the a new sheet is SheetX, where X is a number. While this works for a small
spreadsheet with only a few sheets, it becomes awkward when there are many sheets.
To give a sheet a more meaningful name, you can:
• Enter the name in the Name box when you create the sheet, or
• Right-click on a sheet tab and choose Rename Sheet from the context menu; replace the
existing name with a different one.
• Double-click on a sheet tab to open the Rename Sheet dialog.
30 Introducing Calc
Sheet names must start with either a letter or a number; other characters including
spaces are not allowed. Apart from the first character of the sheet name, allowed
Note characters are letters, numbers, spaces, and the underscore character. Attempting
to rename a sheet with an invalid name will produce an error message.
Viewing Calc
Using zoom
Use the zoom function to change the view to show more or fewer cells in the window.
In addition to using the Zoom slider on the Status bar (see page 13), you can open the Zoom
dialog and make a selection on the left-hand side.
• Choose View > Zoom from the Menu bar, or
• Double-click on the percentage figure in the Status bar at the bottom of the window.
Viewing Calc 31
Figure 30 shows some frozen rows and columns. The heavier horizontal line between rows 3 and
14 and the heavier vertical line between columns C and H denote the frozen areas. Rows 4
through 13 and columns D through G have been scrolled off the page. The first three rows and
columns remained because they are frozen into place.
You can set the freeze point at one row, one column, or both a row and a column as in Figure 30.
32 Introducing Calc
Figure 31. Split screen example
3) Hold down the left mouse button. A gray line appears, running across the page. Drag the
mouse downwards and this line follows.
4) Release the mouse button and the screen splits into two views, each with its own vertical
scroll bar. You can scroll the upper and lower parts independently.
Notice in Figure 31, the Beta and the A0 values are in the upper part of the window and other
calculations are in the lower part. Thus, you can make changes to the Beta and A0 values and
watch their effects on the calculations in the lower half of the window.
Viewing Calc 33
You can also split the screen using a menu command. Click in a cell immediately
Tip below and to the right of where you wish the screen to be split, and choose
Window > Split.
To open the Navigator, click its icon on the Standard toolbar, or press F5, or choose View >
Navigator on the Menu bar, or double-click on the Sheet Sequence Number in the
Status Bar. You can dock the Navigator to either side of the main Calc window or leave it floating.
(To dock or float the Navigator, hold down the Control key and double-click in an empty area near
the icons at the top.)
The Navigator displays lists of all the objects in a spreadsheet document, grouped into categories.
If an indicator (plus sign or arrow) appears next to a category, at least one object of this kind exists.
To open a category and see the list of items, click on the indicator.
To hide the list of categories and show only the icons at the top, click the Contents icon . Click
this icon again to show the list.
Table 2 summarizes the functions of the icons at the top of the Navigator.
34 Introducing Calc
Figure 35: The Navigator in Calc
Start/End. Moves to the cell at the beginning or end of the current data range, which
you can highlight using the Data Range button.
Toggle. Switches between showing all categories and showing only the selected
category.
Drag Mode. Choose hyperlink, link, or copy. See “Choosing a drag mode” for details.
Insert as Hyperlink
Creates a hyperlink when you drag and drop an item into the current document.
Insert as Link
Inserts the selected item as a link where you drag and drop an object into the current
document.
Insert as Copy
Inserts a copy of the selected item where you drag and drop in the current document. You
cannot drag and drop copies of graphics, OLE objects, or indexes.
36 Introducing Calc
Figure 36: The Description page of the document’s Properties dialog
Figure 37: Custom Properties page, showing drop-down lists of names and types
When the Custom Properties page is first opened in a new document, it may be blank. However, if
the new document is based on a template, this page may contain fields.
Click Add to insert a row of boxes into which you can enter your custom properties.
• The Name box includes a drop-down list of typical choices; scroll down to see all the
choices. If none of the choices meet your needs, you can type a new name into the box.
• In the Type column, you can choose from text, date+time, date, number, duration, or yes/no
for each field. You cannot create new types.
• In the Value column, type or select what you want to appear in the document where this
field is used. Choices may be limited to specific data types depending on the selection in
the Type column; for example, if the Type selection is Date, the Value for that property is
limited to a date.
To remove a custom property, click the button at the end of the row.
38 Introducing Calc