0% found this document useful (0 votes)
56 views438 pages

CG41 CalcGuideLO

Uploaded by

Dinodoc
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
56 views438 pages

CG41 CalcGuideLO

Uploaded by

Dinodoc
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 438

LibreOffice 4.

1 Calc Guide
Using Spreadsheets in LibreOffice

Copyright
This document is Copyright 2013 by its contributors as listed below. You may distribute it and/or modify it under the terms of either the G ! General "ublic #icense $http%//www.gnu.org/licenses/gpl.html&' (ersion 3 or later' or the Creati(e Commons )ttribution #icense $http%//creati(ecommons.org/licenses/by/3.0/&' (ersion 3.0 or later. ote that Chapter *' Using the DataPilot' is licensed under the Creati(e Commons )ttribution+,hare )li-e #icense' (ersion 3.0. )ll trademar-s within this guide belong to their legitimate owners.

Contributors
.ohn ) ,mith )ndrew "itonya4arbara 5uprey 1ar- 1orin "hilippe Cl7ment 1artin ,affron Cover art: 5rew .ensen .ean /ollis 0eber .ean /ollis 0eber ,imon 4rydon "eter ,chofield Christian Chenal "ierre+Y(es ,amyn 6laus+.8rgen 0eghorn Christoph oac1artin . 2o3 Gabriel Godoy 6ieran "ec-ett #aurent 4alland+"oirier ,helagh 1anton "reston 1anning 4ernstein 6laus+.8rgen 0eghorn

Feedback
"lease direct any comments or suggestions about this document to% documentation9global.libreoffice.org

Acknowledgments
This boo- is adapted from Getting Started with OpenOffice.org 3.3. The contributors to that booare listed on page 12.

Publication date and software version


"ublished 2: o(ember 2013. 4ased on #ibre;ffice <.1.

Documentation for LibreOffice is available at http: www.libreoffice.org get!help documentation

Contents
Copyright..................................................................................................................................... 2

Preface..................................................................................................................................7
0ho is this boo- for=................................................................................................................... * 0hat>s in this boo-=..................................................................................................................... * 0here to get more help............................................................................................................... * 0hat you see may be different....................................................................................................: !sing #ibre;ffice on a 1ac........................................................................................................10 0hat are all these things called=...............................................................................................10 0ho wrote this boo-=.................................................................................................................11 )c-nowledgements.................................................................................................................... 12 2re?uently as-ed ?uestions.......................................................................................................12 0hat>s new in #ibre;ffice Calc <.0=..........................................................................................13 0hat>s new in #ibre;ffice Calc <.1=..........................................................................................1<

Chapter 1 ntroducing Calc...............................................................................................1!


0hat is Calc=............................................................................................................................. 1@ ,preadsheets' sheets' and cells................................................................................................1@ Calc main dialog........................................................................................................................ 1@ Creating' opening and sa(ing spreadsheets..............................................................................21 "assword protection.................................................................................................................. 2A a(igating within spreadsheets.................................................................................................2A ,electing items in a sheet or spreadsheet.................................................................................2* 0or-ing with columns and rows.................................................................................................31 0or-ing with sheets................................................................................................................... 32 Biewing Calc.............................................................................................................................. 3< !sing the a(igator................................................................................................................... 3@ !sing document properties........................................................................................................3*

Chapter " #ntering$ #diting$ and Formatting %ata.........................................................&1


Cntroduction................................................................................................................................ <2 !sing the -eyboard.................................................................................................................... <2 ,peeding up data entry.............................................................................................................. <@ 1erging and splitting cells.......................................................................................................... <: ,haring content between sheets................................................................................................A0 Balidating cell contents.............................................................................................................. A0 Dditing data................................................................................................................................ A3 2ormatting data.......................................................................................................................... AE )uto2ormat of cells and sheets..................................................................................................@3 !sing themes............................................................................................................................. @< Balue highlighting....................................................................................................................... @A !sing conditional formatting.......................................................................................................@A /iding and showing data............................................................................................................ @: ,orting records.......................................................................................................................... EA 2ind and replace........................................................................................................................ EE
LibreOffice ".# $alc Guide 3

Chapter ' Creating Charts and (raphs...........................................................................)1


Cntroduction................................................................................................................................ *2 Chart 0iFard.............................................................................................................................. *2 Dditing charts and graphs.......................................................................................................... *E 2ormatting charts and graphs....................................................................................................:A )dding drawing obGects to charts.............................................................................................10A HesiFing and mo(ing the chart.................................................................................................10A D3porting charts....................................................................................................................... 10* Gallery of chart types............................................................................................................... 10*

Chapter & *sing +tyles and ,emplates in Calc.............................................................1"1


0hat is a template=................................................................................................................. 122 0hat are styles=...................................................................................................................... 122 ,tyles....................................................................................................................................... 122 Templates................................................................................................................................ 13E

Chapter ! *sing (raphics in Calc..................................................................................1&'


Graphics in Calc...................................................................................................................... 1<< )dding graphics $images&........................................................................................................ 1<< 1odifying images..................................................................................................................... 1<* !sing the picture conte3t menu................................................................................................1A3 !sing CalcIs drawing tools.......................................................................................................1AA "ositioning graphics................................................................................................................. 1A* Creating an image map............................................................................................................ 1@1

Chapter - Printing$ #.porting$ and #/mailing...............................................................1-'


Juic- printing........................................................................................................................... 1@< Controlling printing................................................................................................................... 1@< !sing print ranges.................................................................................................................... 1@E "age brea-s............................................................................................................................. 1E1 "rinting options setup in page styles........................................................................................1E2 /eaders and footers................................................................................................................ 1E3 D3porting to "52..................................................................................................................... 1E@ D3porting to other formats........................................................................................................1*1 D+mailing spreadsheets........................................................................................................... 1*1 5igital signing of documents....................................................................................................1*2 Hemo(ing personal data.......................................................................................................... 1*2

Chapter 7 *sing Formulas and Functions....................................................................1)'


Cntroduction.............................................................................................................................. 1*< ,etting up a spreadsheet......................................................................................................... 1*< Creating formulas.................................................................................................................... 1*A !nderstanding functions.......................................................................................................... 1:: ,trategies for creating formulas and functions.........................................................................20< 2inding and fi3ing errors.......................................................................................................... 20@ D3amples of functions.............................................................................................................. 211 !sing regular e3pressions in functions.....................................................................................21< )d(anced functions.................................................................................................................. 21@
" LibreOffice ".# $alc Guide

Chapter ) *sing Pivot ,ables........................................................................................."17


Cntroduction.............................................................................................................................. 21* The "i(ot Table dialog.............................................................................................................. 220 0or-ing with the results of the "i(ot Table...............................................................................22* !sing "i(ot Table results elsewhere.........................................................................................23E

Chapter 0 %ata Analysis.................................................................................................."&1


Cntroduction.............................................................................................................................. 2<2 Consolidating data................................................................................................................... 2<2 Creating subtotals.................................................................................................................... 2<< !sing Kwhat ifL scenarios.......................................................................................................... 2<* !sing other Kwhat ifL tools........................................................................................................ 2A2 0or-ing bac-wards using Goal ,ee-.......................................................................................2AE !sing the ,ol(er...................................................................................................................... 2A*

Chapter 11 2inking Calc %ata........................................................................................."-1


0hy use multiple sheets=........................................................................................................2@2 ,etting up multiple sheets........................................................................................................2@2 Heferencing other sheets.........................................................................................................2@A Heferencing other documents..................................................................................................2@E /yperlin-s and !H#s............................................................................................................... 2@* #in-ing to e3ternal data............................................................................................................ 2E1 #in-ing to registered data sources...........................................................................................2E@ Dmbedding spreadsheets........................................................................................................ 2E:

Chapter 11 +haring and 3eviewing %ocuments...........................................................")!


Cntroduction.............................................................................................................................. 2*@ ,haring documents $collaboration&..........................................................................................2*@ Hecording changes.................................................................................................................. 2** )dding comments to changes..................................................................................................2:0 )dding other comments........................................................................................................... 2:1 He(iewing changes.................................................................................................................. 2:3 1erging documents................................................................................................................. 2:A Comparing documents............................................................................................................. 2:A ,a(ing (ersions....................................................................................................................... 2:@

Chapter 1" Calc 4acros.................................................................................................."00


Cntroduction.............................................................................................................................. 300 !sing the macro recorder........................................................................................................ 300 0rite your own functions.......................................................................................................... 303 )ccessing cells directly............................................................................................................ 30: ,orting..................................................................................................................................... 311 Conclusion............................................................................................................................... 312

Chapter 1' Calc as a +imple %atabase..........................................................................'1'


Cntroduction.............................................................................................................................. 31< )ssociating a range with a name.............................................................................................31A ,orting..................................................................................................................................... 320 2ilters....................................................................................................................................... 321
LibreOffice ".# $alc Guide %

Calc functions similar to database functions............................................................................32* 5atabase+specific functions.....................................................................................................33@ Conclusion............................................................................................................................... 33E

Chapter 1& +etting up and Customi5ing Calc...............................................................''0


Cntroduction.............................................................................................................................. 3<0 #ibre;ffice options................................................................................................................... 3<0 #oading and sa(ing documents...............................................................................................3<A Calc options............................................................................................................................. 3<* 5efault colors for charts........................................................................................................... 3A: )utoCorrect functions.............................................................................................................. 3A: CustomiFing the user interface.................................................................................................3@0 )dding functionality with e3tensions........................................................................................3@E

Appendi. A 6eyboard +hortcuts....................................................................................'-0


Cntroduction.............................................................................................................................. 3E0 ote for 1ac users................................................................................................................... 3E0 a(igation and selection shortcuts..........................................................................................3E0 2unction -ey shortcuts............................................................................................................. 3E2 )rrow -ey shortcuts................................................................................................................. 3E3 Cell formatting shortcuts.......................................................................................................... 3E3 "i(ot table shortcuts................................................................................................................. 3E< Chart shortcuts........................................................................................................................ 3EA

Appendi. 7 %escription of Functions...........................................................................'77


2unctions a(ailable in Calc......................................................................................................3E* 1athematical functions............................................................................................................ 3E: 2inancial analysis functions.....................................................................................................3*< ,tatistical analysis functions....................................................................................................3:A 5ate and time functions........................................................................................................... <0< #ogical functions...................................................................................................................... <0E Cnformation functions................................................................................................................ <0* 5atabase functions.................................................................................................................. <10 )rray functions......................................................................................................................... <12 ,preadsheet functions............................................................................................................. <1< Te3t functions........................................................................................................................... <20 )dd+in functions....................................................................................................................... <2<

Appendi. C Calc #rror Codes.........................................................................................&"0


Cntroduction to Calc error codes...............................................................................................<30 Drror codes displayed within cells............................................................................................<31 General error codes................................................................................................................. <32

nde...................................................................................................................................&'&

&

LibreOffice ".# $alc Guide

Preface

8ho is this book for9


This boo- is for beginners to ad(anced user of Calc' the spreadsheet component of #ibre;ffice. You may be new to spreadsheet software' or you may be familiar with another program. Cf you ha(e ne(er used #ibre;ffice before' or you want an introduction to all of its components' you might li-e to read Getting Started with LibreOffice first. Cf you ha(e ne(er used spreadsheets before' you might also li-e to read a boo- or find some tutorials about the use of spreadsheets.

8hat:s in this book9


This boo- introduces the features and functions of #ibre;ffice Calc. Ct is not a tutorial on using spreadsheets. ,ome chapters assume familiarity with basic spreadsheet usage when describing how to use Calc. You can enter data $usually numerical& in a spreadsheet and then manipulate this data to produce certain results. )lternati(ely' you can enter data and then use Calc in a M0hat if...I manner by changing some of the data and obser(ing the results without ha(ing to retype all of the data. 2unctions can be used to create formulas to perform comple3 calculations on data. ,ome of the other features pro(ided by Calc include%

5atabase functions' to arrange' store' and filter data. 5ynamic charts% a wide range of 25 and 35 charts. 1acros' for recording and e3ecuting repetiti(e tas-sN scripting languages supported include
#ibre;ffice 4asic' "ython' 4ean,hell' and .a(a,cript.

)bility to open' edit' and sa(e 1icrosoftO D3celO and other spreadsheets. Cmport of spreadsheets from multiple formats' including /T1#' C,B' and "ost,cript. D3port of spreadsheets into multiple formats' including /T1#' C,B' and "52.

8here to get more help


This guide' the other #ibre;ffice user guides' the built+in /elp system' and user support systems assume that you are familiar with your computer and basic functions such as starting a program' opening and sa(ing files.

;elp system
#ibre;ffice comes with an e3tensi(e /elp system. This is your first line of support for using #ibre;ffice Calc. To display the full /elp system' press '# or go to ;elp < 2ibre=ffice ;elp on the main menu bar. Cn addition' you can choose whether to acti(ate (ips' )*tended tips' and the +elp ,gent by going to ,ools < =ptions < 2ibre=ffice < (eneral on the main menu bar. Cf (ips are enabled' place the mouse pointer o(er any of the icons to see a small bo3 $tooltip& with a brief e3planation of the icon function. 2or a more detailed e3planation' select ;elp < 8hat:s ,his9 ;n the main menu bar and hold the pointer o(er the icon.

Free online support


The #ibre;ffice community not only de(elops software' but pro(ides free' (olunteer+based support. ,ee Table 1 and this web page% http%//www.libreoffice.org/get+help/

LibreOffice ".# $alc Guide

!sers can get comprehensi(e online support from the community through mailing lists and the )s#ibre;ffice website' http%//as-.libreoffice.org/en/?uestions/. ;ther websites run by users also offer free tips and tutorials. This forum pro(ides community support for #ibre;ffice% http%//en.libreofficeforum.org/ This site pro(ides support for #ibre;ffice' among other programs% http%//forum.openoffice.org/en/forum/ (able #: 'ree support for LibreOffice users Free LibreOffice support
)s- #ibre;ffice 5ocumentation 2)Js 1ailing lists Juestions and answers from the #ibre;ffice community http%//as-.libreoffice.org/en/?uestions/ !ser guides' how+tos' and other documentation http%//www.libreoffice.org/get+help/documentation/ https%//wi-i.documentfoundation.org/5ocumentation/"ublications )nswers to fre?uently as-ed ?uestions http%//wi-i.documentfoundation.org/2a? 2ree community support is pro(ided by a networ- of e3perienced users http%//www.libreoffice.org/get+help/mailing+lists/ The #ibre;ffice website in your language http%//www.libreoffice.org/international+sites/ Cnternational mailing lists http%//wi-i.documentfoundation.org/#ocalP1ailingP#ists Cnformation about a(ailable accessibility options http%//www.libreoffice.org/get+help/accessibility/

Cnternational support

)ccessibility options

Paid support and training


)lternati(ely' you can pay for support ser(ices. ,er(ice contracts can be purchased from a (endor or consulting firm specialiFing in #ibre;ffice.

8hat you see may be different


llustrations
#ibre;ffice runs on 0indows' #inu3' and 1ac ;, Q operating systems' each of which has se(eral (ersions and can be customiFed by users $fonts' colors' themes' window managers&. The illustrations in this guide were ta-en from a (ariety of computers and operating systems. Therefore' some illustrations will not loo- e3actly li-e what you see on your computer display. )lso' some of the dialogs may be different because of the settings selected in #ibre;ffice. You can either use dialogs from your computer system $default& or dialogs pro(ided by #ibre;ffice. To change to using #ibre;ffice dialogs% 1& ;n #inu3 and 0indows operating systems' go to ,ools < =ptions < 2ibre=ffice < (eneral on the main menu bar to open the dialog for general options. ;n a 1ac operating system' go to 2ibre=ffice < Preferences < (eneral on the main menu bar to open the dialog for general options.

Preface

2& ,elect Use LibreOffice dialogs in Open Save dialogs and' in #inu3 and 1ac ;, Q operating systems only' in Print dialogs to display the #ibre;ffice dialogs on your computer display. 3& Clic- =6 to sa(e your settings and close the dialog.

cons
The icons used to illustrate some of the many tools a(ailable in #ibre;ffice may differ from the ones used in this guide. The icons in this guide ha(e been ta-en from a #ibre;ffice installation that has been set to display the Gala3y set of icons. Cf you wish' you can change your #ibre;ffice software pac-age to display Gala3y icons as follows% 1& ;n #inu3 and 0indows operating systems' go to ,ools < =ptions < 2ibre=ffice < >iew on the main menu bar to open the dialog for (iew options. ;n a 1ac operating system' go to 2ibre=ffice < Preferences < >iew on the main menu bar to open the dialog for (iew options. 2& Cn User interface / 0con si1e and st2le select Gala*2 from the options a(ailable in the drop+ down list. 3& Clic- =6 to sa(e your settings and close the dialog.
,ome #inu3 operating systems' for e3ample !buntu' include #ibre;ffice as part of the installation and may not include the Gala3y set of icons. You should be able to download the Gala3y icon set from the software repository for your #inu3 operating system.

?ote

*sing 2ibre=ffice on a 4ac


,ome -eystro-es and menu items are different on a 1ac from those used in 0indows and #inu3. The table below gi(es some common substitutions for the instructions in this chapter. 2or a more detailed list' see the application /elp. Windows or Linux
,ools < =ptions menu selection 3ight!clic4 $trl 6$ontrol7 '% '##

Mac equivalent
2ibre=ffice < Preferences $ontrol5clic4 or right!clic4 depending on computer setup

Effect
)ccess setup options ;pen a conte3t menu !sed with other -eys ;pen the a(igator ;pen the ,tyles and 2ormatting window

6$ommand7
ShiftRR'%

R(

8hat are all these things called9


The terms used in #ibre;ffice for most parts of the user interface $the parts of the program you see and use' in contrast to the behind+the+scenes code that actually ma-es it wor-& are the same as for most other programs. ) dialog is a special type of window. Cts purpose is to inform you of something' or re?uest input from you' or both. Ct pro(ides controls for you to use to specify how to carry out an action. The technical names for common controls are shown in 2igure 1. Cn most cases we do not use the

#8

LibreOffice ".# $alc Guide

technical terms in this boo-' but it is useful to -now them because the /elp and other sources of information often use them.

'igure #: Dialog showing common controls 1& 2& 3& <& Tabbed page $not strictly spea-ing a control&. Hadio buttons $only one can be selected at a time&. Chec-bo3 $more than one can be selected at a time&. ,pin bo3 $clic- the up and down arrows to change the number shown in the te3t bo3 ne3t to it' or type in the te3t bo3&. A& Thumbnail or pre(iew. @& 5rop+down list from which to select an item. E& "ush buttons. Cn most cases' you can interact only with the dialog $not the document itself& as long as the dialog remains open. 0hen you close the dialog after use $usually' clic-ing =6 or another button sa(es your changes and closes the dialog&' then you can again wor- with your document. ,ome dialogs can be left open as you wor-' so you can switch bac- and forth between the dialog and your document. )n e3ample of this type is the 2ind S Heplace dialog.

8ho wrote this book9


This boo- was written by (olunteers from the #ibre;ffice community. "rofits from sales of the printed edition will be used to benefit the community.

Preface

##

Acknowledgements
This boo- is adapted from OpenOffice.org 3.3 $alc Guide. The contributors to that boo- are% Hic- 4arnes "eter 6upfer 1artin 2o3 .ames )ndrew 6rishna )radhi )ndy 4rown ,tephen 4uc4ruce 4yfield icole Cairns T. .. 2raFier ,tigant 2yrwitful Cngrid /alama ,pencer D. /arpe Hegina /enschel "eter /illier+4roo.ohn 6ane 6ir- )bbott Dmma 6irsopp .ared 6obos ,igrid 6ronenberger ,helagh 1anton )le3andre 1artins 6ashmira "atel )nthony "etrillo )ndrew "itonyaCain Hoberts /aFel Hussman Gary ,chnabl Hob ,cott .acob ,tarr ,owbhagya ,undaresan i-ita Telang 4arbara 1 Tobias .ohn BiestenF .ean /ollis 0eber ,tefan 0eigel ,haron 0histon Claire 0ood #inda 0orthington 1ichele Tarri 1agnus )dielsson ,andeep ,amuel 1edi-onda

Fre@uently asked @uestions


;ow is 2ibre=ffice licensed9 #ibre;ffice is distributed under the ;pen ,ource Cnitiati(e $;,C& appro(ed #esser General "ublic #icense $#G"#&. The #G"# license is a(ailable from the #ibre;ffice website% http%//www.libreoffice.org/download/license/ 4ay distribute 2ibre=ffice to anyone9 Yes. ;ow many computers may install it on9 )s many as you li-e. 4ay sell it9 Yes. 4ay use 2ibre=ffice in my business9 Yes. s 2ibre=ffice available in my language9 #ibre;ffice has been translated $localiFed& into o(er <0 languages' so your language probably is supported. )dditionally' there are o(er E0 spelling' h2phenation' and thesaurus dictionaries a(ailable for languages and dialects that do not ha(e a localiFed program interface. The dictionaries are a(ailable from the #ibre;ffice website at www.libreoffice.org. ;ow can contribute to 2ibre=ffice9 You can help with the de(elopment and user support of #ibre;ffice in many ways' and you do not need to be a programmer. 2or e3ample' you can help with producing and maintaining written user documentation' producing (ideo tutorials' and other user support ser(ices. To start' see http%//www.documentfoundation.org/contribution/ You can also contribute by donating money' either when downloading the program or at any other time. ,ee http%//donate.libreoffice.org/

#9

LibreOffice ".# $alc Guide

4ay distribute the P%F of this book$ or print and sell copies9 Yes' as long as you meet the re?uirements of one of the licenses in the copyright statement at the beginning of this boo-. You do not ha(e to re?uest special permission. Cn addition' we re?uest that you share with the proGect some of the profits you ma-e from sales of boo-s' in consideration of all the wor- we ha(e put into producing them.

8hat:s new in 2ibre=ffice Calc &.19


(eneral
Cmpro(ed performance of ;5, $;pen5ocument ,preadsheet& document import. 0hen opening ;5, and Q#,Q files' the (alues of formulas can optionally be shown as
they were sa(ed in the files without recalculating the formula. This option is found in ,ools < =ptions < 2ibre=ffice Calc < Formula < 3ecalculation on file load. This ma-es opening of larger files faster' and showing the (alues as they were last edited may be an ad(antage when opening spreadsheets sa(ed in D3cel.

)utomatically rotate chart a3is labels if they are o(erlapping. This fi3 also impro(es
detection of o(erlap while rotating labels

,a(e settings of Te3t Cmport 5ialog for Te3t to Columns and "aste !nformatted Te3t from
Clipboard $in addition to Te3t 2ile Cmport&.

D3port color scales and data bars to Q#,Q $also supports D3cel 2010R e3tensions for
databars&.

Cncreased siFe limit on $uncompressed& ;52 documents from 2Gb to <Gb. ,upport Utype+aheadU search in the autofilter popup. Ct is now possible to search for specific
entry using -ey input.

Dnhanced chart (isualisation% better ?uality rendering for printing and "52 e3port of charts. ew conditional formats% date formats' top/bottom rules' string rules. Cmpro(ed conditional format dialogs. ;(erlapping conditional formats. D3porting a single chart as an image $" G' ."G&. Q1# ,ource dialog to ?uic-ly import arbitrary Q1# content.

Formula engine

ew configuration option to toggle handling of empty strings when used in arithmetic e3pressions. ew pricing add+Cn containing spreadsheet functions for option pricing' in particular barrier $;"TP4)HHCDH$...&& and touch $;"TPT;!C/$...&& options. ew spreadsheet functions Q;H' )BDH)GDC2' ,!1C2,' )BDH)GDC2, and C;! TC2, as defined in ;52 ;pen2ormula.

He+implemented H) 5$& function with better random number generation algorithm. ew spreadsheet functions C2DHH;H and C2 ) as defined in ;52 ;pen2ormula.

Pivot table
,upport for multiple selections in the page field of a pi(ot table.

Preface

#3

8hat:s new in 2ibre=ffice Calc &.19


(eneral
Dmbedding fonts in a Calc spreadsheet. )dded a stepped lines type to #ine and QY $,catter& graphs. Counting the number of selected cells.

Formula engine
ew spreadsheet function !14DHB)#!D as defined in ;52 ;pen2ormula. ew spreadsheet function ,6D0" as defined in ;52 ;pen2ormula. Cmport/e3port functions new in D3cel 2013 for ;52 ;pen2ormula compatibility. The following functions are handled' name specialties are gi(en as $in parentheses the
Calc en+!, !C name& Vin brac-ets the ;522 nameW )C;T' )C;T/' )H)4CC' 4),D' 4C ;1.5C,T.H) GD $4& V4C ;1.5C,T.H) GDW' 4CT) 5' 4CT#,/C2T' 4CT;H' 4CTH,/C2T' 4CTQ;H' C;14C )' C;T' C;T/' C,C' C,C/' 5)Y,' 5DCC1)#' 2;H1!#)TDQT $2;H1!#)& V2;H1!#)W' G)11)' G)!,,' C2 )' C1C;,/' C1C;T' C1C,C' C1C,C/' C1,DC' C1,DC/' C1,C /' C1T) ' C,2;H1!#)' 1! CT' !14DHB)#!D' "5!H)TC; $5!H)TC; & V"5!H)TC; W' "DH1!T)TC; )' "/C' HHC' ,DC' ,DC/' ,/DDT' ,/DDT,' ,6D0." $,6D0"& V,6D0"W' ! CC/)H' ! CC;5D' Q;H

#"

LibreOffice ".# $alc Guide

$hapter # 0ntroducing $alc


Using Spreadsheets in LibreOffice

8hat is Calc9
Calc is the spreadsheet component of #ibre;ffice. You can enter data $usually numerical& in a spreadsheet and then manipulate this data to produce certain results. )lternati(ely' you can enter data and then use Calc in a M0hat if...I manner by changing some of the data and obser(ing the results without ha(ing to retype the entire spreadsheet or sheet. ;ther features pro(ided by Calc include%

2unctions' which can be used to create formulas to perform comple3 calculations on data. 5atabase functions to arrange' store' and filter data. 5ynamic charts gi(ing a wide range of 25 and 35 charts. 1acros for recording and e3ecuting repetiti(e tas-sN scripting languages supported include #ibre;ffice 4asic' "ython' 4ean,hell' and .a(a,cript.

)bility to open' edit' and sa(e 1icrosoft D3cel spreadsheets. Cmport and e3port of spreadsheets in multiple formats' including /T1#' C,B' "52' and
"ost,cript.
Cf you want to use macros written in 1icrosoft D3cel using the B4) macro code in #ibre;ffice' you must first edit the code in the #ibre;ffice 4asic C5D editor. 2or more information' see $hapter #9 $alc :acros in this guide or Getting Started Guide $hapter #3 Getting Started with :acros.

?ote

+preadsheets$ sheets$ and cells


Calc wor-s with elements called spreadsheets. ,preadsheets consist of a number of indi(idual sheets' each sheet containing cells arranged in rows and columns. ) particular cell is identified by its row number and column letter. Cells hold the indi(idual elements X te3t' numbers' formulas' and so on X that ma-e up the data to display and manipulate. Dach spreadsheet can ha(e many sheets' and each sheet can ha(e many indi(idual cells. Cn Calc' each sheet can ha(e a ma3imum of 1'0<*'AE@ rows and a ma3imum of 102< columns.

Calc main dialog


0hen Calc is started' the main window opens and the (arious parts of this dialog are e3plained below $2igure 2&.
Cf any part of the Calc window in 2igure 2 is not shown' you can display it using the Biew menu. 2or e3ample' >iew < +tatus 7ar on the main menu bar will toggle $show or hide& the ,tatus 4ar. Ct is not always necessary to display all the parts' as shownN you can show or hide any of them as desired.

?ote

,itle bar
The Title bar' located at the top' shows the name of the current spreadsheet. 0hen the spreadsheet is newly created' its name is Untitled ;' where ; is a number. 0hen you sa(e a spreadsheet for the first time' you are prompted to enter a name of your choice.

#&

LibreOffice ".# $alc Guide

'igure 9: $alc main dialog

4enu bar
!nder the Title bar is the 1enu bar. 0hen you choose one of the menus' a sub+menu appears with other options. You can also modify 1enu bar' see $hapter #" Setting Up and $ustomi1ing $alc in this guide and Getting Started Guide $hapter #" $ustomi1ing LibreOffice for more information.

File X contains commands that apply to the entire documentN for e3ample Open' Save'
<i1ards' )*port as PD'' Print= Digital Signatures and so on.

#dit X contains commands for editing the documentN for e3ample Undo' $op2' $hanges'
'ill' Plug!in and so on.

>iew A contains commands for modifying how the Calc user interface loo-sN for e3ample
(oolbars' $olumn > 3ow +eaders' 'ull Screen' ?oom and so on.

nsert X contains commands for inserting elements into a spreadsheetN for e3ample $ells' 3ows' $olumns' Sheets' Picture and so on. Page' St2les and 'ormatting' ,lignment and so on.

Format X contains commands for modifying the layout of a spreadsheetN for e3ample $ells' ,ools X contains (arious functions to help you chec- and customiFe your spreadsheet' for
e3ample Spelling' Share Document' Galler2' :acros and so on.

%ata X contains commands for manipulating data in your spreadsheetN for e3ample Define
3ange' Sort' $onsolidate and so on.

8indow X contains commands for the display windowN for e3ample @ew <indow' Split and
so on.

;elp X contains lin-s to the help system included with the software and other
miscellaneous functionsN for e3ample +elp' License 0nformation' $hec4 for Updates and so on.

$hapter # 0ntroducing $alc

#A

,oolbars
The default setting when Calc opens is for the ,tandard and 2ormatting toolbars to be doc-ed at the top of the wor-space $2igure 2&. Calc toolbars can be either doc-ed and fi3ed in place' or floating allowing you to mo(e a toolbar into a more con(enient position on your wor-space. 5oc-ed toolbars can be undoc-ed and mo(ed to different doc-ed position on the wor-space or undoc-ed to become a floating toolbar. Toolbars that are floating when opened can be doc-ed into a fi3ed position on your wor-space. To display' hide' mo(e' create floating toolbars and for more information on toolbars' see the Getting Started Guide $hapter # 0ntroducing LibreOffice. The default set of icons $sometimes called buttons& on toolbars pro(ide a wide range of common commands and functions. You can also remo(e or add icons to toolbars' see the $hapter #"= Setting Up and $ustomi1ing $alc in this guide and the Getting Started Guide $hapter #" $ustomi1ing LibreOffice for more information. "lacing the mouse cursor o(er any of the icons displays a small bo3 called a tooltip. Ct gi(es a brief e3planation of the icon function. 2or a more detailed e3planation' go to ;elp < 8hats ,his9 on the main menu bar and ho(er the mouse pointer o(er the icon. To close a tooltip' clic- once away from the icon or press the )sc -ey. Tips and e3tended tips can be turned on or off from ,ools < =ptions < 2ibre=ffice < (eneral on the main menu bar.

Formula 7ar
The 2ormula 4ar is located at the top of the sheet in your Calc wor-space. The 2ormula 4ar is permanently doc-ed in this position and cannot be used as a floating toolbar. Cf the 2ormula 4ar is not (isible' go to >iew < Formula 7ar on the main menu bar.

'igure 3: 'ormula Bar Going from left to right and referring to 2igure 3' the 2ormula 4ar consists of the following%

?ame 7o. X gi(es the cell reference using a combination of a letter and number' for
e3ample )1. The letter indicates the column and the number indicates the row of the selected cell.

Function 8i5ard

X opens a dialog from which you can search through a list of a(ailable functions. This can be (ery useful because it also shows how the functions are formatted. X clic-ing on the ,um icon totals the numbers in the cells abo(e the selected cell and then places the total in the selected cell. Cf there are no numbers abo(e the selected cell' then the cells to the left are totaled. X clic-ing on the 2unction icon inserts an e?uals $Y& sign into the selected cell and the nput line allowing a formula to be entered. nput line X displays the contents of the selected cell $data' formula' or function& and allows you to edit the cell contents. To edit inside the Cnput line area' clic- in the area' then type your changes. To edit within the current cell' Gust double+clic- in the cell. cell. 0hen you enter new data into a cell' the ,um and 2unction icons change to Cancel and Accept icons .

+um

Function

You can also edit the contents of a cell directly in the cell itself by double+clic-ing on the

#-

LibreOffice ".# $alc Guide

?ote

Cn a spreadsheet the term function co(ers much more than Gust mathematical functions. ,ee $hapter A Using 'ormulas and 'unctions in this guide for more information.

+preadsheet layout
ndividual 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. )t the top of the columns and the left end of the rows are a series of header bo3es containing letters and numbers. The column headers use an alpha character starting at ) and go on to the right. The row headers use a numerical character starting at 1 and go down. These column and row headers form the cell references that appear in the ame 4o3 on the 2ormula 4ar $2igure 3&. Cf the headers are not (isible on your spreadsheet' go to >iew < Column B 3ow ;eaders on the main menu bar.

!"eet tabs
Cn Calc you can ha(e more than one sheet in a spreadsheet. )t the bottom of the grid of cells in a spreadsheet are sheet tabs indicating how many sheets there are in your spreadsheet. Clic-ing on a tab enables access to each indi(idual sheet and displays that sheet. )n acti(e sheet is indicated with a white tab $default Calc setup&. You can also select multiple sheet by holding down the $trl -ey while you clic- on the sheet tabs. To change the default name for a sheet $,heet1' ,heet2' and so on&% 1& Hight+clic- on the sheet tab and select 3ename +heet from the conte3t menu. ) dialog opens allowing you to type in a new name for the sheet. 2& Clic- =6 when finished to close the dialog. To change the color of a sheet tab% 1& Hight+clic- on the sheet tab and select ,ab Color from the conte3t menu to open the Tab Color dialog $2igure <&. 2& ,elect your color and clic- =6 when finished to close the dialog.

'igure ": (ab $olor dialog

$hapter # 0ntroducing $alc

#.

3& To add new colors to this color palette' see the Getting Started Guide $hapter #" $ustomi1ing LibreOffice for more information.

!tatus bar
The Calc status bar $2igure A& pro(ides information about the spreadsheet and con(enient ways to ?uic-ly change some of its features. 1ost of the fields are similar to those in other components of #ibre;fficeN see $hapter # 0ntroducing LibreOffice in this guide and the $alc Guide $hapter # 0ntroducing $alc for more information.

'igure %: $alc status bar The (arious fields on the ,tatus 4ar' from left to right' are as follows. +heet se@uence number ,hows the se?uence number of the current sheet and the total number of sheets in the spreadsheet. The se?uence number may not be the same as the name on the sheet tab if sheets ha(e been mo(ed. 5ouble+clic- on this Fone to open the a(igator. Page style ,hows the page style of the current sheet. To edit the page style' double+clic- on this field and the "age ,tyle dialog opens. nsert mode ,hows the type of insert mode the program is in. "ress the 0ns -ey to change modes. This field is blan- if the program is in insert mode and Overwrite shows when in o(erwrite mode. +election mode Clic- to open a conte3t menu and toggle between Standard selection' )*tended selection' ,dding selection or Bloc4 selection. The icon does not change when different selection modes are selected' but the tooltip shows the current status.

Standard selection X clic- in te3t or cell where you want to position the cursor and ma-e the
cell acti(e. )ny other selection is then deselected.

)*tend selection X clic-ing in the te3t either e3tends or crops the current selection. ,dding selection X a new selection is added to an e3isting selection. The result is a multiple
selection.

Bloc4 selection X a bloc- of te3t can be selected.


*nsaved changes This icon indicates if there are any unsa(ed changes that ha(e not been sa(ed. 5ouble+clicthis icon or use File < +ave to sa(e the spreadsheet. %igital signature Cf the document has been digitally signed' an icon shows here. You can double+clic- the icon to (iew the certificate. ,ee $hapter & Printing= )*porting= and )!mailing in this guide for more information about digital signatures. ) document can only be digitally signed after it has been sa(ed.
98 LibreOffice ".# $alc Guide

Cell or obCect information 5isplays information rele(ant to the position of the cursor or the selected element of the spreadsheet. 0hen a group of cells is selected' the sum of the contents is displayed by default. Hight+clic- on this field and select other functions' such as the a(erage (alue' ma3imum (alue' minimum (alue' or count $number of items selected&. Doom slider 5rag the Foom slider' or clic- the E and A signs to change the (iew magnification. Doom percentage Cndicates the magnification le(el of the document. Hight+clic- on the percentage figure to open a list of magnification (alues from which to choose. 5ouble+clic-ing on this percentage figure opens the Doom B >iew 2ayout dialog.

Creating$ opening and saving spreadsheets


Creating and opening
Creating and opening spreadsheets is identical to creating and opening documents to the other modules within #ibre;ffice. 2or more information on creating and opening spreadsheets' see the Getting Started Guide $hapter # 0ntroducing LibreOffice.

*sing templates
Calc documents can also be created from templates. 2or information on how to create and use templates' see the Getting Started Guide $hapter 3 Using St2les and (emplates and $hapter " Using St2les and (emplates in $alc in this guide.

=pening C+> files


Comma+separated+(alues $C,B& files are spreadsheet files in a te3t format where cell contents are separated by a character' for e3ample comma' semi+colon' and so on. Dach line in a C,B te3t file represents a row in a spreadsheet. Te3t is entered between ?uotation mar-sN numbers are entered without ?uotation mar-s. To open a C,B file in Calc% 1& Choose File < =pen on the main menu bar and locate the C,B file that you want to open. 2& ,elect the file and clic- =pen. 4y default' a C,B file has the e3tension .csv. /owe(er' some C,B files may ha(e a .txt e3tension. 3& The ,e.t mport dialog $2igure @& opens allowing you to select the (arious options a(ailable when importing a C,B file into a Calc spreadsheet. <& Clic- =6 to open and import the file. The (arious options for importing C,B files into a Calc spreadsheet are as follows%

mport

$haracter Set X specifies the character set to be used in the imported file. Language X determines how the number strings are imported. Cf #anguage is set to 5efault for C,B import' Calc will use the globally set language. Cf #anguage is set to a specific language' that language will be used when importing numbers. 'rom 3ow X specifies the row where you want to start the import. The rows are (isible in the pre(iew window at the bottom of the dialog.

$hapter # 0ntroducing $alc

9#

'igure &: (e*t 0mport dialog

+eparator =ptions X specifies whether your data uses separators or fi3ed widths as
delimiters.

'i*ed width X separates fi3ed+width data $e?ual number of characters& into columns. Clic- on the ruler in the pre(iew window to set the width. Separated b2 X select the separator used in your data to delimit the data into columns. 0hen you select Other' you specify the character used to separate data into columns. This custom separator must also be contained in your data. :erge delimiters X combines consecuti(e delimiters and remo(es blan- data fields. (e*t delimiter X select a character to delimit te3t data.

=ther options Cuoted fields as te*t X when this option is enabled' fields or cells whose (alues are
?uoted in their entirety $the first and last characters of the (alue e?ual the te3t delimiter& are imported as te3t.

Detect special numbers X when this option is enabled' Calc will automatically detect all number formats' including special number formats such as dates' time' and scientific notation. The selected language also influences how such special numbers are detected' since different languages and regions many ha(e different con(entions for such special numbers. 0hen this option is disabled' Calc will detect and con(ert only decimal numbers. The rest' including numbers formatted in scientific notation' will be imported as te3t. ) decimal number string can ha(e digits 0+:' thousands separators' and a decimal separator. Thousands separators and decimal separators may (ary with the selected language and region.
LibreOffice ".# $alc Guide

99

Fields X shows how your data will loo- when it is separated into columns. $olumn t2pe X select a column in the pre(iew window and select the data type to be
applied to the imported data.

Standard X Calc determines the type of data. (e*t X imported data are treated as te3t. US )nglish X numbers formatted in !, Dnglish are searched for and included regardless of the system language. ) number format is not applied. Cf there are no !, Dnglish entries' the Standard format is applied. +ide X the data in the column are not imported.

+aving spreadsheets
2or information on how to sa(e files manually or automatically' see the Getting Started Guide $hapter # 0ntroducing LibreOffice. Calc can sa(e spreadsheets in a range of formats and also e3port spreadsheets to "52' /T1# and Q/T1# file formatsN see $hapter & Printing= )*porting= and )!mailing in this guide for more information.

+aving in other formats


Cf you need to e3change files with users who are unable to recei(e spreadsheet files in ;pen 5ocument 2ormat $;52& $*.ods&' which Calc uses as default format' you can sa(e a spreadsheet in another format. 1& ,a(e your spreadsheet in Calc spreadsheet file format $*.ods&.

'igure A. Save dialog


$hapter # 0ntroducing $alc 93

2& ,elect File < +ave As on the main menu bar to open the +ave dialog $2igure E&. 3& Cn ame' if you wish' enter a new file name for the spreadsheet and select the folder where you want to sa(e the file. <& Cn drop+down menu below the file browser window' select the type of spreadsheet format you want to use and clic- +ave. A& Dach time you clic- +ave when you are sa(ing in a format other than ;52 format' the Confirm File Format dialog opens $2igure *&. Clic- *se F...G Format to continue sa(ing in your selected spreadsheet format or clic- *se =%F Format to sa(e the spreadsheet in Calc ;5, format. @& Cf you select ,e.t C+> format $*.csv& for your spreadsheet' the #.port ,e.t File dialog $2igure :& opens allowing you to select the character set' field delimiter' te3t delimiter and so on to be used for your C,B file.
;nce you ha(e sa(ed a spreadsheet in another format' all changes you ma-e to the spreadsheet will now occur only in the format you are using because you ha(e changed the name and file type of your document. Cf you want to go bac- to wor-ing with an Z.ods (ersion' you must open the spreadsheet again.

?ote

'igure -. $onfirm 'ile 'ormat dialog

'igure .. )*port (e*t 'ile dialog


To ha(e Calc sa(e documents by default in a 1icrosoft D3cel file format' go to ,ools < =ptions < 2oadH+ave < (eneral. Cn the section named Default file format and OD' settings' under Document t2pe' select +preadsheet' then under ,lwa2s save as' select your preferred file format.

,ip

9"

LibreOffice ".# $alc Guide

Password protection
To protect a spreadsheet and restrict who can open' read' and ma-e changes to a spreadsheet' you ha(e to use password protection. "assword protection is common to all modules within #ibre;ffice and more information can be found in the Getting Started Guide $hapter # 0ntroducing LibreOffice.

?avigating within spreadsheets


Calc pro(ides many ways to na(igate within a spreadsheet from cell to cell and sheet to sheet. You can generally use the method you prefer.

Cell navigation
0hen a cell is selected or in focus' the cell borders are emphasiFed. 0hen a group of cells is selected' the cell area is colored. The color of the cell border emphasis and the color of a group of selected cells depends on the operating system being used and how you ha(e set up #ibre;ffice.

*sing the mouse X place the mouse pointer o(er the cell and clic- the left mouse button.
To mo(e the focus to another cell using the mouse' simply mo(e the mouse pointer to the cell where you want the focus to be and clic- the left mouse button.

*sing a cell reference X highlight or delete the e3isting cell reference in the ame 4o3 on
the 2ormula 4ar $2igure 3 on page 1*&. Type the new cell reference of the cell you want to mo(e to and press )nter -ey. Cell references are case insensiti(e% for e3ample' typing a3 or )3 will mo(e the focus to cell )3.

*sing the ?avigator X clic- on the ?avigator icon

on the ,tandard toolbar or press the '% -ey to open the ?avigator dialog $2igure 10&. Type the cell reference into the Column and How fields and press the )nter -ey.

'igure #8: @avigator dialog in $alc

*sing the #nter key X pressing )nter mo(es the cell focus down in a column to the ne3t
row. "ressing Shift5)nter mo(es the focus up in a column to the ne3t row.

*sing the ,ab key X pressing (ab mo(es the cell focus right in a row to the ne3t column.
"ressing Shift5(ab mo(es the focus to the left in a row to the ne3t column.
$hapter # 0ntroducing $alc 9%

*sing the arrow keys X pressing the arrow -eys on the -eyboard mo(es the cell focus in
the direction of the arrow pressed.

*sing ;ome$ #nd$ Page *p and Page %own +ome mo(es the cell focus to the start of a row. )nd mo(es the cell focus to the last cell on the right in the row that contains data. Page Down mo(es the cell focus down one complete screen display. Page Up mo(es the cell focus up one complete screen display.

+heet navigation
Dach sheet in a spreadsheet is independent of the other sheets' though references can be lin-ed from one sheet to another. There are three ways to na(igate between different sheets in a spreadsheet.

*sing the ?avigator X when the a(igator is open $2igure 10&' double+clic-ing on any of
the listed sheets selects the sheet.

*sing the keyboard X using -ey combinations $trl5Page Down mo(es one sheet to the
right and $trl5Page Up mo(es one sheet to the left.

*sing the mouse X clic-ing on one of the sheet tabs at the bottom of the spreadsheet
selects that sheet. Cf there are a lot of sheets in your spreadsheet' then some of the sheet tabs may be hidden behind the horiFontal scroll bar at the bottom of the screen. Cf this is the case' using the four buttons to the left of the sheet tabs can mo(e the tabs into (iew $2igure 11&.

'igure ##. @avigating sheet tabs

?ote

The sheet tab arrows that appear in 2igure 11 are only acti(e if there are sheet tabs that cannot be seen. 0hen you insert a new sheet into your spreadsheet' Calc automatically uses the ne3t number in the numeric se?uence as a name. 5epending on which sheet is open when you insert a new sheet' your new sheet may not be in numerical order. Ct is recommended to rename sheets in your spreadsheet to ma-e them more recogniFable.

?ote

9&

LibreOffice ".# $alc Guide

6eyboard navigation
"ressing a -ey or a combination of -eys allows you to na(igate a spreadsheet using the -eyboard. ) -ey combination is where you press more than one -ey together' for e3ample $trl5+ome -ey combination to mo(e to cell )1. Table 2 lists the -eys and -ey combinations you can use for spreadsheet na(igation in Calc. (able 9. De2board cell navigation #e$board s"ortcut
$trl5

Cell navi%ation
1o(es cell focus right one cell 1o(es cell focus left one cell 1o(es cell focus up one cell 1o(es cell focus down one cell 1o(es cell focus to the first column on the right containing data in that row if cell focus is on a blan- cell. 1o(es cell focus to the last column on the right containing data in that row if cell focus is on a cell containing data. 1o(es cell focus to the last column on the right in the spreadsheet if there are no more cells containing data.

$trl5

1o(es cell focus to the last column on the left containing data in that row if cell focus is on a blan- cell. 1o(es cell focus to the first column on the left containing data in the spreadsheet if cell focus is on a cell containing data. 1o(es cell focus to the first column in that row if there are no more cells containing data.

$trl5

1o(es cell focus from a blan- cell to the first cell abo(e containing data in the same column. 1o(es cell focus from a cell containing data to the cell in How 1 in the same column.

$trl5

1o(es cell focus from a blan- cell to the first cell below containing data in the same column. 1o(es cell focus from a cell containing data to the last cell containing data in the same column. 1o(es cell focus from the last cell containing data to the cell in the same column in the last row of the spreadsheet.

$trl5+ome $trl5)nd

1o(es cell focus from anywhere on the spreadsheet to Cell )1 on the same sheet. 1o(es cell focus from anywhere on the spreadsheet to the last cell in the lower right+hand corner of the rectangular area of cells containing data on the same sheet. 1o(es cell focus one screen to the right $if possible&. 1o(es cell focus one screen to the left $if possible&. 1o(es cell focus to the same cell on the ne3t sheet to the right in sheet tabs if the spreadsheet has more than on sheet.

,lt5Page Down ,lt5Page Up $trl5Page Down

$hapter # 0ntroducing $alc

9A

#e$board s"ortcut
$trl5Page Up (ab Shift5(ab )nter Shift5)nter

Cell navi%ation
1o(es cell focus to the same cell on the ne3t sheet to the left in sheet tabs if the spreadsheet has more than on sheet. 1o(es cell focus to the ne3t cell on the right 1o(es cell focus to the ne3t cell on the left 5own one cell $unless changed by user& !p one cell $unless changed by user&

Customi5ing the #nter key


You can choose the direction in which the )nter -ey mo(es the cell focus by going to ,ools < =ptions < 2ibre=ffice Calc < (eneral. ,elect the direction cell focus mo(es from the drop+down list. 5epending on the file being used or the type of data being entered' setting a different direction can be useful. The )nter -ey can also be used to switch into and out of editing mode. !se the first two options under 0nput settings in 2igure 12 to change the )nter -ey settings.

'igure #9: $ustomi1ing the )nter 4e2

+electing items in a sheet or spreadsheet


+electing cells
!in%le cell
#eft+clic- in the cell. You can (erify your selection by loo-ing in the $2igure 3 on page 1*&. ame 4o3 on the 2ormula 4ar

&an%e of conti%uous cells


) range of cells can be selected using the -eyboard or the mouse. To select a range of cells by dragging the mouse cursor% 1& Clic- in a cell. 2& "ress and hold down the left mouse button. 3& 1o(e the mouse around the screen. <& ;nce the desired bloc- of cells is highlighted' release the left mouse button.

9-

LibreOffice ".# $alc Guide

To select a range of cells without dragging the mouse% 1& Clic- in the cell which is to be one corner of the range of cells. 2& 1o(e the mouse to the opposite corner of the range of cells. 3& /old down the Shift -ey and clic-.
You can also select a contiguous range of cells by first clic-ing in the +election mode field on the ,tatus 4ar $2igure A on page 20& and selecting #.tending selection before clic-ing in the opposite corner of the range of cells. 1a-e sure to change bac- to +tandard selection or you may find yourself e3tending a cell selection unintentionally.

,ip

To select a range of cells without using the mouse% 1& ,elect the cell that will be one of the corners in the range of cells. 2& 0hile holding down the Shift -ey' use the cursor arrows to select the rest of the range.
You can also directly select a range of cells using the ame 4o3. Clic- into the ame 4o3 on the 2ormula 4ar $2igure 3 on page 1*&. To select a range of cells' enter the cell reference for the upper left+hand cell' followed by a colon $%&' and then the lower right+hand cell reference. 2or e3ample' to select the range that would go from )3 to C@' you would enter ,3:$&.

,ip

&an%e of non'conti%uous cells


1& ,elect the cell or range of cells using one of the methods abo(e. 2& 1o(e the mouse pointer to the start of the ne3t range or single cell. 3& /old down the Ctrl -ey and clic- or clic-+and+drag to select another range of cells to add to the first range. <& Hepeat as necessary.

+electing columns and rows


!in%le colu(n or row
To select a single column' clic- on the column header $2igure 2 on page 1E&. To select a single row' clic- on the row header.

Multiple colu(ns or rows


To select multiple columns or rows that are contiguous% 1& Clic- on the first column or row in the group. 2& /old down the Shift -ey. 3& Clic- the last column or row in the group. To select multiple columns or rows that are not contiguous% 1& Clic- on the first column or row in the group. 2& /old down the $trl -ey. 3& Clic- on all of the subse?uent columns or rows while holding down the Ctrl -ey.

$hapter # 0ntroducing $alc

9.

Entire s"eet
To select the entire sheet' clic- on the small bo3 between the column headers and the row headers $2igure 13&' or use the -ey combination $trl5, to select the entire sheet' or go to #dit on the main menu bar and select +elect All.

'igure #3. Select ,ll bo*

+electing sheets
You can select either one or multiple sheets in Calc. Ct can be ad(antageous to select multiple sheets' especially when you want to ma-e changes to many sheets at once.

!in%le s"eet
Clic- on the sheet tab for the sheet you want to select. The tab for the selected sheet becomes white $default Calc setup&.

Multiple conti%uous s"eets


To select multiple contiguous sheets% 1& Clic- on the sheet tab for the first desired sheet. 2& 1o(e the mouse pointer o(er the sheet tab for the last desired sheet. 3& /old down the Shift -ey and clic- on the sheet tab. <& )ll tabs between these two selections will turn white $default Calc setup&. )ny actions that you perform will now affect all highlighted sheets.

Multiple non'conti%uous s"eets


To select multiple non+contiguous sheets% 1& Clic- on the sheet tab for the first desired sheet. 2& 1o(e the mouse pointer o(er the sheet tab for the second desired sheet. 3& /old down the $trl -ey and clic- on the sheet tab. <& Hepeat as necessary. A& The selected tabs will turn white $default Calc setup&. )ny actions that you perform will now affect all highlighted sheets.

)ll s"eets
Hight+clic- a sheet tab and choose +elect All +heets from the conte3t menu.

38

LibreOffice ".# $alc Guide

8orking with columns and rows


nserting columns and rows
0hen you insert a column' it is inserted to the left of the highlighted column. 0hen you insert a row' it is inserted above the highlighted row. 0hen you insert columns or rows' the cells ta-e the formatting of the corresponding cells in the ne3t column to left or the row abo(e.

?ote

!in%le colu(n or row


!sing the nsert menu% 1& ,elect a cell' column' or row where you want the new column or row inserted. 2& Go to nsert on the main menu bar and select either nsert < Columns or nsert < 3ows. !sing the mouse% 1& ,elect a column or row where you want the new column or row inserted. 2& Hight+clic- the column or row header. 3& ,elect nsert Columns 2eft or nsert 3ows Above from the conte3t menu.

Multiple colu(ns or rows


1ultiple columns or rows can be inserted at once rather than inserting them one at a time. 1& /ighlight the re?uired number of columns or rows by holding down the left mouse button on the first one and then dragging across the re?uired number of identifiers. 2& "roceed as for inserting a single column or row abo(e.

%eleting columns and rows


!in%le colu(n or row
To delete a single column or row% 1& ,elect a cell in the column or row you want to delete'. 2& Go to #dit on the main menu bar and select %elete Cells or right+clic- and select %elete from the conte3t menu. 3& ,elect the option you re?uire from the %elete Cells dialog $2igure 1<&.

'igure #": Delete $ells dialog )lternati(ely% 1& Clic- in the column or header to select the column or row. 2& Go to #dit on the main menu bar and select %elete Cells or right+clic- and select %elete +elected Columns or %elete +elected 3ows from the conte3t menu.
$hapter # 0ntroducing $alc 3#

Multiple colu(ns or rows


To delete multiple columns or rows% 1& ,elect the columns or rows' see K1ultiple columns or rowsL on page 2: for more information. 2& Go to #dit on the main menu bar and select %elete Cells' or right+clic- and select %elete from the conte3t menu' or right+clic- in the column or row header and select %elete +elected Columns or %elete +elected 3ows from the conte3t menu.

8orking with sheets


nserting new sheets
Clic- on the Add +heet icon . This inserts a new sheet after the last sheet in the spreadsheet without opening the nsert +heet dialog. The following methods open the nsert +heet dialog $2igure 1A& where you can position the new sheet' create more than one sheet' name the new sheet' or select a sheet from a file.

,elect the sheet where you want to insert a new sheet' then go to nsert < +heet on the
main menu bar.

Hight+clic- on the sheet tab where you want to insert a new sheet and select nsert +heet
from the conte3t menu.

Clic- in the empty space at the end of the sheet tabs. Hight+clic- in the empty space at the end of the sheet tabs and select nsert +heet from
the conte3t menu.

'igure #%: 0nsert Sheet dialog

4oving and copying sheets


You can mo(e or copy sheets within the same spreadsheet by dragging and dropping or using the 4oveHCopy +heet dialog $2igure 1@&. To mo(e or copy a sheet into a different spreadsheetN you ha(e to use the 4oveHCopy +heet dialog.

39

LibreOffice ".# $alc Guide

*ra%%in% and droppin%


To mo(e a sheet to a different position within the same spreadsheet' clic- on the sheet tab and drag it to its new position before releasing the mouse button. To copy a sheet within the same spreadsheet' hold down the $trl -ey $Option -ey on 1ac& then clic- on the sheet tab and drag it to its new position before releasing the mouse button. The mouse pointer may change to include a plus sign depending on the setup of your operating system.

'igure #&: :ove $op2 Sheet dialog

+sin% Move,Cop$ !"eet dialo%


The 4oveHCopy +heet dialog allows you to specify e3actly whether you want the sheet in the same or a different spreadsheet' its position within the spreadsheet' the sheet name when you mo(e or copy the sheet. 1& Cn the current document' right+clic- on the sheet tab you wish to mo(e or copy and select 4oveHCopy +heet from the conte3t menu or go to #dit < +heet < 4oveHCopy on the main menu bar. 2& ,elect 4ove to mo(e the sheet or Copy to copy the sheet. 3& ,elect the spreadsheet where you want the sheet to be placed from the drop+down list in ,o document. This can be the same spreadsheet' another spreadsheet already open' or you can create a new spreadsheet. <& ,elect the position in nsert before where you want to place the sheet. A& Type a name in the ?ew name te3t bo3 if you want to rename the sheet when it is mo(ed or copied. Cf you do not enter a name' Calc creates a default name $,heet 1' ,heet 2' and so on&. @& Clic- =6 to confirm the mo(e or copy and close the dialog.

?ote

0hen you mo(e or copy to another spreadsheet or a new spreadsheet' a conflict may occur with formulas lin-ed to other sheets in the pre(ious location.

$hapter # 0ntroducing $alc

33

%eleting sheets
To delete a single sheet' right+clic- on the sheet tab you want to delete and select %elete +heet from the conte3t menu' or go to #dit < +heet < %elete on the main menu bar. Clic- Ies to confirm the deletion. To delete multiple sheets' select the sheets $see K,electing sheetsL on page 30&' then right+clicone of the sheet tabs and select %elete +heet from the conte3t menu' or go to #dit < +heet < %elete on the main menu bar. Clic- Ies to confirm the deletion.

3enaming sheets
4y default' the name for each new sheet added is Sheet;' where ; is the number of the ne3t sheet to be added. 0hile this wor-s for a small spreadsheet with only a few sheets' it can become difficult to identify sheets when a spreadsheet contains many sheets.. You can rename a sheet using one of the following methods%

Dnter the name in the ?ame te3t bo3 when you create the sheet using the Cnsert ,heet
dialog $2igure 1A on page 32&.

Hight+clic- on a sheet tab and select 3ename +heet from the conte3t menu to replace the
e3isting name with a different one.

5ouble+clic- on a sheet tab to open the 3ename +heet dialog.


,heet names must start with either a letter or a numberN other characters including spaces are not allowed. )part from the first character of the sheet name' permitted characters are letters' numbers' spaces' and the underscore character. )ttempting to rename a sheet with an in(alid name will produce an error message.

?ote

>iewing Calc
Changing document view
!se the Foom function to show more or fewer cells in the window when you are wor-ing on a spreadsheet. 2or more about Foom' see the Getting Started Guide $hapter # 0ntroducing LibreOffice.

Free5ing rows and columns


2reeFing loc-s a number of rows at the top of a spreadsheet or a number of columns on the left of a spreadsheet or both rows and columns. Then' when mo(ing around within a sheet' the cells in froFen rows and columns always remain in (iew. 2igure 1E shows some froFen rows and columns. The hea(ier horiFontal line between rows 3 and 23 and the hea(ier (ertical line between columns 2 and J indicate that rows 1 to 3 and columns ) to 2 are froFen. The rows between 3 and 23 and the columns between 2 and J ha(e been scrolled off the page. 1& Clic- on the row header below the rows you want the freeFe or clic- on the column header to the right of the columns where you want the freeFe. 2& Go to 8indow on the main menu bar and select Free5e. ) hea(ier line appears between the rows or columns indicating where the freeFe has been placed.

3"

LibreOffice ".# $alc Guide

'igure #A. 'ro1en rows and columns

*nfree5ing
To unfreeFe rows or columns' go to 8indow on the main menu bar and unchec- Free5e. The hea(ier lines indicating freeFing will disappear.

+plitting the screen


)nother way to change the (iew is by splitting the screen your spreadsheet is displayed in $also -nown as splitting the window&. The screen can be split horiFontally' (ertically' or both' gi(ing you up to four portions of the spreadsheet in (iew at any one time. )n e3ample of splitting the screen is shown in 2igure 1* where a split is indicated by a blac- line. 0hy would you want to do this= 2or e3ample' a large spreadsheet in which one cell has a number in it that is used by three formulas in other cells. !sing the split+screen techni?ue' you can position the cell containing the number in one section and each of the cells with formulas in the other sections. This allows you to change the number in one cell and watch how it affects each of the formulas.

'igure #-. Split screen e*ample

!plittin% "ori-ontall$ or verticall$


1& Clic- on the row header below the rows where you want to split the screen horiFontally or clic- on the column header to the right of the columns where you want to split the screen (ertically. 2& Go to 8indow on the main menu bar and select +plit. ) thic- line appears between the rows or columns indicating where the split has been placed. )n e3ample of a split line is shown below How 2 in 2igure 1*. 3& )lternati(ely for a horiFontal split' clic- on the thic- blac- line at the top of the (ertical scroll bar $2igure 1:& and drag the split line below the row where you want the horiFontal split positioned. <& )lternati(ely for a (ertical split' clic- on the thic- blac- line at the right of the horiFontal scroll bar $2igure 1:& and drag the split line to the right of the column where you want the (ertical split positioned.

$hapter # 0ntroducing $alc

3%

'igure #.. Split screen bars

!plittin% "ori-ontall$ and verticall$


1& Clic- into the cell that is immediately below the rows where you want to split the screen horiFontally and immediately to the right of the columns where you want to split the screen (ertically. 2& Go to 8indow on the main menu bar and select +plit. ) thic- line appears between the rows or columns indicating where the split has been placed. )n e3ample of a split line is shown below How 2 in 2igure 1*.

&e(ovin% split views


To remo(e a split (iew' do any of the following%

5ouble+clic- on each split line. Clic- on and drag the split lines bac- to their places at the ends of the scroll bars. Go to 8indow on the main menu bar and unchec- +plit.

*sing the ?avigator


The a(igator $2igure 20&' that is a(ailable in all #ibre;ffice modules' pro(ides tools and methods to mo(e ?uic-ly through a spreadsheet and find specific items. The a(igator categoriFes and groups spreadsheet obGects which you can clic- on to mo(e ?uic-ly to that obGect. Cf an indicator $plus sign or triangle' dependent on computer setup& appears ne3t to a category' at least one obGect in this category e3ists. To open a category and see the list of items' clic- on the indicator.

'igure 98: @avigator dialog in $alc

3&

LibreOffice ".# $alc Guide

0hen a category is showing the list of obGects in it' double+clic- on an obGect to Gump
directly to that obGect location in the spreadsheet.

;bGects are much easier to find if you ha(e gi(en them recogniFable names when creating
them' instead of using the #ibre;ffice default names' such as ,heet1' Table1' Table2' and so on. ote that the default names may not correspond to the actual position of the obGect in the spreadsheet.

The a(igator in each of the indi(idual #ibre;ffice modules has a different range of
functions and these functions are further e3plained in the appropriate user guides for each #ibre;ffice module. To open the a(igator' do one of the following%

Clic- the a(igator icon "ress the '% -ey.

on the ,tandard toolbar.

Go to >iew < ?avigator on the main menu bar. 5ouble+clic- the sheet number at the left end of the ,tatus 4ar.

You can doc- the a(igator into the main Calc window or lea(e it as a floating dialog. To doc- or float the a(igator' hold down the $trl -ey and double+clic- in an empty area near the icons at the top of the dialog. The controls and tools a(ailable in the a(igator are as follows%

Column X enter the column letter and press the )nter -ey to reposition the cell cursor to
the specified column in the same row.

3ow X enter a row number and press the )nter -ey to reposition the cell cursor to the
specified row in the same column.

%ata 3ange
cursor.

X specifies the current data range denoted by the position of the cell

+tart #nd

X mo(es to the cell at the beginning of the current data range' which you can highlight using the 5ata Hange icon. X mo(es to the cell at the end of the current data range' which you can highlight using the 5ata Hange icon. X allows you to show or hide the contents.

Contents ,oggle

X toggles the content (iew. ;nly the selected a(igator element and its subelements are displayed. Clic- the icon again to restore all elements for (iewing. X displays all a(ailable scenarios. 5ouble+clic- a name to apply that scenario and the result is shown in the sheet. Cf the a(igator displays scenarios' you can access the following commands when you right+clic- a scenario entry% Delete X deletes the selected scenario. Properties X opens the Ddit scenario dialog' where you can edit the scenario properties.

+cenarios

%rag 4ode

X opens a submenu for selecting the drag mode. You decide which action is performed when dragging and dropping an obGect from the a(igator into a document. 5epending on the mode you select' the icon indicates whether a hyperlin-' lin- or a copy is created. 0nsert as +2perlin4 X inserts a hyperlin- when you drag+and+drop an obGect from the a(igator into a document. You can later clic- the created hyperlin- to set the cursor and the (iew to the respecti(e obGect. Cf you insert a hyperlin- that lin-s to an open document' you need to sa(e the document before you can use the hyperlin-.
3A

$hapter # 0ntroducing $alc

0nsert as Lin4 X creates a lin- when you drag+and+drop an obGect from the a(igator into a document. 0nsert as $op2 X generates a copy when you drag+and+drop an obGect from the a(igator into a document.
Hanges' scenarios' pictures' and other obGects are much easier to find if you ha(e gi(en them informati(e names when creating them' instead of -eeping the default Calc names' for e3ample Graphics 1' Graphics 2' ;bGect 1' and so on. These default names may not correspond to the position of the obGect in the document.

,ip

*sing document properties


To open the "roperties dialog for a document' go to File < Properties on the main menu bar. The "roperties dialog allows you to set some of the properties of a spreadsheet and the dialog has si3 tabs and these are described as follows.

(eneral
Contains basic information about the current file.

The te3t bo3 at the top of the dialog displays the file name. Change Password X opens a dialog where you can change the password and is only
acti(e if a password has been set for the file.

,ype X displays the file type for the current document. 2ocation X displays the path and the name of the directory where the file is stored. +i5e X displays the siFe of the current document in bytes. Created X displays the date and time and author when the file was first sa(ed. 4odified X displays the date and time and author when the file was last sa(ed in a #ibre;ffice file format. the name of the author who signed the document.

%igitally signed X displays the date and the time when the file was last signed as well as %igital +ignature X opens the 5igital ,ignatures dialog where you can manage digital
signatures for the current document.

2ast printed X displays the date and time and user name when the file was last printed. ,otal editing time X displays the amount of time that the file has been open for editing
since the file was created. The editing time is updated when you sa(e the file.

3evision number X displays the number of times that the file has been sa(ed. Apply user data X sa(es the full name of the user with the file. You can edit the name by
going to ,ools < =ptions < 2ibre=ffice < *ser %ata on the main menu bar.

3eset X resets the editing time to Fero' the creation date to the current date and time' and
the (ersion number to 1. The modification and printing dates are also deleted.

,emplate X displays the template that was used to create the file.

3-

LibreOffice ".# $alc Guide

%escription
Contains descripti(e information about the spreadsheet.

,itle X enter a title for the document. +ubCect X enter a subGect for the document. You can use a subGect to group documents
with similar contents.

6eywords X enter the words that you want to use to inde3 the content of your document.
6eywords must be separated by commas. ) -eyword can contain white space characters or semicolons.

Comments X enter comments to help identify the document.

Custom Properties
)llows you to assign custom information fields to your document. You can change the name type and contents of each row. The information in the fields will e3ported as metadata to other file formats. Clic- Add to add a new now to the custom properties. Clic- 3eset to delete any additional rows and reset the default rows.

+ecurity
,ets the password options for the current document.

=pen file read/only X select to allow this document to be opened in read+only mode only.
This file sharing option protects the document against accidental changes. Ct is still possible to edit a copy of the document and sa(e that copy with the same name as the original.

3ecord changes X select to enable recording changes. This is the same as #dit <
Changes < 3ecord on the main menu bar. To protect the recording state with a password' clic- Protect and enter a password. ;ther users of this document can apply their changes' but they cannot disable change recording without -nowing the password.

Protect or *nprotect X protects the change recording state with a password. Cf change
recording is protected for the current document' the button is named *nprotect. Clic*nprotect and type the correct password to disable the protection.

Font
0hen #mbed fonts in the document is selected' any fonts used in the document will be embedded into the document. This maybe useful if you are creating a "52 of your spreadsheet and want to control how your spreadsheet will loo- on other computer systems.

+tatistics
5isplays statistics for the current file.

?umber of sheets X number of sheets in the file. This statistic does not include tables that
were inserted as ;#D obGects.

?umber of cells X number of cells with content in the file. ?umber of pages X number of pages in the file.

$hapter # 0ntroducing $alc

3.

$hapter 9 )ntering= )diting= and 'ormatting Data

ntroduction
You can enter data into Calc in se(eral ways% using the -eyboard' dragging and dropping using the mouse' the 2ill tool' and selection lists. Calc also pro(ides the ability to enter information into multiple sheets of the same spreadsheet at the same time. )fter entering data' you can format and display it in (arious ways.

*sing the keyboard


1ost data entry in Calc can be accomplished using the -eyboard.

?umbers
Clic- in the cell and type the number using the number -eys on either the main -eyboard or the numeric -eypad.

.e%ative nu(bers
To enter a negati(e number' either type a minus $X& sign in front of the number or enclose the number in parentheses $&' for e3ample $123<&. The result for both methods of entry will be the same' for e3ample +123<.

Leadin% -eroes
To retain a minimum number of characters in a cell when entering numbers and retain the number format' for e3ample 123< and 0012' leading Feroes ha(e to be added as follows% 1& 0ith the cell selected' right+clic- on the cell and select Format Cells from the conte3t menu' or go to Format < Cells on the menu bar' or use the -eyboard shortcut $trl5# to open the Format Cells dialog $2igure 21&.

'igure 9#: 'ormat $ells dialog E @umbers page 2& 1a-e sure the ?umbers page is selected' then select @umber in the $ategor2 list.

"9

LibreOffice ".# $alc Guide

3& Cn Options / Leading ?eroes' enter the minimum number of characters re?uired. 2or e3ample' for four characters' enter <. )ny number less than four characters will ha(e leading Feroes added' for e3ample 12 becomes 0012. <& Clic- =6. The number entered retains its number format and any formula used in the spreadsheet will treat the entry as a number in formula functions. Cf a number is entered with leading Feroes' for e3ample 01<*1' by default Calc will automatically drop the leading 0. To preser(e leading Feroes in a number% 1& Type an apostrophe $>& before the number' for e3ample >01<*1. 2& 1o(e the cell focus to another cell. The apostrophe is automatically remo(ed' the leading Feroes are retained and the number is con(erted to left+aligned te3t.

.u(bers as text
umbers can also be con(erted to te3t as follows% 1& 0ith the cell selected' right+clic- on the cell and select Format Cells from the conte3t menu' or go to Format < Cells on the menu bar' or use the -eyboard shortcut $trl5# to open the Format Cells dialog $2igure 21&. 2& 1a-e sure the ?umbers page is selected' then select (e*t from the $ategor2 list. 3& Clic- =6. The number is con(erted to te3t and' by default' is left+aligned. You can change the formatting and alignment of any te3t numbers Gust as you would with normal te3t.
)ny numbers that ha(e been formatted as te3t in a spreadsheet will be treated as a Fero by any formulas used in the spreadsheet. 2ormula functions will ignore te3t entries.

?ote

,e.t
Clic- in a cell and type the te3t. The te3t is left+aligned by default. Cells can contain se(eral lines of te3t. Cf you want to use paragraphs' press $trl5)nter to create another paragraph. ;n the 2ormula 4ar' you can e3tend the Cnput #ine if you are entering se(eral lines of te3t. Clic- on the #.tend Formula 7ar icon located on the right of the 2ormula 4ar and the Cnput #ine becomes multi+line' as shown in 2igure 22. Clic- the #.tend Formula 7ar icon again to return to a single input line.

'igure 99: )*tended input line on 'ormula Bar

%ate and time


,elect the cell and type the date or time. You can separate the date elements with a slash $/& or a hyphen $X& or use te3t' for e3ample 10 ;ct 2012. The date format automatically changes to the selected format used by Calc.
$hapter 9 )ntering= )diting= and 'ormatting Data "3

0hen you enter a time' separate time elements with colons' for e3ample 10%<3%<A. The time format automatically changes to the selected format used by Calc. To change the date or time format used by Calc% 1& 0ith the cell selected' right+clic- on the cell select Format Cells from the conte3t menu or go to Format < Cells on the menu bar or use the -eyboard shortcut $trl5# to open the Format Cells dialog $2igure 21&. 2& 1a-e sure the ?umbers page is selected' then select Date or (ime from the $ategor2 list. 3& ,elect the date or time format you want to use from the 'ormat list. <& Clic- =6 to sa(e the changes and close the dialog.

+pecial characters
) special character is a character not normally found on a standard -eyboard' for e3ample' [ \ ] ^ _ ` a b. To insert a special character% 1& "lace the cursor in the cell where you want the character to appear. 2& Go to nsert < +pecial CharacterJ on the menu bar to open the ,pecial Characters dialog $2igure 23&. 3& ,elect in order the special characters you want to insert into the cell. The special characters selected will appear at the bottom left of the ,pecial Characters dialog. The last character selected is shown on the right of the ,pecial Characters dialog along with its numerical code. <& Clic- =6 to close the dialog and the special characters are inserted into the selected cell.

?ote

5ifferent fonts include different special characters. Cf you do not find a particular special character you want' try changing the 'ont and Subset selection.

'igure 93: Special $haracters dialog

Autocorrection options
Calc automatically applies many changes during data input using autocorrection' unless you ha(e deacti(ated any autocorrect changes. You can also undo any autocorrection changes by using the -eyboard shortcut $trl5? or manually by going bac- to the change and replacing the autocorrection with what you want to actually see.
"" LibreOffice ".# $alc Guide

To change the autocorrect options' go to ,ools < AutoCorrect =ptions on the menu bar to open the AutoCorrect dialog $2igure 2<&.

'igure 9": ,uto$orrect dialog

3eplace X edits the replacement table for automatically correcting or replacing words or
abbre(iations in your document.

#.ceptions X specify the abbre(iations or letter combinations that you do not want
#ibre;ffice to correct automatically.

=ptions X select the options for automatically correcting errors as you type and then clic=6.

2ocali5ed =ptions X specify the )utoCorrect options for ?uotation mar-s and for options
that are specific to the language of the te3t.

3eset X resets modified (alues bac- to the #ibre;ffice default (alues.

nserting dashes
Calc pro(ides te3t shortcuts so that you can ?uic-ly insert dashes into a cell and these shortcuts are shown in Table 3. (able 3: 0nserting dashes /ext t"at $ou t$pe
) + 4 $)' space' hyphen' space' 4& ) ++ 4 $)' space' hyphen' hyphen' space' 4& )++4 $)' hyphen' hyphen' 4& )+4 $)' hyphen' 4& ) +4 $)' space' hyphen' 4& ) ++4 $)' space' hyphen' hyphen' 4&
$hapter 9 )ntering= )diting= and 'ormatting Data

&esult
) X 4 $)' space' en+dash' space' 4& ) X 4 $)' space' en+dash' space' 4& )c4 $)' em+dash' 4& )+4 $unchanged& ) +4 $unchanged& ) X4 $)' space' en+dash' 4&
"%

+peeding up data entry


Dntering data into a spreadsheet can be (ery labor+intensi(e' but Calc pro(ides tools for remo(ing some of the drudgery from input. These tools include drag and drop to mo(e or copy contents of one cell to another using a mouse' an )utoCnput tool' the 2ill tool' and selection lists. The 2ill tool and selection lists automate input of repetiti(e material into cells. Calc also has the ability to input information into multiple sheets of the same spreadsheet at the same time.

Auto nput tool


The Auto nput function in Calc automatically completes entries' based on other entries in the same column. The column is scanned up to a ma3imum of 2000 cells or 200 different strings. 0hen te3t is highlighted in a cell' Auto nput can be used as follows% 1& To accept the completion' press )nter or '9 or the mouse button. 2& To (iew more completions' use the -ey combinations $trl5(ab to scroll forward' or $trl5Shift5(ab to scroll bac-ward. 3& To see a list of all a(ailable Auto nput te3t items for the current column' use the -eyboard combination ,lt5Down ,rrow. 0hen typing formulas using characters that match pre(ious entries' a /elp tip will appear listing the last ten functions used in the 2unction 0iFard from all defined range names and from the content of all label ranges. Auto nput ignores the case sensiti(ity of any data you enter. Cf' for e3ample' you ha(e written UTotalU in a cell' you cannot then enter UtotalU in another cell of the same column without first deacti(ating Auto nput. 4y default' Auto nput is acti(ated in Calc. To turn off Auto nput' go to ,ools < Cell Contents on the main menu bar and deselect Auto nput.

'igure 9%: )*amples of using the 'ill tool

Fill tool
You can use the Fill tool in Calc to duplicate e3isting content or create a series in a range of cells in your spreadsheet as shown by the e3amples in 2igure 2A. 1& ,elect the cell containing the contents you want to copy or start the series from. 2& 5rag the cursor in any direction or hold down the Shift -ey and clic- in the last cell you want to fill.

"&

LibreOffice ".# $alc Guide

3& Go to #dit < Fill on the main menu bar and select the direction in which you want to copy or create data $*p' %own' 2eft 3ight' +heet or +eries&. ) menu option will be grayed out if it is not a(ailable. )lternati(ely' you can use a shortcut to fill cells% 1& ,elect the cell containing the contents you want to copy or start the series from. 2& 1o(e the cursor o(er the small selection handle in the bottom right corner of the selected cell. The cursor will change shape. 3& Clic- and drag in the direction you want the cells to be filled' (ertical or horiFontal. Cf the original cell contained te3t' then the te3t will automatically be copied. Cf the original cell contained a number' a series will be created.

?ote

0hen you are selecting cells so you can use the Fill tool' ma-e sure that none of the cells contain data' e3cept for the cell data you want to use. 0hen you use the Fill tool' any data contained in selected cells is o(erwritten.

+sin% a fill series


0hen you select a series fill from #dit < Fill < +eries on the menu bar' the 2ill ,eries dialog $2igure 2@& opens. /ere you can select the type of series you want or create your own list.

'igure 9&: 'ill Series dialog

%irection X determines the direction of series creation. Down X creates a downward series in the selected cell range for the column using the
defined increment to the end (alue.

3ight X creates a series running from left to right within the selected cell range using the defined increment to the end (alue. Up X creates an upward series in the cell range of the column using the defined increment to the end (alue. Left X creates a series running from right to left in the selected cell range using the defined increment to the end (alue.

+eries ,ype X defines the series type. Linear X creates a linear number series using the defined increment and end (alue. Growth X creates a growth series using the defined increment and end (alue. Date X creates a date series using the defined increment and end date. ,uto'ill X forms a series directly in the sheet. The )uto2ill function ta-es account of
customiFed lists. 2or e3ample' by entering .anuary in the first cell' the series is

$hapter 9 )ntering= )diting= and 'ormatting Data

"A

completed using the list defined in 2ibre=ffice < ,ools < =ptions < 2ibre=ffice Calc < +ort 2ists. )uto2ill tries to complete a (alue series by using a defined pattern. 2or e3ample' a numerical series using 1'3'A is automatically completed with E':'11'13N a date and time series using 01.01.:: and 1A.01.::' an inter(al of fourteen days is used.

*nit of ,ime X in this area you specify the desired unit of time. This area is only acti(e if
the Date option has been selected in +eries ,ype. Da2 X use the 5ate series type and this option to create a series using se(en days.

<ee4da2 X use the 5ate series type and this option to create a series of fi(e day sets. :onth X use the 5ate series type and this option to form a series from the names or abbre(iations of the months. Fear X use the 5ate series type and this option to create a series of years.

+tart >alue X determines the start (alue for the series. !se numbers' dates or times. #nd >alue X determines the end (alue for the series. !se numbers' dates or times. ncrement X determines the (alue by which the series of the selected type increases by
each step. Dntries can only be made if the linear' growth or date series types ha(e been selected.

'igure 9A: Sort Lists dialog

*efinin% a fill series


To define your own fill series% 1& Go to ,ools < =ptions < 2ibre=ffice Calc < +ort 2ists to open the +ort 2ists dialog $2igure 2E&. This dialog shows any pre(iously defined series in the Lists bo3 on the left and the contents of the highlighted list in the )ntries bo3. 2& Clic- ?ew and the )ntries bo3 is cleared. 3& Type the series for the new list in the )ntries bo3 $one entry per line& $2igure 2*&. <& Clic- Add and the new list will now appear in the Lists bo3. A& Clic- =6 to sa(e the new list and close the dialog.

"-

LibreOffice ".# $alc Guide

'igure 9-: $reating new sort list

+election lists
,election lists are a(ailable only for te3t and are limited to using only te3t that has already been entered in the same column. 1& ,elect a blan- cell in a column that contains cells with te3t entries. 2& Hight+clic- and select +election 2ists from the conte3t menu' or use the -eyboard shortcut ,lt5G. ) drop+down list appears listing any cell in the same column that either has at least one te3t character or whose format is defined as te3t. 3& Clic- on the te3t entry you re?uire and it is entered into the selected cell.

4erging and splitting cells


4erging
You can select contiguous cells and merge them into one as follows% 1& ,elect the range of contiguous cells you want merge. 2& Hight clic- on the selected cells and select 4erge Cells from the conte3t menu' or go to Format < 4erge cells < 4erge cells or 4erge and Center Cells on the menu bar' or clicon the 4erge and Center Cells icon on the 2ormatting toolbar. !sing 4erge and Center Cells will center align any contents in the cells. 3& Cf the cells contain any data' clic- Ies on the confirmation dialog that opens to mo(e the data in the hidden cells into the first cell.

?ote

1erging cells can lead to calculation errors if formulas ha(e used in the spreadsheet.

+plitting
You can re(erse or split only a cell that was created from se(eral cells by merging. 1& ,elect a merged cell. 2& Go to Format < 4erge cells < +plit cells on the menu bar' or right+clic- and select +plit Cells from the conte3t menu' or clic- on the 4erge and Center Cells icon on the 2ormatting toolbar. 3& )ny data in the cell will remain in the first cell. Cf the hidden cells did ha(e any contents' before the cells were merged' then you ha(e to manually mo(e the contents in to the correct cell.

$hapter 9 )ntering= )diting= and 'ormatting Data

".

+haring content between sheets


You might want to enter the same information in the same cell on multiple sheets' for e3ample to set up standard listings for a group of indi(iduals or organiFations. Cnstead of entering the list on each sheet indi(idually' you can enter the information in se(eral sheets at the same time.

'igure 9.: Select Sheets dialog 1& Go to #dit < +heet < +elect on the menu bar to open the +elect +heets dialog $2igure 2:&. 2& ,elect the indi(idual sheets where you want the information to be repeated. 3& Clic- =6 to select the sheets and the sheet tabs will change color. <& Dnter the information in the cells on the sheet where you want the information to first appear and the information will repeated in the selected sheets. A& 5eselect the sheets when you ha(e finished entering the information that you want repeated in the sheets.
This techni?ue automatically o(erwrites' without any warning' any information that is already in the cells on the selected sheets. 1a-e sure you deselect the additional sheets when you ha(e finished entering the information to be repeated before continuing to enter data into your spreadsheet.

?ote

>alidating cell contents


0hen creating spreadsheets for other people to use' you may want to ma-e sure they enter data that is (alid or appropriate for the cell. You can also use (alidation in your own wor- as a guide to entering data that is either comple3 or rarely used. 2ill series and selection lists can handle some types of data' but are limited to predefined information. 2or e3ample' a cell may re?uire a date or a whole number with no alphabetic characters or decimal points' or a cell may not be left empty. 5epending on how (alidation is set up' it can also define the range of contents that can be entered' pro(ide help messages e3plaining the content rules set up for the cell and what users should do when they enter in(alid content. You can also set the cell to refuse in(alid content' accept it with a warning' or start a macro when an error is entered.

%efining validation
To (alidate any new data entered into a cell% 1& ,elect a cell and go to %ata < >alidity on the menu bar to open the Balidity dialog.

%8

LibreOffice ".# $alc Guide

'igure 38: Halidit2 dialog E $riteria page 2& 5efine the type of contents that can be entered in that cell using the options gi(en on the tabbed pages for Criteria' nput ;elp and #rror Alert. The options a(ailable are e3plained below.

Criteria options
,pecify the (alidation rules for the selected cells using the Criteria page in the Balidity dialog as shown in 2igure 30. 2or e3ample' you can define criteria such as% @umbers between # and #8 or (e*ts that are no more than 98 characters. The options a(ailable on the Criteria page will depend on what has been selected in the Allow drop+down list.

Allow X select a (alidation option for the selected cells from the drop+down list. ,ll values X no limitation. <hole number X only whole numbers allowed. Decimal X all numbers correspond to decimal format. Date X all numbers correspond to date format. The entered (alues are formatted the
ne3t time the dialog is called up.

(ime X all numbers correspond to time format. The entered (alues are formatted the ne3t time the dialog is called up. $ell range X allow only (alues that are gi(en in a cell range. The cell range can be specified e3plicitly' or as a named database range' or as a named range. The range may consist of one column or one row of cells. Cf you specify a range of columns and rows' only the first column is used. List X allow only (alues or strings specified in a list. ,trings and (alues can be mi3ed. umbers e(aluate to their (alue' so if you enter the number 1 in the list' the entry 100d is also (alid. (e*t length X entries whose length corresponds to the number of characters that ha(e been set.

Allow blank cells X in conGunction with ,ools < %etective < 4ark invalid %ata' this
defines that blan- cells are shown as in(alid data $disabled& or not shown $enabled&.

+how selection list X shows a list of all (alid strings or (alues to select from. The list can
also be opened by selecting the cell and pressing $trl5D.

+ort entries ascending X sorts the selection list in ascending order and filters duplicates
from the list. Cf not chec-ed' the order from the data source is ta-en.

$hapter 9 )ntering= )diting= and 'ormatting Data

%#

+ource X enter the cell range that contains the (alid (alues or te3t. #ntries X enter the entries that will be (alid (alues or te3t strings. %ata X select the comparati(e operator that you want to use from the drop+down list. The
a(ailable operators depend on what you ha(e selected in the Allow drop+down list. 2or e3ample' if you select valid range' the 4inimum and 4a.imum input bo3es replace the >alue bo3.

>alue X enter the (alue for the data (alidation option that you selected in the Allow drop+
down list.

4inimum X enter the minimum (alue for the data (alidation option that you selected in the
Allow drop+down list.

4a.imum X enter the ma3imum (alue for the data (alidation option that you selected in the
Allow drop+down list.

nput ;elp options


Dnter the message to be displayed when the cell or cell range is selected in the spreadsheet $2igure 31&.

+how input help when cell is selected X displays the message that you enter in the ,itle
and Contents bo3es when the cell or cell range is selected in the sheet. Cf you enter te3t in the ,itle and Contents bo3es and then deselect this option' the te3t will be lost.

,itle X enter the title to be displayed when the cell or cell range is selected. nput help X enter the message to be displayed when the cell or cell range is selected.

'igure 3#: Halidit2 dialog E 0nput +elp page

'igure 39: Halidit2 dialog E )rror ,lert page

%9

LibreOffice ".# $alc Guide

#rror Alert options


5efine the error message that is displayed when in(alid data is entered in a cell $2igure 32&.

+how error message when invalid values are entered X when selected' displays the
error message that you enter in the Contents area when in(alid data is entered in a cell.

Action X select the action that you want to occur when in(alid data is entered in a cell. Stop X reGects the in(alid entry and displays a dialog that you ha(e to close by clic-ing
=6.

<arning and 0nformation X displays a dialog that can be closed by clic-ing =6 or Cancel. The in(alid entry is only reGected when you clic- Cancel. :acro X acti(ates the 7rowse button to open the 1acro dialog where you can select a macro that is e3ecuted when in(alid data is entered in a cell. The macro is e3ecuted after the error message is displayed.

,itle X enter the title of the macro or the error message that you want to display when
in(alid data is entered in a cell.

#rror message X enter the message that you want to display when in(alid data is entered
in a cell.

Calc detective
The 5etecti(e is a tool within Calc that you can use to locate any cells in a spreadsheet that contain in(alid data if the cells are set to accept in(alid data with a warning. 1& Go to ,ools < %etective < 4ark nvalid %ata on the menu bar to locate any cells containing in(alid data. The 5etecti(e function mar-s any cells containing in(alid data. 2& Correct the data so that it becomes (alid. 3& Go to ,ools < %etective < 4ark nvalid %ata on the menu bar again and any cells that were pre(iously mar-ed as containing in(alid data ha(e the in(alid data mar- remo(ed.
) (alidity rule is considered part of the format for a cell. Cf you select %elete All from the 5elete Contents dialog $2igure 33&' then it is remo(ed. Cf you want to copy a (alidity rule with the rest of the cell' use #dit < Paste +pecial < Paste Formats or Paste All.

?ote

#diting data
%eleting data
*eletin% data onl$
5ata can be deleted from a cell without deleting any of the cell formatting. Clic- in the cell to select it and then press the Delete -ey.

*eletin% data and for(attin%


5ata and cell formatting can be deleted from a cell at the same time. 1& Clic- in the cell to select it. 2& "ress the Bac4space -ey' or right+clic- in the cell and select %elete Contents from the conte3t menu' or go to #dit < %elete Contents& on the menu bar to open the %elete Contents dialog $2igure 33&. /ere you can choose to delete the different aspects of the data in the cell or delete e(erything in the cell.
$hapter 9 )ntering= )diting= and 'ormatting Data %3

'igure 33: Delete $ontents dialog 3& ,elect the delete options. <& Clic- =6 to delete the contents and close the dialog.

3eplacing data
To completely replace data in a cell and insert new data' select the cell and type in the new data. The new data will replace the data already contained in the cell and will retain the original formatting used in the cell. )lternati(ely' clic- in the Cnput #ine on the 2ormula 4ar then double+clic- on the data to highlight it completely and type the new data.

#diting data
,ometimes it is necessary to edit the contents of cell without remo(ing all of the data from the cell. 2or e3ample' changing the phrase K,ales in Jtr. 2L to K,ales rose in JtrL can be done as follows.

+sin% t"e 0e$board


1& Clic- in the cell to select it. 2& "ress the '9 -ey and the cursor is placed at the end of the cell. 3& "ress the Bac4space -ey to delete any data up to the point where you want to enter new data. <& )lternati(ely' use the -eyboard arrow -eys to reposition the cursor where you want to start entering the new data in the cell' then press the Delete -ey or Bac4space -ey to delete any unwanted data before typing the new data. A& 0hen you ha(e finished editing' press the )nter -ey to sa(e the changes.

?ote

Dach time you select a cell' the contents are displayed in the Cnput #ine on the 2ormula 4ar. !sing the Cnput #ine maybe easier to carry out editing data.

+sin% t"e (ouse


1& 5ouble+clic- on the cell to select it and place the cursor in the cell for editing. 2& Heposition the cursor to where you want to start editing the data in the cell. 3& )lternati(ely' single+clic- to select the cell' then mo(e the cursor to the Cnput #ine on the 2ormula 4ar and clic- at the position where you want to start editing the data in the cell. <& 0hen you ha(e finished' clic- away from the cell to deselect it and your editing changes are sa(ed.
%" LibreOffice ".# $alc Guide

Paste +pecial function


You can use the "aste ,pecial function to paste into another cell selected parts of the data in the original cell or cell range' for e3ample its format or the result of its formula.

1aste !pecial dialo%


1& 2& 3& <& ,elect a cell or a cell range. Go to #dit < Copy on the menu bar' right+clic- and select Copy from the conte3t menu. ,elect the target cell or cell range. Go to #dit < Paste +pecial from the menu bar' or use the -eyboard shortcut $trl5Shift5H' or right+clic- and select Paste +pecial from the conte3t menu to open the "aste ,pecial dialog $2igure 3<&. A& ,elect the options for Selection' Operations' Options and Shift cells. The "aste ,pecial options are e3plained below. @& Clic- =6 to paste the data into to the target cell or range of cells and close the dialog.

'igure 3": Paste Special dialog

1aste !pecial options +election X select a format for the clipboard contents that you want to paste. Paste all X pastes all cell contents' comments' formats' and obGects into the current
document.

(e*t X pastes cells containing te3t. @umbers X pastes cells containing numbers. Date > (ime X pastes cells containing date and time (alues. 'ormulas X pastes cells containing formulas. $omments X pastes comments that are attached to cells. Cf you want to add the comments to the e3isting cell content' select the ,dd operation. 'ormats X pastes cell format attributes.

$hapter 9 )ntering= )diting= and 'ormatting Data

%%

ObIects X pastes obGects contained within the selected cell range. These can be ;#D obGects' chart obGects' or drawing obGects.

=perations X select the operation to apply when you paste cells into your sheet. @one X does not apply an operation when you insert the cell range from the clipboard.
The contents of the clipboard will replace e3isting cell contents.

,dd X adds the (alues in the clipboard cells to the (alues in the target cells. )lso' if the clipboard only contains comments' adds the comments to the target cells. Subtract X subtracts the (alues in the clipboard cells from the (alues in the target cells. :ultipl2 X multiplies the (alues in the clipboard cells with the (alues in the target cells. Divide X di(ides the (alues in the target cells by the (alues in the clipboard cells.

=ptions X sets the paste options for the clipboard contents. S4ip empt2 cells X empty cells from the clipboard do not replace target cells. Cf you use
this option in conGunction with the :ultipl2 or the Divide operation' the operation is not applied to the target cell of an empty cell in the clipboard. Cf you select a mathematical operation and deselect the S4ip empt2 cells' empty cells in the clipboard are treated as Feroes. 2or e3ample' if you apply the :ultipl2 operation' the target cells are filled with Feroes.

(ranspose X the rows of the range in the clipboard are pasted to become columns of the output range. The columns of the range in the clipboard are pasted to become rows. Lin4 X inserts the cell range as a lin-' so that changes made to the cells in the source file are updated in the target file. To ensure that changes made to empty cells in the source file are updated in the target file' ensure that the Paste ,ll is also selected. You can also lin- sheets within the same spreadsheet. 0hen you lin- to other files' a 55D lin- is automatically created. ) 55D lin- is inserted as a matri3 formula and can only be modified as a whole.

+hift cells X set the shift options for the target cells when the clipboard content is inserted. DonJt shift X inserted cells replace the target cells. Down X target cells are shifted downward when you insert cells from the clipboard. 3ight X target cells are shifted to the right when you insert cells from the clipboard. 1aste Onl$ options
Cf you only want to copy te3t' numbers or formulas to your target cell or cell range% 1& ,elect the cell or cell range and copy the data. 2& ,elect the target cell or cell range. 3& Hight+clic- on the target cell or cell range and select Paste =nly from the conte3t menu' then select ,e.t' ?umber or Formula.

nsert cell fields


You can insert a field lin-ed to the date' sheet name' or document name in a cell. 1& ,elect a cell and double+clic- to acti(ate edit mode. 2& Hight+clic- and select nsert Fields < %ate or +heet ?ame or ,itle from the conte3t menu.

?ote

The nsert Fields < ,itle command inserts the name of the spreadsheet and not the title defined in the 5escription page in the "roperties dialog for the file.

%&

LibreOffice ".# $alc Guide

,ip

The fields are refreshed when the spreadsheet is sa(ed or recalculated when using the $trl5Shift5'. shortcut.

Formatting data
?ote
)ll the settings discussed in this section can also be set as a part of the cell style. ,ee $hapter " Using St2les and (emplates in $alc for more information.

The data in Calc can be formatted in se(eral ways. 2ormatting can either be defined as part of a cell style so that it is automatically applied' or it can be applied manually to the cell. 2or more control and e3tra options' select a cell or cell range and use the Format Cells dialog. )ll of the format options are discussed below.

4ultiple lines of te.t


1ultiple lines of te3t can be entered into a single cell using automatic wrapping or manual line brea-s. Dach method is useful for different situations.

)uto(atic wrappin%
To automatically wrap multiple lines of te3t in a cell% 1& ,elect a cell or cell range. 2& Hight+clic- on the selection and select Format Cells from the conte3t menu' or go to Format < Cells on the menu bar' or press $trl5# to open the 2ormat Cells dialog. 3& Clic- on the ,lignment tab $2igure 3A&. <& !nder Properties' select <rap te*t automaticall2 and clic- =6.

'igure 3%: 'ormat $ells dialog E ,lignment page

$hapter 9 )ntering= )diting= and 'ormatting Data

%A

Manual line brea0s


To insert a manual line brea- while typing in a cell' press $trl5)nter. This method does not worwith the cursor in the input line. 0hen editing te3t' double+clic- the cell' then reposition the cursor to where you want the line brea-. 0hen a manual line brea- is entered' the cell width does not change and your te3t may still o(erlap the end of the cell. You ha(e to change the cell width manually or reposition your line brea- so that your te3t does not o(erlap the end of the cell.

+hrinking te.t to fit a cell


The font siFe of the data in a cell can automatically adGust to fit inside cell borders. 1& ,elect a cell or cell range. 2& Hight+clic- on the selection and select Format Cells from the conte3t menu' or go to Format < Cells on the menu bar' or press $trl5# to open the 2ormat Cells dialog. 3& Clic- on the ,lignment tab $2igure 3A&. <& !nder Properties' select Shrin4 to fit cell si1e and clic- =6.

Formatting numbers
,e(eral different number formats can be applied to cells by using icons on the 2ormatting toolbar $highlighted in 2igure 3@&. ,elect the cell' then clic- the rele(ant icon to change the number format. 2or more control or to select other number formats' use the @umbers page of the 2ormat Cells dialog $2igure 21 on page <2 and K umbersL on page <2&%

)pply any of the data types in the Category list to the data. Control the number of decimal places and leading Feros in =ptions. Dnter a custom format code. The 2anguage setting controls the local settings for the different formats such as the date format and currency symbol.

'igure 3&: @umber icons on 'ormatting toolbar

Formatting fonts
To select a font and format it for use in a cell% 1& ,elect a cell or cell range. 2& Clic- the small triangle on the right of the 2ont ame bo3 on the 2ormatting toolbar $highlighted in 2igure 3E& and select a font from the drop+down list. The font can also be changed using the 2ont page on the 2ormat Cells dialog. 3& Clic- on the small triangle on the right of the 2ont ,iFe bo3 on the 2ormatting toolbar and select a font siFe from the drop+down list. The font siFe can also be changed using the 2ont page on the 2ormat Cells dialog. <& To change the character format' clic- on the 7old' 0talic' or !nderline icons. A& To change the paragraph alignment of the font' clic- on one of the four alignment icons $#eft' Centre' Hight' .ustified& .

%-

LibreOffice ".# $alc Guide

'igure 3A: 'ont @ame and Si1e on 'ormatting toolbar


To specify the language used in the cell' open the 2ont page on the 2ormat Cells dialog. Changing language in a cell allows different languages to e3ist within the same document. 2or more changes to font characteristics' see K2ont effectsL below for more information.

?ote

,ip

To choose whether to show the font names in their font or in plain te3t' go to ,ools < =ptions < 2ibre=ffice < >iew and select or deselect the Show preview of fonts option in the 2ont #ists section. 2or more information' see $hapter #" Setting Up and $ustomi1ing $alc.

Font effects
1& ,elect a cell or cell range. 2& Hight+clic- on the selection and select Format Cells from the conte3t menu' or go to Format < Cells on the menu bar' or press $trl5# to open the 2ormat Cells dialog. 3& Clic- on the 'ont )ffects tab $2igure 3*&. <& ,elect the font effect you want to use from the options a(ailable. The options a(ailable are described below. A& Clic- =6 to apply the font effects and close the dialog.

'igure 3-: 'ormat $ells dialog E 'ont )ffects page )ny font effect changes are applied to the current selection' or to the entire word that contains the cursor' or to any new te3t that you type.

Font Color X sets the color for the selected te3t. Cf you select )utomatic' the te3t color is
set to blac- for light bac-grounds and to white for dar- bac-grounds. )lso yo can change

$hapter 9 )ntering= )diting= and 'ormatting Data

%.

the font color by clic-ing on the triangle to right of the Font Color icon color palette' then select the desired color.

to display the

3elief X select a relief effect to apply to the selected te3t. The embossed relief ma-es the
characters appear as if they are raised abo(e the page. The engra(ed relief ma-es the characters appear as if they are pressed into the page.

=utline X displays the outline of the selected characters. This effect does not wor- with
e(ery font.

+hadow X adds a shadow that casts below and to the right of the selected characters. =verlining X select the o(erlining style that you want to apply. To apply o(erlining to words
only' select ndividual 8ords.

=verline color X select the color for the o(erlining. +trikethrough X select a stri-ethrough style for the selected te3t. Cf you sa(e your
document in 1, 0ord format' all of the stri-ethrough styles are con(erted to the single line style.

*nderlining X select the underlining style that you want to apply. To apply the underlining
to words only' select ndividual 8ords. Cf you apply underlining to a superscript te3t' the underlining is raised to the le(el of the superscript. Cf the superscript is contained in a word with normal te3t' the underlining is not raised.

*nderline color X select the color for the underlining. ndividual words X applies the selected font effect only to words and ignores spaces. #mphasis mark X select a character to display o(er or below the entire length of the
selected te3t.

Position X specify where to display the emphasis mar-s. Preview X displays a pre(iew of the current selection.

,e.t direction
To change the te3t direction within a cell' you can use the )lignment page on the 2ormat Cells dialog $2igure 3A on page AE& or the icons on the 2ormatting toolbar. 1& ;n the )lignment page of the 2ormat Cells dialog' select the 3eference edge from which to rotate the te3t as follows%

(e*t )*tension 'rom Lower $ell Border X writes the rotated te3t from the bottom cell
edge outwards.

(e*t )*tension 'rom Upper $ell Border X writes the rotated te3t from the top cell edge
outwards.

(e*t )*tension 0nside $ells X writes the rotated te3t only within the cell.
2& Clic- on the small indicator at the edge of the ,e.t orientation dial and rotate it until you reach the re?uired degrees. 3& )lternati(ely' enter the number of degrees to rotate the te3t in the %egrees bo3. <& ,elect >ertically stacked to ma-e the te3t appear (ertically in the cell. ;nly select Asian layout mode if you are using an )sian language in the cell. A& The icons on the 2ormatting toolbar can be used as follows after the cell has been selected%

To change the te3t direction from horiFontal $default direction& to (ertical' clic- on the
,e.t direction from top to bottom icon .

&8

LibreOffice ".# $alc Guide

To change te3t direction from (ertical to horiFontal $default&' clic- on the ,e.t direction
from left to right icon .

To change te3t direction from left to right' which is the default direction for 0estern
fonts' to a right to left direction used in some fonts' for e3ample )rabic' the clic- on the 3ight/,o/2eft icon left direction. . This only wor-s if a font has been used that re?uires a right to

To change te3t direction bac- to the default left to right direction used for 0estern fonts'
clic- on the 2eft/,o/3ight icon .

?ote

Cf the te3t direction icons are not a(ailable on the 2ormatting toolbar' then right+ clic- in an empty area on the toolbar and select >isible 7uttons from the conte3t menu. Clic- on the icon you re?uire and it will be placed on the 2ormatting toolbar.

Formatting cell borders


To format the borders of a cell or a group of selected cells $see $hapter " Using St2les and (emplates in $alc for more information&. The border icons on the 2ormatting toolbar only apply the default styles to borders' but the 2ormat Cells dialog pro(ides greater control o(er of how the cell borders will loo-.

'igure 3.: 'ormat $ells dialog E Borders page 1& ,elect a cell or a range of cells. 2& Hight+clic- on the selection and select Format Cells from the conte3t menu' or go to Format < Cells on the menu bar' or press $trl5# to open the 2ormat Cells dialog. 3& Clic- on the Borders tab $2igure 3:&. <& ,elect the options from the 4orders page. The options a(ailable are gi(en below. A& Clic- =6 to close the dialog and sa(e your changes.

$hapter 9 )ntering= )diting= and 'ormatting Data

&#

@& )lternati(ely' use the icons on the 2ormatting to apply default styles to borders. a& Clic- on the 7orders icon palette. and select one of the border options displayed in the 4orders and select one of the line styles from the 4order ,tyle and select a color from 4order Color palette.

b& Clic- on the 7order +tyle icon palette. c& Clic- on the 2ine Color icon

?ote

Cell border properties apply only to the selected cells and can only be changed if you are editing those cells. 2or e3ample' if cell C3 has a top border' that border can only be remo(ed by selecting C3. Ct cannot be remo(ed in C2 it appears to be the bottom border for cell C2. 0hen entering borders with the 4order icons on the 2ormatting toolbar' you ha(e two choices% clic- the re?uired icon to add a border to the present borders or shift+ clic- to add a border and remo(e the present borders.

?ote

The border options a(ailable in the 2ormat Cells dialog are as follows.

2ine arrangement X select the style of cell borders. Default X select a predefined border style to apply. User defined X clic- on the diagram to apply a border to one of the edges or diagonal
lines across the cell.

2ine X select the line style for the cell borders. St2le X select the line style to be used for the border. <idth X enter a width to be used for the border line. $olor X select a color to be used for the border line. +pacing to contents X specify the amount of space that you want to lea(e between the
border and the contents of the selection.

Left X enter the distance between the left border and the contents of the selection. 3ight X enter the distance between the right border and the contents of the selection. (op X enter the distance between the top border and the contents of the selection. Bottom X enter the distance between the bottom border and the contents of the selection. S2nchroni1e X applies the same spacing to contents setting to all four borders when you enter a new distance.

+hadow style X applies a shadow effect to borders. 2or the best results' only apply this
effect when all four borders are (isible.

Position X select a shadow style for the selected borders. Distance X enter the width of the shadow. $olor X select a color for the shadow.

&9

LibreOffice ".# $alc Guide

Formatting cell backgrounds


To format the bac-ground color for a cell or a group of cells $see $hapter " Using St2les and (emplates in $alc for more information&% 1& ,elect a cell or a range of cells. 2& Hight+clic- on the selection and select Format Cells from the conte3t menu' or go to Format < Cells on the menu bar' or press $trl5# to open the 2ormat Cells dialog. 3& Clic- on the Bac4ground tab. <& ,elect a color from the color palette. A& Clic- =6 to sa(e your changes and close the dialog. @& )lternati(ely' clic- on the 7ackground Color icon a color from the 4ac-ground color palette. on the 2ormatting toolbar and select

AutoFormat of cells and sheets


*sing AutoFormat
You can use )uto2ormat to format a group of cells. 1& ,elect the cells in at least three columns and rows' including column and row headers' that you want to format. 2& Go to Format < AutoFormat on the menu bar to open the AutoFormat dialog $2igure <0&. 3& ,elect the type of format and format color from the list <& Cf necessary' clic- 4ore to open Formatting if it is not (isible. A& ,elect the formatting properties to be included in the )uto2ormat function. @& Clic- =6 to apply the changes and close the dialog.

'igure "8: ,uto'ormat dialog

%efining a new AutoFormat


You can define a new )uto2ormat so that it becomes a(ailable for use in all spreadsheets. 1& 2ormat the data type' font' font siFe' cell borders' cell bac-ground' and so on for a group of cells.

$hapter 9 )ntering= )diting= and 'ormatting Data

&3

2& Go to #dit < +elect All on the menu bar to select the whole spreadsheet. 3& Go to Format < AutoFormat to open the )uto2ormat dialog and the Add button is now acti(e. <& Clic- Add. A& Cn the @ame bo3 of the )dd )uto2ormat dialog that opens' type a meaningful name for the new format and clic- =6. @& Clic- =6 to close the dialog. The new )uto2ormat is now a(ailable in the 'ormat list in the )uto2ormat dialog.

*sing themes
Calc comes with a predefined set of formatting themes that you can apply to spreadsheets. Ct is not possible to add themes to Calc and they cannot be modified. You can modify their styles after you apply them to a spreadsheet' but the modified styles are only a(ailable for use for that spreadsheet when you sa(e the spreadsheet.

'igure "#: (heme Selection dialog To apply a theme to a spreadsheet% 1& Clic- the Choose ,hemes icon in the Tools toolbar to open the Theme ,election dialog $2igure <1&. Cf the Tools toolbar is not (isible' go to >iew < ,oolbars on the menu bar and select ,ools. The Theme ,election dialog lists the a(ailable themes for the whole spreadsheet. 2& ,elect the theme that you want to apply. )s soon as you select a theme' the theme styles are applied to the spreadsheet and are immediately (isible. 3& Clic- =6. <& Cf you wish' you can now open the ,tyles and 2ormatting window to modify specific styles. These modifications do not modify the themeN they only change the appearance of the style in the specific spreadsheet you are creating. 2or more about modifying styles' see $hapter " Using St2les and (emplates in $alc.

&"

LibreOffice ".# $alc Guide

>alue highlighting
The (alue highlighting function displays cell contents in different colors' depending on the type of content. )n e3ample of (alue highlighting is shown in 2igure <2.

Te3t is shown in blac-. 2ormulas are shown in green. umbers are shown in blue.

'igure "9: )*ample of value highlighting The (alue highlighting colors o(erride any colors used in formatting. This color change applies only to the colors seen on a display. 0hen a spreadsheet is printed' the original colors used for formatting are printed. Go to >iew < >alue ;ighlighting on the menu bar' or use the -eyboard shortcut $trl5'- to turn the function on or off. 0hen (alue highlighting is switched off' the original formatting colors are used for display. You can ma-e (alue highlighting the default when opening a spreadsheet in Calc' by selecting ,ools < =ptions < 2ibre=ffice Calc < >iew e >alue ;ighlighting. This default mode for (alue highlighting may not be what you want if you are going to format the cells for printing.

*sing conditional formatting


You can set up cell formats to change depending on conditions that you specify. Conditional formatting is used to highlight data that is outside the specifications that you ha(e set. Ct is recommended not to o(eruse conditional formatting as this could reduce the impact of data that falls outside the specifications that you ha(e set. ,ee KConditional formatting e3ampleL on page @* for an e3ample on how to use conditional formatting.
Conditional formatting depends upon the use of styles and the )utoCalculate feature must be enabled. Cf you are not familiar with styles' see $hapter " Using St2les and (emplates in $alc for more information.

?ote

+etting up conditional formatting


1& Dnsure that )utoCalculate is enabled% ,ools < Cell Contents < AutoCalculate. 2& ,elect the cells where you want to apply conditional formatting.

'igure "3: $onditional 'ormatting dialog E $ondition


$hapter 9 )ntering= )diting= and 'ormatting Data &%

3& Go to Format < Conditional Formatting < Condition $2igure <3&' Color scale $2igure <<& or %ata 7ar $2igure <A& on the menu bar to open the Conditional 2ormatting dialog. )ny conditions already defined are displayed. <& Clic- Add to create and define a new condition. Hepeat this step as necessary. A& ,elect a style from the styles already defined in the ,ppl2 St2le drop+down list. Hepeat this step as necessary. @& )lternati(ely' select ?ew +tyle to open the Cell ,tyle dialog $2igure <@& and create a new cell style. Hepeat this step as necessary. E& Clic- =6 to sa(e the conditions and close the dialog. The selected cells are now set to apply a result using conditional formatting.

'igure "": $onditional 'ormatting dialog E $olor Scale

'igure "%: $onditional 'ormatting dialog E Data Bar

'igure "&: $ell St2le dialog

&&

LibreOffice ".# $alc Guide

,ypes of conditional formatting


Condition
Condition is the starting point when using conditional formatting. /ere you can define what formats to use to highlight any data in your spreadsheet that falls outside the specifications that you ha(e defined.

Color scale
!se Color scale to set the bac-ground color of cells depending on the (alue of the data in a spreadsheet cell. Color scale can only be used when All Cells has been selected for the condition. You can use either two or three colors for your color scale.

*ata bars
5ata bars pro(ide a graphical representation of data in your spreadsheet. The graphical representation is based on the (alues of data in a selected range. Clic- on 4ore =ptions in the Conditional 2ormatting dialog to define how your data bars will loo-. 5ata bars can only be used when All Cells has been selected for the condition.

con sets
Ccon sets display an icon ne3t to your data in each selected cell to gi(e a (isual representation of where the cell data falls within the defined range that you set. The icons sets a(ailable are colored arrows' gray arrows' colored flags' colored signs' symbols' bar ratings and ?uarters. Ccon sets can only be accessed when the Conditional 2ormatting dialog has been opened and All Cells has been selected for the condition.

Conditional formatting management


To see all the conditional formatting defined in your spreadsheet and any styles used% 1& Go to Format < Conditional Formatting < 4anage on the menu bar to open the 1anage Conditional 2ormatting dialog $2igure <E&. 2& ,elect a range from the 3ange list and clic- #dit to redefine the conditional formatting. 3& ,elect a range from the 3ange list and clic- 3emove to delete the conditional formatting. The deletion is immediate with no confirmation. <& ,elect Add to create a new definition of conditional formatting. A& Clic- =6 to sa(e your changes and close the dialog.

'igure "A: :anage $onditional 'ormatting dialog

$hapter 9 )ntering= )diting= and 'ormatting Data

&A

Copying cell styles


To apply the style used for conditional formatting to other cells later% 1& Clic- one of the cells that has been assigned conditional formatting and copy the cell to the clipboard. 2& ,elect the cells that are to recei(e the same formatting as the copied cell. 3& Go to #dit < Paste +pecial on the menu bar to open the "aste ,pecial dialog $2igure 3< on page AA&. <& 1a-e sure that only 2ormats is selected and clic- =6 to paste the conditional formatting into the cell.

Conditional formatting e.ample


0ith conditional formatting' you can' for e3ample' highlight the totals that e3ceed the a(erage (alue of all totals. Cf the totals change' the formatting changes correspondingly' without ha(ing to apply other styles manually. Ct is recommended that the ,tyles and 2ormatting dialog is open and (isible before proceeding.

*efinin% conditions
1& ,elect the cells where you want to apply a conditional style. 2& Go to Format < Conditional Formatting < Condition' Color scale or %ata bar from the menu bar to open the Conditional 2ormatting dialog. 3& Dnter the conditions you want to use for conditional formatting.

Generatin% nu(ber values


You may want to gi(e certain (alues in your tables particular emphasis. 2or e3ample' in a table of turno(ers' you can show all the (alues abo(e the a(erage in green and all those below the a(erage in red. This is possible with conditional formatting. 1& Create a table in which a few different (alues occur. 2or your test you can create tables with any random numbers. Cn one of the cells enter the formula YH) 5$&' and you will obtain a random number between 0 and 1. Cf you want integers of between 0 and A0' enter the formula YC T$H) 5$&ZA0&. 2& Copy the formula to create a row of random numbers. 3& Clic- the bottom right corner of the selected cell' and drag to the right and downward until the desired cell range is selected.

*efinin% cell st$les


The ne3t step is to apply a cell style to all (alues that represent abo(e+a(erage turno(er and one to cells that are below the a(erage. 1& Hight+clic- in a blan- cell and select Format Cells in the conte3t menu to open the 2ormat Cells dialog. 2& Clic- the 4ac-ground tab and select a bac-ground color' then clic- =6. 3& Cn the Conditional 2ormatting dialog' select ?ew +tyle from the ,ppl2 St2le drop+down list to open the Cell ,tyle dialog. <& Dnter a name of the new style. 2or this e3ample' name the style ,bove. A& 5efine a second style' clic- again in a blan- cell and proceed as described abo(e. )ssign a different bac-ground color to the cell and assign a name. 2or this e3ample' name the style Below.

&-

LibreOffice ".# $alc Guide

Calculatin% avera%e
Cn our particular e3ample' we are calculating the a(erage of the random (alues. The result is placed in a cell% 1& Clic- in a blan- cell' for e3ample' .1<' and go to nsert < Function on the menu bar' or clic- the Function 8i5ard icon on the 2ormula bar to open the 2unction 0iFard dialog. 2& ,elect )BDH)GD from the 2unction list. 3& !se the cursor to select all your random numbers. <& Clic- =6 to the 2unction 0iFard.

)ppl$in% cell st$les


ow you can apply the conditional formatting to the sheet% 1& ,elect all cells containing the random numbers. 2& Go to the Format < Conditional Formatting on the menu bar to open the Conditional 2ormatting dialog. 3& 5efine the condition for each cell as follows% if cell (alue is less than .1<' format with cell style Below ;H if cell (alue is greater than or e?ual to .1<' format with cell style ,bove.

;iding and showing data


Cn Calc you can hide elements so that they are neither (isible on a computer display nor printed when a spreadsheet is printed. /owe(er' hidden elements can still be selected for copying if you select the elements around themN for e3ample' if column 4 is hidden' it is copied when you select columns ) and C. 0hen you re?uire a hidden element again' you can re(erse the process and show the element.

;iding data
!"eets2 rows2 and colu(ns
1& ,elect the sheet' row' or column you want to hide. 2& Go to Format on the main menu bar and select +heet' 3ow or Column. 3& ,elect ;ide from the menu and the sheet' row' or column can no longer (iewed or printed. )lternati(ely' right+clic- on the sheet tab' row header' or column header and select ;ide from the conte3t menu.

Cells
1& Go to ,ools < Protect %ocument < +heet on the menu bar to open the Protect +heet dialog dialog $2igure <*&. 2& ,elect Protect this sheet and the contents of protected cells. 3& Create a password and then confirm the password. <& ,elect or deselect the options for ,llow all users of this sheet to: so users can select protected or unprotected cells. A& Clic- =6 to sa(e the changes and close the dialog. @& ,elect the cells you want to hide. E& Go to Format < Cells on the menu bar' or right+clic- and select Format Cells from the conte3t menu' or use the -eyboard shortcut $trl5# to open the Format Cells dialog $2igure <:&. *& Clic- the $ell Protection tab and select an option for hiding and printing the cells. :& Clic- =6 to sa(e the changes and close the dialog.
$hapter 9 )ntering= )diting= and 'ormatting Data &.

'igure "-: Protect Sheet dialog

'igure ".: 'ormat $ells dialog E $ell Protection page


0hen data in cells are hidden' it is only the data contained in the cells that are hidden and the protected cells cannot be modified. The blan- cells remain (isible in the spreadsheet. 0hen data in cells are hidden' it is only the data contained in the cells that are hidden and the protected cells cannot be modified. The blan- cells remain (isible in the spreadsheet.

?ote

?ote

+howing data
!"eets2 rows2 and colu(ns
1& ,elect the sheets' rows or columns each side of the hidden sheet' row or column. 2& Go to Format on the menu bar and select +heet' 3ow or Column. 3& ,elect +how from the conte3t menu and the sheet' row or column will be displayed and can be printed. <& )lternati(ely' right+clic- on the sheet tabs' row headers or column headers and select +how from the conte3t menu.

Cells
1& Go to ,ools < Protect %ocument < +heet on the menu bar to open the Protect +heet dialog dialog $2igure <*&. 2& Dnter the password to unprotect the sheet and clic- =6.
A8 LibreOffice ".# $alc Guide

3& Go to Format < Cells on the menu bar' or right+clic- and select Format Cells from the conte3t menu' or use the -eyboard shortcut $trl5# to open the Format Cells dialog $2igure <:&. <& Clic- the $ell Protection tab and deselect the hide options for the cells. A& Clic- =6.

(roup and outline


Cf you are continually hiding and showing the same cells' you can create an outline of your data and group rows or columns together so that you can collapse a group to hide it or e3pand a group to show it using a single clic-. The basic controls for grouping and outlining show plus $R& or minus $+& signs on the group indicator to show or hide rows or columns. /owe(er' if there are groups nested within each other' the basic controls ha(e numbered buttons so you can hide the different le(els of nested groups.

Groupin%
To group rows or columns% 1& ,elect the cells you want to group in your spreadsheet. 2& Go to %ata < (roup and =utline < (roup on the menu bar' or press the '#9 -ey. 3& Cn the Group dialog that opens' select either 3ows or $olumns and clic- =6. ) group indicator appears to the left of any rows grouped or abo(e any columns grouped. 2igure A0 shows a group indicator on the left of the first two rows of the spreadsheet ha(e been grouped.

'igure %8: Group indicator

3idin% details
To hide the details of any group of rows or columns% 1& Clic- on the minus $+& sign on the group indicator. 2& )lternati(ely' select a cell within the group and go to %ata < (roup and =utline < ;ide %etails on the menu bar. 3& The rows or columns are hidden and the minus $+& sign becomes a plus $R& sign on the group indicator.

!"owin% details
To show the details of any hidden groups or rows or columns% 1& Clic- on the plus $R& sign on the group indicator. 2& )lternati(ely' select a cell on each side of the hidden group and go to %ata < (roup and =utline < +how %etails on the menu bar.
$hapter 9 )ntering= )diting= and 'ormatting Data A#

3& The hidden rows or columns are displayed and the plus $R& sign becomes a minus $+& sign on the group indicator.

+n%roupin%
To ungroup any groups of rows or columns% 1& 1a-e sure the grouped rows or columns are displayed. 2& Go to %ata < (roup and =utline < *ngroup on the menu bar' or use the -eyboard combination $trl5'#9. 3& ,elect either 3ows or $olumns to ungroup and clic- =6.

?ote

)ny hidden groups of rows or columns must be displayed. Cf they are hidden' then the grouped rows or columns are deleted from your spreadsheet. Cf there are nested groups' only the last group of rows or columns created is ungrouped.

?ote

)utoOutline
Cf a selected cell range contains formulas or references' Calc automatically outlines the selection. 2or e3ample' in 2igure A1 the cells for the 1st and 2nd ?uarters each contain a sum formula for the three cells to their left. Cf you apply the Auto=utline command' the columns are grouped into two ?uarters. To apply the )uto;utline function' go to %ata < (roup and =utline < Auto=utline on the menu bar. Calc will then chec- for cells that contain formulas or references and automatically group the cells as necessary.

'igure %#: )*ample of ,utoOutline

&e(ovin%
To remo(e any cell groups of rows or columns' go to %ata < (roup and =utline < 3emove on the menu bar and any groups are remo(ed. )ny cell group of rows or columns that are hidden' the grouping is remo(ed from the cells and the cells are displayed in your spreadsheet.

Filtering
) filter is a list of conditions that each entry has to meet to be displayed. Calc pro(ides three types of filter%

+tandard X specifies the logical conditions to filter your data.

A9

LibreOffice ".# $alc Guide

AutoFilter X filters data according to a specific (alue or string. )utomatically filters the
selected cell range and creates one+row list bo3es where you can choose the items that you want to display.

Advanced X uses filter criteria from specified cells. )ppl$in% a standard filter
) standard filter is more comple3 than )uto2ilter. You can set as many as eight conditions as a filter' combining them with the operators ,@D or O3. ,tandard filters are mostly useful for numbers' although a few of the conditional operators can also be used for te3t. 1& ,elect a cell range in your spreadsheet. 2& Go to %ata < Filter < +tandard Filter on the menu bar to open the ,tandard 2ilter dialog $2igure A2&. 3& ,pecify the filter criteria and filtering options that you want to use. <& Clic- =6 to carry out standard filtering and close the dialog. )ny records that match the filter criteria and options that you specified are shown.

'igure %9: Standard 'ilter dialog The filter criteria used in standard filtering defines a filter by indicating the type of line' the name of the field' a logical condition and a (alue or a combination of arguments.

=perator X for the following arguments' you can choose between the logical operators
) 5 / ;H.

Field name X specifies the field names from the current table to set them in the argument.
You will see the column identifiers if no te3t is a(ailable for the field names.

Condition X specifies the comparati(e operators through which the entries in the Field
name and >alue fields can be lin-ed.

>alue X specifies a (alue to filter the field. The >alue list bo3 contains all possible (alues
for the specified Field name. ,elect a (alue to be used in the filter' including )mpt2 and @ot )mpt2 entries.

Case sensitive X distinguishes between uppercase and lowercase letters when filtering the
data.

$hapter 9 )ntering= )diting= and 'ormatting Data

A3

3ange contains column labels X includes the column labels in the first row of a cell
range.

Copy results to X select the chec- bo3 and then select the cell range where you want to
display the filter results. You can also select a named range from the list.

3egular e.pression X select to use wildcards in the filter definition. ,ee #ibre;ffice /elp
for a list of the regular e3pressions that #ibre;ffice supports. Cf selected' you can use regular e3pressions in the >alue field if the Condition list bo3 is set to >Y> DJ!)# or >fe> ! DJ!)#. This also applies to the respecti(e cells that you reference for an ad(anced filter.

?o duplication X e3cludes duplicate rows from the list of filtered data. 6eep filter criteria X select Copy results to and then specify the destination range where
you want to display the filtered data. Cf this bo3 is chec-ed' the destination range remains lin-ed to the source range. You must ha(e defined the source range under %ata < %efine range as a database range. You can also reapply the defined filter at any time by clic-ing into the source range and then go to %ata < 3efresh 3ange.

'igure %3: ,uto'ilter e*ample

)ppl$in% an )utoFilter
)n )uto2ilter adds a drop+down list to the top row of one or more data columns which lets you select the rows to be displayed. The list includes e(ery uni?ue entry in the selected cells sorted into le3ical order $see http%//sheepsystems.com/boo-dog//elp4oo-/#e3ical;rder.html for an
A" LibreOffice ".# $alc Guide

e3planation of le3ical order&. )uto2ilter can be used on multiple sheets without first defining a database range. 1& Clic- in a cell range on your spreadsheet. Cf you want to apply multiple )uto2ilters to the same sheet' you must first define database ranges' then apply the )uto2ilters to the database ranges. 2& Go to %ata < Filter < AutoFilter on the menu bar. )n arrow button is added to the head of each column in the database range. 3& Clic- the arrow or small triangle in the column that contains the (alue or string that you want to set as the filter criteria $shown in 2igure A3&. <& ,elect the (alue or string that you want to use as the filter criteria. The records that match the filter criteria that you selected are then shown.

)ppl$in% an advanced filter


)n ad(anced filter has a structure similar to a standard filter. The difference is that the )d(anced 2ilter arguments are not entered in a dialog. Cnstead' filters can be entered in a blan- area of a spreadsheet' then referenced by the filter dialog to apply the filters. 1& ,elect a cell range in your spreadsheet. 2& Go to %ata < Filter < Advanced Filter on the menu bar to open the )d(anced 2ilter dialog $2igure A<&. 3& Cn 3ead filter criteria from' select the named range' or enter the cell range that contains the filter criteria that you want to use <& Clic- =6 to carry out ad(anced filtering and close the dialog. )ny records that match the filter criteria and options that you specified are shown.

'igure %": ,dvanced 'ilter dialog

?ote

The options for ad(anced filtering are the same as those used for standard filtering' see K)pplying a standard filterL on page E3 for more information.

+orting records
,orting within Calc arranges the cells in a sheet using the sort criteria that you specify. ,e(eral criteria can be used and a sort applies each criteria consecuti(ely. ,orts are useful when you are searching for a particular item and become e(en more useful after you ha(e filtered data. )lso' sorting is useful when you add new information to a spreadsheet. 0hen a spreadsheet is long' it is usually easier to add new information at the bottom of the sheet' rather than adding rows in their correct place. )fter you ha(e added information' you can then sort the records to update the spreadsheet.
$hapter 9 )ntering= )diting= and 'ormatting Data A%

+ort dialog
To sort cells in a spreadsheet using the ,ort dialog $2igure AA&% 1& ,elect the cells to be sorted. 2& Go to %ata < +ort on the menu bar to open the ,ort dialog. 1a-e sure the +ort Criteria page is open. 3& ,elect the sort criteria from the drop+down lists. The selected lists are populated from the selected cells. <& ,elect either ascending order $)+T' 1+:& or descending order $T+)' :+1&. A& Clic- =6 and the sort is carried out on your spreadsheet.

'igure %%: Sort dialog E Sort $riteria page

'igure %&: Sort dialog E Options page

+ort options
;n the ;ptions page of the ,ort dialog $2igure A@&' you can set additional options%

Case +ensitivity X sorts first by uppercase letters and then by lowercase letters. 2or )sian
languages' special handling applies.
A& LibreOffice ".# $alc Guide

?ote

2or )sian languages' select Case ,ensiti(ity to apply multi+le(el collation. 0ith multi+le(el collation' entries are first compared in their primiti(e forms with their cases and diacritics ignored. Cf they e(aluate as the same' their diacritics are ta-en into account for the second+le(el comparison. Cf they still e(aluate as the same' their cases' character widths' and .apanese 6ana difference are considered for the third+le(el comparison.

3ange contains columnHrow labels X omits the first row or the first column in the
selection from the sort. The %irection setting at the bottom of the dialog defines the name and function of this chec- bo3.

nclude formats X preser(es the current cell formatting. #nable natural sort X natural sorting is a sort algorithm that sorts string+prefi3ed numbers
based on the (alue of the numerical element in each sorted number' instead of the traditional way of sorting them as ordinary strings. 2or instance' assume you ha(e a series of (alues such as' )1' )2' )3' )<' )A' )@' ...' )1:' )20' )21. 0hen you put these (alues into a range of cells and run the sort' it will become )1' )11' )12' )13' ...' )1:' )2' )20' )21' )3' )<' )A' ...' ):. 0hile this sorting beha(ior may ma-e sense to those who understand the underlying sorting mechanism' to the rest of the population it seems completely biFarre' if not outright incon(enient. 0ith natural sorting selected' (alues such as the ones in the abo(e e3ample are sorted correctly' which impro(es the con(enience of sorting operations in general.

Copy sort results to X copies the sorted list to the cell range that you specify. ,elect a
named cell range where you want to display the sorted list' or enter a cell range in the input bo3.

Custom sort order X select this option and then select the custom sort order that you want
to apply. To define a custom sort order' go to 2ibre=ffice < Preferences < 2ibre=ffice Calc < +ort 2ists.

2anguage X select the language for the sorting rules. =ptions X select a sorting option for the language. 2or e3ample' select the Uphoneboo-U
option for German to include the umlaut special character in the sorting.

,op to 7ottom K+ort 3owsL X sorts rows by the (alues in the acti(e columns of the
selected range.

2eft to 3ight K+ort ColumnsL X sorts columns by the (alues in the acti(e rows of the
selected range.

Muick sort
Cf the columns in your spreadsheet ha(e a header with a te3t format' you can use a ?uic- sort. 1& ,elect a cell or a cell range to be sorted. 2& Clic- the +ort Ascending or +ort %escending icons on the ,tandard toolbar.

Find and replace


Calc has two ways to find te3t within a document% the 2ind toolbar and the 2ind S Heplace dialog.

'igure %A: 'ind toolbar

$hapter 9 )ntering= )diting= and 'ormatting Data

AA

Find toolbar
1& Go to >iew < ,oolbars < Find on the menu bar' or go to #dit < Find on the menu bar' or use the -eyboard shortcut $trl5' to open the 2ind toolbar $2igure AE&. 4y default the 2ind toolbar is doc-ed in the lower left+corner of the Calc window. You can undoc- the toolbar and mo(e it to where you choose. 2& Type a search term in the 2ind bo3. 3& ,elect 4atch Case to refine your search. 2or e3ample' Owner is your search term and selecting 4atch Case will only find Owner and will not find owner. <& Clic- the Find ?e.t or Find Previous term' continue clic-ing the icon. icons. To find other occurrences of the same

Find B 3eplace dialog

'igure %-: 'ind > 3eplace dialog

A-

LibreOffice ".# $alc Guide

Findin%
1& Go to #dit > Find B 3eplace on the menu bar' or use the -eyboard shortcut $trl5+' or select the Find B 3eplace icon on the 2ind toolbar to open the 2ind S Heplace dialog $2igure A*&. Dnter or select the search criteria in the Search for bo3. Cf necessary' clic- on Other Options so that you can increase the number of search filters that you can apply to your search. Clic- Find to locate the first instance of the search criteria you entered. Clic- Find again to locate the ne3t instance of your search criteria. Clic- Find All to locate all instances of your search criteria. The instances of your search criteria will be highlighted in the spreadsheet.

2& 3& <& A& @&

&eplacin%
1& Go to #dit > Find B 3eplace on the menu bar' or use the -eyboard shortcut $trl5+' or select the Find B 3eplace icon on the 2ind toolbar to open the 2ind S Heplace dialog $2igure A*&. Dnter or select the search criteria in the Search for bo3. Dnter or select the replace criteria in the 3eplace with bo3. Cf necessary' clic- on Other Options so that you can increase the number of search filters that you can apply to your find and replace. Clic- 3eplace to locate and replace the first instance of the search criteria you entered with your replacement criteria. Clic- 3eplace again to locate and replace the ne3t instance of the search criteria you entered with your replacement criteria. Clic- 3eplace All to locate and replace all instances of the search criteria you entered with your replacement criteria.
!se 3eplace All with cautionN otherwise' you may end up with some highly embarrassing mista-es. ) mista-e with 3eplace All might re?uire a manual' word+ by+word search to fi3' if it is not disco(ered in time to undo it.

2& 3& <& A& @& E&

?ote

Find 4 &eplace options


The options a(ailable to refine your find and replace are as follows%

+earch for X enter the te3t that you want to search for' or select a pre(ious search from the
list.

3eplace with X enter the replacement te3t' or select a recent replacement te3t or style
from the list.

4atch case X distinguishes between uppercase and lowercase characters. #ntire Cells X searches for whole words or cells that are identical to the search te3t. Current selection only X searches only the selected te3t or cells. 7ackwards X search starts at the current cursor position and goes bac-wards to the beginning of the file. more information on the use of regular e3pressions.

3egular e.pressions X select to use wildcards in your search. ,ee #ibre;ffice /elp for +imilarity +earch X find terms that are similar to the +earch for te3t. ,elect this chec-bo3'
and then clic- the ... button to define the similarity options.
$hapter 9 )ntering= )diting= and 'ormatting Data A.

+earch for +tyles X searches for te3t formatted with the style that you specify. ,elect this
option and then select a style from the +earch for list. To specify a replacement style' select a style from the 3eplace with list.

4atch character width X distinguishes between half+width and full+width character formsN
only a(ailable if )sian languages are enabled.

+ounds like KNapaneseL X specify the search options for similar notation used in .apanese
te3t. ,elect this option' and then clic- the ... button to specify the search options. This option is only a(ailable if )sian languages are enabled.

+earch in X select either 'ormulas' Halues' or @otes to search for the characters that you
specify in (alues' in the results of formulas' or in notes.

+earch direction X determines the order for searching the cells. +earch in all sheets X searches through all of the sheets in the current spreadsheet file.

-8

LibreOffice ".# $alc Guide

$hapter 3 $reating $harts and Graphs


Presenting information visuall2

ntroduction
Charts and graphs can be powerful ways to con(ey information to the reader. #ibre;ffice Calc offers a (ariety of different chart and graph formats for your data. !sing Calc' you can customiFe charts and graphs to a considerable e3tent. 1any of these options enable you to present your information in the best and clearest manner. 2or readers who are interested in effecti(e ways to present information graphically' two e3cellent introductions to the topic are 0illiam ,. Cle(elandIs (he elements of graphing data' 2nd edition' /obart "ress $1::<& and Ddward H. TufteIs (he Hisual Displa2 of Cuantitative 0nformation' 2nd edition' Graphics "ress $2001&.

Chart 8i5ard
Calc uses a Chart 0iFard to create charts or graphs from your spreadsheet data. )fter the chart has been created as an obGect in your spreadsheet' you can then change the chart type' adGust data ranges and the edit the chart using the functions a(ailable in the Chart 0iFard. Dach change you ma-e using is automatically reflected in the chart obGect placed onto your spreadsheet. This is described in the following sections.

Creating charts and graphs


To demonstrate the process of creating charts and graphs in Calc' we will use e3ample data as shown in 2igure A: to create a chart.

'igure %.: )*ample data for creating a chart 1& ,elect the cells containing the data to be included in the chart by highlighting $2igure A:&. The selection does not need to be in a single bloc- as in 2igure A:N you can also choose indi(idual cells or groups of cells $columns or rows&. ,ee $hapter # 0ntroducing $alc for more information about selecting cells and ranges of cells. 2& Go to nsert < Chart on the main menu bar' or clic- the Chart icon on the ,tandard toolbar to open the Chart 0iFard dialog $2igure @0&. ) sample chart is created using the selected data and is placed onto the spreadsheet as an obGect $2igure @1&.

-9

LibreOffice ".# $alc Guide

'igure &8: $hart <i1ard dialog E selecting chart t2pe

'igure &#: )*ample chart automaticall2 created using $hart <i1ard

?ote

Cf you want to plot any unconnected rows or columns of data' select the first data series' then hold down the $trl -ey and select the ne3t series. The two data series you are selecting must be in separate columns or rows. ;therwise Calc will assume that you are adding to the same data series.

,ip

4efore opening the Chart 0iFard' place the cursor or select a cell anywhere in the area of the data. The Chart 0iFard will then guess the range of the data to create a sample chart. .ust be careful that you ha(e not included the title of your chart when you ma-e your selection.

$hapter 3 $reating $harts and Graphs

-3

+electing chart type


Calc offers a choice of ten basic chart types and the options a(ailable (ary according to the type of chart you select. The initial chart created using the Chart 0iFard is a normal column chart and by default it is a 25 chart. This is highlighted with a surrounding border in the pre(iew bo3 in 2igure @0 and the chart name is shown below the pre(iew. To change the chart type% 1& ,elect the type of chart from the list in Choose a chart type $2igure @0&. 2& ,elect a chart icon in the pre(iew bo3 and chec- to see if it is the chart type you re?uire. 2or more information on chart types' see KGallery of chart typesL on page 10*. 3& 2or $olumn' Bar' Pie or ,rea chart types only and if you want to use a 35 chart' select the chec-bo3 '% 2ook and select the type of 35 (iew for your chart $3ealistic or Simple&. <& ,elect the options you want to use for your chart. The options a(ailable are dependent of the type of chart selected. A& Clic- ?e.t<< to mo(e onto the ne3t step in creating an e3ample chart and ma-e changes to the data range and a3es labels $2igure @2&. @& Cf you are satisfied with your chart' clic- Finish to close the Chart 0iFard and create an e3ample chart obGect on your spreadsheet.

?ote

To demonstrate the process of creating charts using the following sections' please lea(e the chart type as 25 column normal.

'igure &9: $hart <i1ard dialog E selecting data range

%ata range and a.es labels


Cn the 5ata Hange step of the Chart 0iFard $2igure @2&' you can manually correct any mista-es you ha(e made in selecting the data for your chart' how your chart is plotted and how to label your chart. 1& Cf necessary' change the rows and columns used as data for your chart by editing the cell references in the Data range te3t bo3.

-"

LibreOffice ".# $alc Guide

2& ,elect whether to plot chart data by using either rows or columns as the data series. This is useful if you use a chart type such as 5onut or "ie to display your data. 3& ,elect whether to use the first row' or first column' or both' as labels for the a3es of the chart. <& Clic- ?e.t<< to mo(e onto the ne3t step in creating an e3ample chart and ma-e changes to the data series $2igure @3&. A& Cf you are satisfied with your chart' clic- Finish to close the Chart 0iFard and create an e3ample chart obGect on your spreadsheet.
) data range may consist of more than one region in a spreadsheet' for e3ample Ug,heet1.)1%)ANg,heet1.51%5AU is also a (alid data range.

?ote

Cf you want a data range of multiple cell areas that are not ne3t to each other' enter the first range' then manually add a semicolon at the end of the te3t bo3' then enter the other ranges. !se a semicolon as delimiter between ranges.

'igure &3: $hart <i1ard dialog E selecting data series

%ata series
;n the 5ata ,eries page of the Chart 0iFard $2igure @3& you can change the source range of all data series separately' including their labels. You can also change the range of the categories and remo(e unnecessary data series or add data series from other cells. Dach named data series has its ranges and its indi(idual Y+(alues listed. This is useful if you ha(e (ery specific re?uirements for data in your chart' as you can include or lea(e out these ranges. Cn the %ata series list bo3 you see a list of all data series in the current chart. 1& To organiFe the data series' select an entry in the %ata series list. 2& Clic- Add to add another data series below the selected entry. The new data series has the same type as the selected entry. 3& Clic- 3emove to remo(e the selected entry from the %ata series list. <& !se the *p and %own buttons to mo(e the selected entry in the list up or down. This does not change the order in the data source table' but changes only the arrangement in the chart.

$hapter 3 $reating $harts and Graphs

-%

A& To change the cell reference that is used to name a data series' select an entry in the %ata series list and edit the cell reference in the 3ange for ?ame te3t bo3. @& To change the cell reference that is to gi(e a category in a data series' select an entry in the %ata series list and edit the cell reference in the Categories te3t bo3. E& Clic- ?e.t<< to mo(e onto the ne3t step in creating an e3ample chart and ma-e changes to the chart elements $2igure @A&. *& Cf you are satisfied with your chart' clic- Finish to close the Chart 0iFard and create an e3ample chart obGect on your spreadsheet.

'igure &": $hart elements

Chart elements
The chart elements for 25 and 35 charts are shown in 2igure @<.

The chart wall contains the graphic of the chart displaying the data. The chart area is the area surrounding the chart graphic. The chart floor is only a(ailable for 35 charts. The chart title and subtitle' chart legend' a3es labels and a3es names are in the chart area and can be added when using the Chart 0iFard to create a chart.

;n the Chart Dlements page $2igure @A&' you can add or change the titles' a3es names and grids. !se a title that draws the attention of (iewers to the purpose of the chart and what you want them to see. 2igure @< shows the (arious chart elements that can be placed onto a chart. 1& Dnter a title and subtitle you want to use in the ,itle and +ubtitle te3t bo3es. 2or e3ample' a better title for this e3ample chart might be (he Performance of :otor and Other 3ental Boats. 2& Dnter a name you want to use in the O a.is and I a.is te3t bo3es' for e3ample' (housands for the Y a3is. The D a.is te3t bo3 is only acti(e if you are creating a 35 chart. 3& ,elect the %isplay legend chec-bo3 and where you want the legend displayed on your chart X 2eft' 3ight' ,op or 7ottom. <& Cn Displa2 grids' select the O a.is or I a.is chec-bo3es to display a grid on your chart. The D a.is chec-bo3 is only acti(e if you are creating a 35 chart. Grid lines are not a(ailable for pie charts.

-&

LibreOffice ".# $alc Guide

A& Clic- Finish to close the Chart 0iFard and create an e3ample chart obGect on your spreadsheet.

'igure &%: $hart <i1ard dialog E selecting and changing chart elements
Clic-ing Finish closes the Chart 0iFard' but the chart is still in edit mode and you can still modify it. Clic- outside the chart in any cell or a data series to complete the chart creation.

?ote

#diting charts and graphs


)fter you ha(e created a chart' you may find that data has changed or you would li-e to impro(e the loo- of the chart. Calc pro(ides tools for changing the chart type' chart elements' data ranges' fonts' colors' and many other options' and this is described in the following sections.

Changing chart type


You can change the chart type at any time. 1& ,elect the chart by double+clic-ing on it to enter edit mode. The chart should now be surrounded by a gray border. 2& Go to Format < Chart ,ype on the main menu bar' or clic- the Chart ,ype icon on the 2ormatting toolbar' or right+clic- on the chart and select Chart ,ype from the conte3t menu to open the Chart Type dialog. This is similar to the Chart 0iFard dialog shown in 2igure @0 on page *<. 3& ,elect a replacement chart type you want to use. 2or more information' see K,electing chart typeL on page *<. <& Clic- =6 to close the dialog. A& Clic- outside the chart to lea(e edit mode.

$hapter 3 $reating $harts and Graphs

-A

#diting data ranges or data series


Cf the data range or data series has changed in your spreadsheet' you can edit them in your chart. 1& ,elect the chart by double+clic-ing on it to enter edit mode. The chart should now be surrounded by a gray border. 2& Go to Format < %ata 3anges on the main menu bar' or right+clic- on the chart and select %ata 3anges from the conte3t menu to open the 5ata Hanges dialog. This dialog has similar pages to the Chart 0iFard dialogs shown in 2igure @2 on page *< and 2igure @3 on page *A. 3& To edit the data range used for the chart' clic- on the %ata 3ange tab. 2or more information' see K5ata range and a3es labelsL on page *<. <& To edit the data series used for the chart' clic- on the %ata +eries tab. 2or more information' see K5ata seriesL on page *A. A& Clic- =6 to close the dialog. @& Clic- outside the chart to lea(e edit mode.

7asic editing of chart elements


4asic editing of the title' subtitle and a3es names in your chart is as follows. 2or more ad(anced editing' see the following sections. 1& ,elect the chart by double+clic-ing on it to enter edit mode. The chart should now be surrounded by a gray border. 2& Go to nsert < ,itles on the main menu bar' or right+clic- in the chart area and select nsert ,itles from the conte3t menu to open the Titles dialog. This dialog is similar to the Chart 0iFard dialog shown in 2igure @A on page *E. 3& Ddit the te3t shown in the (arious te3t bo3es. 2or more information' see KDrror% Heference source not foundL on page Drror% Heference source not found. <& Clic- =6 to close the dialog. A& Clic- outside the chart to lea(e edit mode.

Adding or removing chart elements


/itles2 subtitles and axes na(es
)dding a title' subtitle or a3es names to your chart is the same procedure as gi(en in K4asic editing of chart elementsL on page **. To remo(e a title' subtitle or a3es names from your chart% 1& ,elect the chart by double+clic-ing on it to enter edit mode. The chart should now be surrounded by a gray border. 2& ;pen the Titles dialog as abo(e and delete the te3t from the (arious te3t bo3es. 3& Clic- =6 to close the dialog. <& Clic- outside the chart to lea(e edit mode.

Le%ends
To add a legend to your chart% 1& ,elect the chart by double+clic-ing on it to enter edit mode. The chart should now be surrounded by a gray border. 2& Go to nsert < 2egend on the main menu bar to open the #egend dialog. This dialog is similar to the %isplay legend section on the Chart 0iFard dialog shown in 2igure @A on page *E.

--

LibreOffice ".# $alc Guide

3& ,elect the %isplay legend chec-bo3 and where you want the legend displayed on your chart X 2eft' 3ight' ,op or 7ottom. <& Clic- =6 to close the dialog. A& )lternati(ely' right+clic- in the chart area and select nsert 2egend from the conte3t menu to insert a legend in the default position on the right side of the chart. @& Clic- outside the chart to lea(e edit mode. To remo(e a legend from your chart% 1& ,elect the chart by double+clic-ing on it to enter edit mode. The chart should now be surrounded by a gray border. 2& Go to nsert < 2egend on the main menu bar to open the #egend dialog. 3& 5eselect the %isplay legend chec-bo3. <& Clic- =6 to close the dialog. A& )lternati(ely' right+clic- in the chart area and select %elete 2egend from the conte3t menu. @& Clic- outside the chart to lea(e edit mode.

)xes
To add an a3is to your chart% 1& ,elect the chart by double+clic-ing on it to enter edit mode. The chart should now be surrounded by a gray border. 2& Go to nsert < A.es on the main menu bar' or right+clic- on the chart and select nsertH%elete A.es from the conte3t menu to open the )3es dialog $2igure @@&. 3& ,elect the a3es chec-bo3es that you want to use on your chart. The D a.is chec-bo3 is only acti(e if you are creating a 35 chart. <& Clic- =6 to close the dialog. A& Clic- outside the chart to lea(e edit mode. To remo(e an a3is from your chart% 1& ,elect the chart by double+clic-ing on it to enter edit mode. The chart should now be surrounded by a gray border. 2& ;pen the )3es dialog as abo(e and deselect the chec-bo3es for the a3es you want to remo(e. 3& Clic- =6 to close the dialog. <& Clic- outside the chart to lea(e edit mode.

'igure &&: ,*es dialog

$hapter 3 $reating $harts and Graphs

-.

Grids
The (isible grid lines can help to estimate the data (alues in the chart. The distance of the grid lines corresponds to the inter(al settings in the ,cale tab of the a3is properties. Grid lines are not a(ailable for pie charts. To add a grid to your chart% 1& ,elect the chart by double+clic-ing on it to enter edit mode. The chart should now be surrounded by a gray border. 2& Go to nsert < (rids on the main menu bar to open the Grids dialog. This is the same dialog as the )3es dialog $2igure @@&' but it is titled Grids. 3& ,elect the grid chec-bo3es that you want to use on your chart. The D a.is chec-bo3 is only acti(e if you are creating a 35 chart. <& Clic- =6 to close the dialog. A& Clic- outside the chart to lea(e edit mode. To remo(e a grid from your chart% 1& ,elect the chart by double+clic-ing on it to enter edit mode. The chart should now be surrounded by a gray border. 2& ;pen the Grids dialog as abo(e and deselect the chec-bo3es for the grids you want to remo(e. 3& Clic- =6 to close the dialog. <& Clic- outside the chart to lea(e edit mode.

*ata labels
5ata labels put information about each data point on the chart. They can be (ery useful for presenting detailed information' but you need to be careful not to create a chart that is too cluttered to read.

'igure &A: Data Labels dialog


The te3t for data labels is ta-en from the spreadsheet data and it cannot be changed here. Cf the te3t needs to be abbre(iated' or if it did not label your graph as you were e3pecting' you need to change it in the original data table.

?ote

.8

LibreOffice ".# $alc Guide

To add data labels to your chart% 1& ,elect the chart by double+clic-ing on it to enter edit mode. The chart should now be surrounded by a gray border. 2& ,elect the data series on your chart that you want to label. Cf you do not select a data series' then all data series on your chart will be labelled. 3& Go to nsert < %ata 2abels on the menu bar to open the 5ata #abels dialog $2igure @E&. <& ,elect the options that you want to use for data labels. The options a(ailable for data labels are e3plained below. A& Clic- =6 to close the dialog. @& )lternati(ely' right+clic- on the selected data series and select nsert %ata 2abels from the conte3t menu. This method uses the default setting for the data labels. E& Clic- outside the chart to lea(e edit mode. To remo(e data labels from you chart% 1& ,elect the chart by double+clic-ing on it to enter edit mode. The chart should now be surrounded by a gray border. 2& ,elect the data labels on your chart that you want to remo(e. 3& Go to nsert < %ata 2abels on the menu bar' or right+clic- on the data labels and select Format %ata 2abels from the conte3t menu to open the 5ata #abels dialog $2igure @E&. <& 1a-e sure 5ata #abels page is selected in the dialog and deselect all the options for the data labels that you want to remo(e. A& Clic- =6 to close the dialog and remo(e the data labels. @& )lternati(ely' right+clic- on the data series and select %elete %ata 2abels from the conte3t menu. E& Hepeat the abo(e steps to remo(e more data labels because you can only remo(e one data series at a time. *& Clic- outside the chart to lea(e edit mode. The options a(ailable for data labels in the 5ata #abels dialog are as follows.

+how value as number X displays the numeric (alues of the data points. 0hen selected'
this option acti(ates the ?umber format button.

?umber format X opens the umber 2ormat dialog' where you can select the number
format. This dialog is (ery similar to the one for formatting numbers in cells' see $hapter 9 )ntering= )diting= and 'ormatting Data for more information.

+how value as percentage X displays the percentage (alue of the data points in each
column. 0hen selected' this option acti(ates the Percentage format button.

Percentage format X opens the umber 2ormat dialog' where you can select the
percentage format. This dialog is (ery similar to the one for formatting numbers in cells' see $hapter 9 )ntering= )diting= and 'ormatting Data for more information.

+how category X shows the data point te3t labels. +how legend key X displays the legend icons ne3t to each data point label. +eparator X selects the separator between multiple te3t strings for the same obGect $if at
least two options abo(e are selected&.

Placement X selects the placement of data labels relati(e to the obGects. 3otate ,e.t X clic- in the dial to set the te3t orientation for the data labels or enter the
rotation angle for the data labels.

,e.t %irection X specify the te3t direction for a paragraph that uses Comple3 Te3t #ayout
$CT#&. This feature is only a(ailable if CT# support is enabled.

$hapter 3 $reating $harts and Graphs

.#

/rend lines
0hen you ha(e a scattered grouping of points in a graph' you may want to show the relationship of the points by using a trend line. Calc has a good selection of regression types you can use for trend lines% linear' logarithm' e3ponential' and power. Choose the type that comes closest to passing through all of the points. Trend lines can be added to all 25 chart types e3cept for pie and stoc- charts. Cf a data series is selected' a trend line is inserted for that data series only. Cf no data series are selected' trend lines are inserted for all data series. 0hen inserted' trend lines are automatically shown in the chart legend.

'igure &-: (rend Lines dialog To insert trend lines to your chart% 1& ,elect the chart by double+clic-ing on it to enter edit mode. The chart should now be surrounded by a gray border. 2& ,elect the data series on your chart that you want to use to insert trend lines. Cf you do not select a data series' then trend lines for all data series on your chart will be inserted. 3& To insert trend lines for all data series' go to nsert < ,rend 2ines on the main menu bar to open the Trend #ines dialog $2igure @*&. <& To insert a trend line for a single data series' select a data series then go to nsert < ,rend 2ines on the main menu bar' or right+clic- on the data series and select nsert ,rend 2ine from the conte3t menu to open the Trend #ines dialog for the selected data series.
The dialog to insert a trend line for a single data series is similar to the dialog for all data series $2igure @*&' but has a second page called 2ine where you can select the formatting for the trend line $style' color' width' and transparency&.

?ote

A& ,elect the type of trend line that you want to insert X Linear' Logarithmic' )*ponential' or Power. @& To show the e?uation or coefficient of determination used to calculate the trend lines' select the options Show eKuation and/or Show coefficient of determination 6397. E& Clic- =6 to close the dialog and the trend lines are placed onto your chart. *& Clic- outside the chart to lea(e edit mode.
.9 LibreOffice ".# $alc Guide

?ote

0hen inserted' a trend line has the same color as the corresponding data series. To change the trend line properties' right+clic- on the trend line and select Format ,rend 2ine on the conte3t menu to open the 2ine page of the Trend #ines dialog.

To show the e?uation or the coefficient of determination and the e?uation after a trend line has been inserted' right+clic- on the trend line and select nsert ,rend 2ine #@uation or nsert 3" and ,rend 2ine #@uation from the conte3t menu. 2or more information on the e?uations' see the topic (rend Lines in the #ibre;ffice Calc /elp. 0hen you select a trend line' the information for the trend line is shown in the ,tatus 4ar' which is normally located at the bottom of the spreadsheet. To delete trend lines from your chart% 1& ,elect the chart by double+clic-ing on it to enter edit mode. The chart should now be surrounded by a gray border. 2& To delete all trend lines' go to nsert < ,rend 2ines on the main menu bar to open the Trend #ines dialog and select ?one then clic- =6. 3& To delete a single trend line' right+clic- on the data series and select %elete ,rend line from the conte3t menu.

Mean value lines


1ean (alue lines are special trend lines that show the mean (alue and can only be used in 25 charts. Cf a data series is selected' a mean (alue line is inserted for that data series only. Cf no data series are selected' mean (alue lines are inserted for all data series. 0hen you insert mean (alue lines into your chart' Calc calculates the a(erage of each selected data series and places a colored line at the correct le(el in the chart. The colored line uses the same color as that used for the data series. To insert mean (alue lines on your chart% 1& ,elect the chart by double+clic-ing on it to enter edit mode. The chart should now be surrounded by a gray border. 2& ,elect the data series on your chart that you want to use to insert mean (alue lines. Cf you do not select a data series' then mean (alue lines for all data series on your chart will be inserted. 3& To insert mean (alue lines for all data series' go to nsert < 4ean >alue 2ines on the main menu bar. <& To insert a mean (alue line for a single data series' select a data series then go to nsert < 4ean >alue 2ines on the main menu bar' or right+clic- on the data series and select nsert 4ean >alue 2ine from the conte3t menu. A& Clic- outside the chart to lea(e edit mode. To delete mean (alue lines from your chart% 1& ,elect the chart by double+clic-ing on it to enter edit mode. The chart should now be surrounded by a gray border. 2& ,elect the mean (alue line you want to delete and press the Delete -ey' or right+clic- on the data series and select %elete 4ean >alue 2ine from the conte3t menu. 3& Clic- outside the chart to lea(e edit mode.

5 or 6 error bars
!se the Q and Y error bars to display error bars for 25 charts only. Cf a data series is selected' an Q or Y error bar is inserted for that data series only. Cf no data series are selected' Q or Y error bars are inserted for all data series.
$hapter 3 $reating $harts and Graphs .3

Cf you are presenting data that has a -nown possibility of error' such as social sur(eys using a particular sampling method' or you want to show the measuring accuracy of the tool you used' you may want to show error bars on the chart. To insert error bars to your chart% 1& ,elect the chart by double+clic-ing on it to enter edit mode. The chart should now be surrounded by a gray border.

'igure &.: )rror Bars dialog 2& ,elect the data series on your chart that you want to use to insert error bars. Cf you do not select a data series' then error bars for all data series on your chart will be inserted. 3& To insert error bars for all data series' go to nsert < O #rror 7ars or nsert < I #rror 7ars on the main menu bar to open the Drror 4ars dialog $2igure @:&. <& To insert error bars for a single data series' select a data series then go to nsert < O #rror 7ars or nsert < I #rror 7ars on the main menu bar' or right+clic- on the data series and select nsert O #rror 7ars or nsert I #rror 7ars from the conte3t menu to open the Drror 4ars dialog. A& ,elect the re?uired options in )rror $ategor2' )rror 0ndicator or Parameters to use for the error bars. 1ore information on the options for error bars is gi(en below. @& Clic- =6 to close the dialog and insert the error bars onto your chart. E& Clic- outside the chart to lea(e edit mode. To delete error bars from your chart% 1& ,elect the chart by double+clic-ing on it to enter edit mode. The chart should now be surrounded by a gray border. 2& To delete error bars for all data series' go to nsert < O #rror 7ars or nsert < I #rror 7ars on the main menu bar to open the Drror 4ars dialog $2igure @:& and select ?one in )rror $ategor2. 3& Clic- =6 to close the dialog and delete the error bars from your chart. <& To delete error bars from a single data series' right+clic- on the data series and select %elete O #rror 7ars or %elete I #rror 7ars from the conte3t menu. A& Clic- outside the chart to lea(e edit mode. ,e(eral options are pro(ided on the Q or Y Drror 4ars dialog. You can select only one error category at a time. You can also select whether the error indicator shows both positi(e and negati(e errors' or only positi(e or only negati(e.

."

LibreOffice ".# $alc Guide

Constant value X you can ha(e separate positi(e and negati(e (alues. Percentage X choose the error as a percentage of the data points. The drop+down list has four options as follows% Standard error Hariance X shows error calculated on (ariance Standard deviation X shows error calculated on standard de(iation )rror margin X you designate the error Cell 3ange X calculates the error based on cell ranges you select. The "arameters section
at the bottom of the dialog changes to allow selection of the cell ranges.

Formatting charts and graphs


Calc pro(ides many options for formatting and fine+tuning the appearance of your charts. To enter formatting mode for your chart%

+electing chart elements


5epending on the purpose of your document' for e3ample a screen presentation or a printed document for a blac- and white publication' you might wish to ha(e more detailed control o(er the different chart elements to gi(e you what you need. To select a chart element% 1& ,elect the chart by double+clic-ing on it to enter edit mode. The chart should now be surrounded by a gray border. 2& ,elect the chart element that you want to format and the chart element will be highlighted with selection s?uares or a border of s?uare selection handles. Dach chart element has its own formatting options and these are e3plained below. 3& Go to Format on the main menu bar and select the rele(ant option' or right+clic- to display a conte3t menu rele(ant to the selected element to open the rele(ant formatting dialog.
Cf your chart has many elements' it is recommended to turn on tooltips in ,ools < =ptions < 2ibre=ffice < (eneral. 0hen you ho(er a cursor o(er an element' Calc will display the element name which will ma-ing it easier in selecting the correct element. The name of the selected element also appears in the ,tatus 4ar.

?ote

Formatting options
Format +election X opens a dialog where you can specify the area fill' borders'
transparency' characters' fonts' and other attributes of the selected element on the chart.

Position and +i5e X opens the "osition and ,iFe dialog $see K"osition and ,iFe dialogL on
page 10@&.

Arrangement X pro(ides two options% 7ring Forward and +end 7ackward' of which only
one may be acti(e for some items. !se these options to arrange o(erlapping data series.

,itle X formats the titles for the chart and chart a3es. 2egend X formats how the legend appears and positioned on the chart A.is X formats the lines that create the chart as well as the font of the te3t that appears on
both the Q and Y a3es.
$hapter 3 $reating $harts and Graphs .%

(rid X formats the lines that create a grid for the chart. Chart 8all' Chart Floor' or Chart Area X formats how the chart wall' chart floor and chart
area appear on your chart. ote that the chart floor is a(ailable for 35 charts.

Chart ,ype X changes what type of chart is displayed and whether it is 25 or 35 chart.
ote that only column' bar' pie and area charts can be displayed as a 35 chart.

%ata 3anges X e3plained in K5ata range and a3es labelsL on page *< and KDditing data
ranges or data seriesL on page **.

'% >iew X formats 35 charts and is only a(ailable for 35 charts $see page :E&.

4oving chart elements


You may wish to mo(e or resiFe indi(idual elements of a chart' independent of other chart elements. 2or e3ample' you may wish to reposition the legend from its default position on the right of the chart to below the chart. "ie charts also allow mo(ing of indi(idual wedges of the pie as well as e3ploding the entire pie. /owe(er' you cannot mo(e an indi(idual point or data series. 1& ,elect the chart by double+clic-ing on it to enter edit mode. The chart should now be surrounded by a gray border. 2& 1o(e the cursor o(er the chart element you want to mo(e' then clic- and drag to mo(e the element. Cf the element is already selected' then the cursor changes to the mo(e icon $normally a small hand&' then clic- and drag to mo(e the element. 3& Helease the mouse button when the element is in the desired position.
Cf your chart is a 35 chart' then round selection handles appear when a 35 chart element is selected. These round selection handles control the 35 angle of the element. You cannot resiFe or reposition the element while the round selection handles are showing. !se Shift5$lic4 to get the s?uare selection handles and you can now resiFe and reposition your 35 chart graphic.

?ote

Changing chart area background


The chart area is the area surrounding the chart graphic' including the main title' subtitle and legend. 1& ,elect the chart by double+clic-ing on it to enter edit mode. The chart should now be surrounded by a gray border. 2& Go to Format < Chart Area on the main menu bar or right+clic- in the chart area and select Format Chart Area from the conte3t menu to open the Chart )rea dialog $2igure E0&. 3& ,elect the desired formatting from the 7orders' Area and ,ransparency pages. <& Clic- =6 to close the dialog and sa(e your changes.

Changing chart graphic background


The Chart 0all is the area that contains the chart graphic. 1& ,elect the chart by double+clic-ing on it to enter edit mode. The chart should now be surrounded by a gray border. 2& Go to Format < Chart 8all on the main menu bar or right+clic- in the chart area and select Format Chart Area from the conte3t menu to open the Chart 0all dialog. This dialog is similar to the Chart )rea dialog in 2igure E0. 3& ,elect the desired formatting from the 7orders' Area and ,ransparency pages. <& Clic- =6 to close the dialog and sa(e your changes.

.&

LibreOffice ".# $alc Guide

'igure A8: $hart ,rea dialog

Changing colors
Cf you want to modify the color scheme from the default' or you want to add e3tra chart colors for charts in all your documents' go to ,ools < =ptions < Charts < %efault Colors top ma-e the changes. Changes made in this dialog affect the default chart colors for any chart you ma-e in the future. ,ee the Getting Started Guide for more information on changing colors.

'% charts
The 35 Biew dialog $2igure E1& has three pages%

Perspective X where you can change the perspecti(e of the chart. Appearance X ,elect whether to use a simple or realistic scheme for your 35 chart. llumination X controls the light source that illuminates your 35 chart and where the
shadows will fall.

'igure A#: 3D Hiew dialog E Perspective page


$hapter 3 $reating $harts and Graphs .A

&otation and perspective


To rotate a 35 chart or change its perspecti(e (iew% 1& ,elect the chart by double+clic-ing on it to enter edit mode. The chart should now be surrounded by a gray border. 2& Go to Format < '% >iew on the main menu bar or right+clic- in the chart area and select '% >iew from the conte3t menu to open the 35 Biew dialog $2igure E1&. 3& Clic- on the Perspective tab to open the page. <& Dnter the re?uired settings for 3ight angled a*es and Perspective. A& Clic- =6 to close the dialog and sa(e your changes. ,ome hints for using the Perspective page%

,et all angles to 0 for a front (iew of the chart. "ie charts and donut charts are shown as
circles.

0ith 3ight!angled a*es enabled' you can rotate the chart contents only in the Q and Y
directionN that is' parallel to the chart borders.

)n Q (alue of :0' with Y and T set to 0' pro(ides a (iew from the top of the chart. 0ith Q set
to X:0' the (iew is from the bottom of the chart.

Hotation is applied in the following order% Q+a3is first' then Y+a3is' and T+a3is last. 0hen shading is enabled and you rotate a chart' the lights are rotated as if they are fi3ed to
the chart.

The rotation a3es always relate to the page' not to the a3es of the chart. This is different
from some other chart programs.

,elect the Perspective option to (iew the chart in central perspecti(e as through a camera
lens instead of using a parallel proGection. ,et the focus length with the spin button or type a number in the bo3. 100d gi(es a perspecti(e (iew where a far edge in the chart loo-s appro3imately half as big as a near edge.

&otatin% 7* c"arts interactivel$


Cn addition to using the "erspecti(e page of the 35 Biew dialog to rotate 35 charts' you can also rotate 35 charts interacti(ely. 1& ,elect the chart by double+clic-ing on it to enter edit mode. The chart should now be surrounded by a gray border. 2& ,elect the Chart 0all and round selection handles appear. 3& /o(er the mouse cursor o(er a corner handle and the cursor changes to a rotation icon. <& "ress and hold the left mouse button and drag the direction you want. ) dashed outline of the chart is (isible while you drag to help you see how the result will loo-. A& Helease the mouse button when satisfied.

)ppearance
!se the )ppearance page to modify some aspects of the appearance of a 35 chart. 1& ,elect the chart by double+clic-ing on it to enter edit mode. The chart should now be surrounded by a gray border. 2& Go to Format < '% >iew on the main menu bar or right+clic- in the chart area and select '% >iew from the conte3t menu to open the 35 Biew dialog $2igure E2&. 3& Clic- on the Appearance tab to open the page. <& ,elect a scheme from the Scheme drop down list bo3 X 3ealistic $default& or Simple. 0hen you select a scheme' the options and the light sources are set accordingly.

.-

LibreOffice ".# $alc Guide

'igure A9: 3D Hiew dialog E ,ppearance page A& Cf necessary' select or deselect a combination of Shading' ObIect borders' or 3ounded edges that is not gi(en by the 3ealistic or Simple schemes to create a $ustom scheme. @& Clic- =6 to close the dialog and sa(e your changes. ,ome hints for the Appearance page. 5epending on the scheme selected' not all options are a(ailable.

,elect Shading to use the Gouraud method for rendering the surface. ;therwise' a flat
method is used. The flat method sets a single color and brightness for each polygon. The edges are (isible' soft gradients and spot lights are not possible. The Gouraud method applies gradients for a smoother' more realistic loo-. ,ee the Draw Guide for more information on the use of shading.

,elect ObIect borders to draw lines along the edges. ,elect 3ounded edges to smooth the edges of bo3 shapes. llu(ination
!se the llumination page $2igure E3& to set the light sources for the 35 (iew. ,ee the Draw Guide for more information on setting the illumination.

'igure A3: 3D Hiew dialog E 0llumination page 1& ,elect the chart by double+clic-ing on it to enter edit mode. The chart should now be surrounded by a gray border. 2& Go to Format < '% >iew on the main menu bar or right+clic- in the chart area and select '% >iew from the conte3t menu to open the 35 Biew dialog $2igure E3&. 3& Clic- on the llumination tab to open the page.
$hapter 3 $reating $harts and Graphs ..

<& Clic- any of the eight buttons to switch a directed light source on or off. 4y default' the second light source is switched on. Ct is the first of se(en normal' uniform light sources. The first light source proGects a specular light with highlights. A& 2or the selected light source' select a color from the drop down list Gust below the eight light source buttons. ote that the brightness (alues of all lights are added together' so use darcolors when you enable multiple lights. @& Dach light source always points at the middle of the obGect initially. Cf necessary' change the position of the light source by mo(ing the (ertical and/or horiFontal sliders to set position of the selected light source. E& Chec- the small pre(iew on the dialog to see the effect of repositioning the light source. *& Clic- the button in the bottom right corner of the pre(iew to switch the internal illumination model between a sphere and a cube. :& ,elect the ambient light using the ,mbient light drop down list to define the ambient light which shines with a uniform intensity from all directions. 10& Clic- =6 to close the dialog and sa(e your changes.

(rids
You can di(ide the a3es into sections by assigning gridlines to them. This allows you to get a better o(er(iew of the chart' especially if you are wor-ing with large charts. The Y a3is maGor grid is acti(ated by default. !se the Grid dialog to set the formatting options for the lines used as grids in your chart by selecting line style' color' width and transparency. The dialog is similar to the #ine page in the Chart )rea dialog shown in 2igure E0 on page :E.

A.es
,ometimes you need to ha(e a special scale for one of the a3es of your chart' or you need smaller grid inter(als' or you want to change the formatting of the labels on the a3is. )fter highlighting the a3is you wish to change' right+clic- and choose one of the items from the conte3t menu. 1& ,elect the chart by double+clic-ing on it to enter edit mode. The chart should now be surrounded by a gray border. 2& Go to Format < I A.is or O A.is on the main menu bar and select the a3is you want to format' or right+clic- in on the chart the a3is you want to format and select Format A.is from the conte3t menu to open the )3is dialog $2igure E<&. The options a(ailable in the dialog depend on which a3is was selected' type of a3is used' type of chart and whether the chart is 25 or 35.

'igure A": F ,*is dialog E Scale page

#88

LibreOffice ".# $alc Guide

3& Clic- on the tab of the page where you to ma-e changes using the a(ailable options. The options for each page are e3plained below. <& Clic- =6 to close the dialog and sa(e your changes.

!cale
You can enter (alues for subdi(iding a3es on the ,cale page $2igure E<&.

3everse direction X defines where the lower and the higher (alues are displayed at the
a3is. 5eselect this option to use a mathematical direction. That means for Cartesian coordinate systems that the Q+a3is shows the lower (alues on the left and the Y+a3is shows the lower (alues at the bottom. 2or polar coordinate systems' the mathematical angle a3is direction is countercloc-wise and the radial a3is is from inner to outer.

2ogarithmic scale X specifies that you want the a3is to be subdi(ided logarithmically. !se
this option if you are wor-ing with (alues that differ sharply from each other. You can use logarithmic scaling to ma-e the grid lines of the a3is e?uidistant but ha(e (alues that may increase or decrease.

4inimum X defines the minimum (alue for the beginning of the a3is. Automatic must be
deselected to set this option manually.

4a.imum X defines the ma3imum (alue for the end of the a3is. Automatic must be
deselected to set this option manually.

4aCor interval X defines the inter(al for the main di(ision of the a3es. The main inter(al
cannot be larger than the (alue area. Automatic must be deselected to set this option manually.

4inor interval count X defines the inter(al for the subdi(ision of the a3es. Automatic must
be deselected to set this option manually.

Automatic X you must first deselect this option to modify the (alues. 5isable this option if
you are wor-ing with fi3ed (alues' as it does not permit automatic scaling.

,ype X for some types of a3es' you can select to format an a3is as te3t or date' or to detect
the type automatically. 2or a data a3is type' you can set the following options.

1inimum and ma3imum (alue to be shown on the ends of the scale. Hesolution can be set to show days' months' or years as inter(al steps. 1aGor inter(al can be set to show a certain number of days' months' or years. 1inor inter(al can be set to show a certain number of days' months' or years.

'igure A%: F ,*is dialog E Positioning page

$hapter 3 $reating $harts and Graphs

#8#

1ositionin%
The "ositioning page $2igure EA& controls the positioning of the a3is.

A.is line X select where $ross other a*is at from the drop down list X Start' )nd' or at a
specified Halue.

2abels X select where Place labels% is set from the drop down list X @ear a*is' @ear a*is
6other side7' Outside start' or Outside end.

nterval marks

:aIor X specifies whether the mar-s are to be on the inner or outer side of the a3is. Ct is possible to combine both% you will then see mar-s on both sides. 0nner X specifies that mar-s are placed on the inner side of the a3is. Outer X specifies that mar-s are placed on the outer side of the a3is. :inor X defines the mar-ing dashes between the a3is mar-s. Ct is possible to acti(ate both fields. This will result in a mar-ing line running from the outside to the inside. 0nner X specifies that minor inter(al mar-s are placed on the inner side of the a3is. Outer X specifies that minor inter(al mar-s are placed on the outer side of the a3is. Place mar4s X select where to place the mar-s from the drop down list X ,t labels' ,t a*is' or ,t a*is and labels.

Line

!se the #ine page to set the formatting options for the a3is line by selecting line style' color' width' and transparency. The dialog is similar to the Chart )rea dialog shown in 2igure E0 on page :E.

'igure A&: F ,*is dialog E Label page

Label
;n the Label page $2igure E@&' you can decide whether to show or hide the labels' how to handle them when they will not all fit neatly into one row $for e3ample' if the words are too long&' and whether to ha(e them at an angle to the a3is.

#89

LibreOffice ".# $alc Guide

+how labels X specifies whether to show or hide the a3is labels. =rder X the options on this page are only a(ailable for a 25 chart. Cn this area' you can
define the alignment of the number labels on the Q or Y a3is.

?ote

(ile X arranges numbers on the a3is side by side. Stagger odd X staggers numbers on the a3is' e(en numbers lower than odd numbers. Stagger even X stagger numbers on the a3es' odd numbers lower than e(en numbers. ,utomatic X automatically arranges numbers on the a3is.
"roblems may arise in displaying labels if the siFe of your chart is too small. You can a(oid this by either enlarging the (iew or decreasing the font siFe.

,e.t flow X determines the te3t flow of the a3is label. Overlap X specifies that te3t in a3is labels may o(erlap other a3is labels. This can be
especially useful if there is a lac- of space.

Brea4 X allows a te3t brea-.

,e.t direction X defines the te3t direction of labels. ,B$D wheel X clic- and drag the indicator on the wheel defines the (ariable te3t
orientation. The characters U)4C5U on the wheel correspond to the new setting.

Herticall2 stac4ed X assigns (ertical te3t orientation for labels. Cf you define a (ertical Q+a3is label' the te3t may be cut off by the line of the 3+a3is. Degrees X manually enter the orientation angle for the labels. (e*t direction X specify the te3t direction for any te3t that uses comple3 te3t layout $CT#& and is only a(ailable if )nhanced language support is enabled Cn ,ools < =ptions < 2anguage +ettings.

.u(bers
!se the umbers page to set the attributes for any numbers used on the a3is. This page is (ery similar to the one for formatting numbers in cellsN see $hapter 9 )ntering= )diting= and 'ormatting Data for more information.

Font and Font Effects


!se the 2ont and 2ont Dffects pages to set the attributes for fonts and the type of font effects used for a3is labels. These pages are (ery similar to the ones for fonts and font effects in cellsN see $hapter 9 )ntering= )diting= and 'ormatting Data for more information.

)sian /$po%rap"$
,ets the )sian typographic options for a3is labels and is only a(ailable if )nhanced language support is enabled Cn ,ools < =ptions < 2anguage +ettings.

Apply list of forbidden characters to the beginning and end of line X pre(ents the
characters in the list from starting or ending a line. The characters are relocated to either the pre(ious or the ne3t line. To edit the list of restricted characters' go to ,ools < =ptions < 2anguage +ettings < Asian 2ayout.

Allow hanging punctuation X pre(ents commas and periods from brea-ing the line.
Cnstead' these characters are added to the end of the line' e(en in the page margin.

Apply spacing between Asian$ 2atin and Comple. te.t X inserts a space between
)sian' #atin and comple3 characters.

$hapter 3 $reating $harts and Graphs

#83

;ierarchical a.is labels


1ultiple columns of categories can be displayed in a hierarchical manner at the a3is on your chart. /ierarchical a3es labels are created automatically if the first columns $or rows& contain data that is te3t. )n e3ample of hierarchical labels is shown in 2igure EE where the first column indicates the ?uarters and the second column shows the months.

'igure AA: )*ample of hierarchical a*es labels

'igure A-: Data Series dialog E Line page

#8"

LibreOffice ".# $alc Guide

+electing and formatting symbols


Cn line and scatter charts the symbols representing the points can be changed to a different symbol or color through the obGect properties dialog. 1& ,elect the chart by double+clic-ing on it to enter edit mode. The chart should now be surrounded by a gray border. 2& ,elect the data series you want to change. 3& Go to Format < Format +election on the main menu bar or right+clic- and select Format %ata +eries from the conte3t menu to open the 5ata ,eries dialog $2igure E*&. <& ;pen the 2ine page of the 5ata ,eries dialog by clic-ing on its tab. A& Cn the con section' open the drop+down list and select an option for your symbol from @o s2mbol' ,utomatic' 'rom file' Galler2 or S2mbols. ) pre(iew of your selection is shown in the pre(iew bo3 at the bottom of the dialog.

'rom file opens a file browser so you can select a file to use for your symbol. Galler2 opens a list showing the a(ailable graphics you can select for your symbol. S2mbols opens a list showing the a(ailable symbols you can select.

@& Dnter the <idth and the +eight you want to use for your new symbol. E& ,elect Deep ratio if you want the width and height of your symbol to maintain its ratio.

Adding drawing obCects to charts


)s in the other #ibre;ffice components' you can use the 5rawing toolbar to add shapes such as lines' rectangles' circles' te3t obGects' or more comple3 shapes such as symbols or bloc- arrows. !se these additional shapes to add e3planatory notes and highlight points on your chart' for e3ample. 2or more information on using the 5rawing toolbar and drawing shapes' see the Draw Guide.

3esi5ing and moving the chart


You can resiFe or mo(e all elements of a chart at the same time' in two ways% interacti(ely' or by using the "osition and ,iFe dialog. You can use a combination of both methods% interacti(e for a ?uic- and easy change' then the "osition and ,iFe dialog for precise siFing and positioning.

nteractively
To resiFe a chart interacti(ely% 1& Clic- once on the chart to select it and s?uare selection handles appear around the border of the chart. 2& To increase or decrease the siFe of the chart' clic- and drag one of the mar-ers. The cursor indicates the direction in which you can increase or decrease the chart siFe. To mo(e a chart interacti(ely% 1& Clic- once on the chart to select it and s?uare selection handles appear around the border of the chart. 2& /o(er the cursor anywhere o(er the chart until it changes to a mo(e cursor $shape depends on computer setup&. 3& Clic- and drag the chart to its new location. <& Helease the mouse button when the chart is in the re?uired position.

$hapter 3 $reating $harts and Graphs

#8%

Position and +i5e dialog


To resiFe or mo(e a chart using the "osition and ,iFe dialog% 1& Clic- once on the chart to select it and s?uare selection handles appear around the border of the chart. 2& Hight+clic- and select Position and +i5e from the conte3t menu to open the "osition and ,iFe dialog $2igure E:&. 3& ,elect the options you want to use ion the "osition and ,iFe' Hotation and ,lant S corner Hadius pages on this dialog. <& Clic- =6 to close the dialog and sa(e your changes. "osition and siFe of a chart are coordinated relati(e to a fi3ed point $the base point& and' by default' this base point is located at the upper left of a chart. You can temporarily change this base point to ma-e positioning or siFing of a chart simpler. Clic- one of the points in Base point corresponding to the location you want to use for either Position or Si1e. 0hen you clic- =6 and close this dialog' Calc resets the base point to the default position.

'igure A.: Position and Si1e dialog

1osition and !i-e


The options a(ailable on the Position and +i5e page $2igure E:& are as follows%

Position X specify the location of the selected obGect on the page. Position ; X enter the horiFontal distance that you want to mo(e the obGect relati(e to
the base point selected in the grid.

Position F X enter the (ertical distance that you want to mo(e the obGect relati(e to the base point selected in the grid. Base point X select a base point in the grid' and then enter the amount that you want to shift the obGect relati(e to the base point that you selected in the Position F and Position ; bo3es. The base points correspond to the selection handles on an obGect.

+i5e X specify the amount by which you want to resiFe the selected obGect with respect to
the selected base point.

<idth X enter a width for the selected obGect.

#8&

LibreOffice ".# $alc Guide

+eight X enter a height for the selected obGect. Deep ratio X maintains proportions between width and height when you resiFe the selected obGect. Base point X select a base point in the grid and then enter the new siFe dimensions for the selected obGect in the <idth and +eight bo3es.

Protect X pre(ents changes to the position or the siFe of the selected obGect. Position X pre(ents you from mo(ing the obGect. Si1e X pre(ents you from resiFing the obGect. Adapt X specifies if the siFe should be adGusted to fit the siFe of entered te3t. 'it width to te*t X e3pands the width of the obGect to the width of the te3t' if the obGect is
smaller than the te3t.

&otation

'it height to te*t X e3pands the height of the obGect to the height of the te3t' if the obGect is smaller than the te3t.

The options for the 3otation page $2igure *0& are as follows%

Pivot point X the selected obGect is rotated around a pi(ot point that you specify. The
default pi(ot point is at the center of the obGect. Cf you set a pi(ot point too far outside of the obGect boundaries' the obGect could be rotated off of the page.

Position ; X enter the horiFontal distance from the left edge of the page to the pi(ot point. Position F X enter the (ertical distance from the top edge of the page to the pi(ot point. Default settings X select where you want to place the pi(ot point on the obGect. The default setting is the center of the obGect.

3otation angle X specify the number of degrees that you want to rotate the selected
obGect' or clic- in the rotation wheel.

,ngle X enter the number of degrees that you want to rotate the selected obGect. Default settings X clic- and drag the indicator to specify the rotation angle in degrees. The number of degrees rotated is shown in the ,ngle bo3.

'igure -8: Position and Si1e dialog E 3otation page


$hapter 3 $reating $harts and Graphs #8A

!lant 4 Corner &adius


The options for the +lant B Corner 3adius page $2igure *1& are as follows%

Corner 3adius X you can only round the corners of a rectangular obGect. 3adius X enter the radius of the circle that you want to use to round the corners. +lant X slants the selected obGect along an a3is that you specify. )ngle X enter the angle of the slant a3is.

'igure -#: Position and Si1e dialog E Slant > $orner 3adius page

#.porting charts
You can e3port a chart as a graphic that you can use in other documents. 1& Clic- once on the chart to select it. ,?uare selection handles appear around the border of the chart. 2& Hight+clic- on the selected chart and select #.port as graphic from the conte3t menu. 3& Cn the Graphics D3port dialog that opens' type a name for the graphic file' select the location where you want to sa(e the file' and select the graphic format you want to use. <& Clic- +ave and your chart will be e3ported as a graphic to the location you specified and the format you specified.

(allery of chart types


Ct is important to remember that while your data can be presented with a number of different charts' the message you want to con(ey to your audience should determine what type of chart you use. The following sections present e3amples of the chart types that Calc pro(ides' with some notes on the purpose of each chart type.

Column charts
Column charts are commonly used for data that shows trends o(er time. They are best for charts that ha(e a relati(ely small number of data points. Ct is the default chart type pro(ided by Calc' as it is one of the most useful charts and the easiest to understand. Cf you ha(e a large time series' a line chart would be better suited. ) column chart shows (ertical bars' with the height of each bar being proportional to its (alue. The Q+a3is shows categories and the Y+a3is shows the (alue for each category.

?ormal X this subtype shows all data (alues belonging to a category ne3t to each other.
The main focus is on the indi(idual absolute (alues' compared to e(ery other (alue.

+tacked X this subtype shows the data (alues of each category on top of each other. The
main focus is the o(erall category (alue and the indi(idual contribution of each (alue within its category.
#8LibreOffice ".# $alc Guide

Percent X this subtype shows the relati(e percentage of each data (alue with regard to the
total of its category. The main focus is the relati(e contribution of each (alue to the category total. You can enable a 35 (iew of the data (alues. ) realistic 35 chart tries to gi(e the best 35 loowhile a simple 35 chart tries to mimic the chart (iew of other products. 2or 35 charts' you can select the shape of each data (alue from 4o3' Cylinder' Cone' and "yramid.

7ar charts
) bar chart shows horiFontal bars. The length of each bar is proportional to its (alue. The Y+a3is shows categories and the Q+a3is shows the (alue for each category. The subtypes for bar charts are the same as for column charts' gi(en abo(e. 4ar charts are e3cellent for gi(ing an immediate (isual impact for data comparison in cases when time is not an important factor' for e3ample' when comparing the popularity of a few products in a mar-etplace. Cn the e3amples below%

The first chart is achie(ed by using the chart wiFard with nsert < (rids' deselecting y+a3is'
and using nsert > 4ean >alue 2ines.

The second chart is a 35 chart created with a simple border and the 35 chart area twisted
around.

The third chart is an attempt to get rid of the legend and put labels showing the names of
the companies on the a3is instead. 0e also changed the colors to a hatch pattern.

'igure -9: Bar chart e*amples

Pie charts
) pie chart shows (alues as circular sectors of the total circle. The length of the arc' or the area of each sector' is proportional to its (alue.

Pie X this subtype shows sectors as colored areas of the total pie' for one data column
only. Cn the created chart' you can clic- and drag any sector to separate that sector from the remaining pie or to Goin it bac-.

#.ploded pie X this subtype shows the sectors already separated from each other. You
can clic- and drag any sector to mo(e it along a radial from the pie center.

%onut X this subtype can show multiple data columns. Dach data column is shown as one
donut shape with a hole inside' where the ne3t data column can be shown. You can clicand drag an outer sector to mo(e it along a radial from the donut center.

$hapter 3 $reating $harts and Graphs

#8.

#.ploded donut X this subtype shows the outer sectors already separated from the
remaining donut. You can clic- and drag an outer sector to mo(e it along a radial from the donut>s center. "ie charts are e3cellent when you need to compare proportions. 2or e3ample' comparisons of departmental spending% what the department spent on different items or what different departments spent. They wor- best with smaller numbers of (alues' about half a doFenN more than this and the (isual impact begins to fade. )s the Chart 0iFard guesses the series that you wish to include in your pie chart' you might need to adGust this initially on the 5ata Hanges page of the 0iFard if you -now you want a pie chart' or by using the Format < %ata 3anges < %ata +eries dialog. You can do some interesting things with a pie chart' especially if you ma-e it into a 35 chart. Ct can then be tilted' gi(en shadows' and generally turned into a wor- of art. .ust do not clutter it so much that your message is lost' and be careful that tilting does not distort the relati(e siFe of the segments. You can choose in the Chart 0iFard to e3plode the pie chart' but this is an all or nothing option. Cf your aim is to accentuate one piece of the pie' you can separate out one piece by carefully highlighting it after you ha(e finished with the Chart 0iFard' and dragging it out of the group. 0hen you do this you might need to enlarge the chart area again to regain the original siFe of the pieces.

'igure -3: Pie chart e*amples The effects achie(ed in 2igure *3 are e3plained below.

25 pie chart with one part of the pie e3ploded% ,elect nsert < 2egend and deselect the
Displa2 legend bo3. ,elect nsert > %ata 2abels and select Show value as number. Then carefully select the piece you wish to highlight' mo(e the cursor to the edge of the piece and clic- $the piece will ha(e highlight s?uares to mar- it&' and then drag it out from the rest of the pieces. The pieces will decrease in siFe' so you need to highlight the chart wall and drag it at a corner to increase the siFe.

35 pie chart with realistic schema and illumination% ,elect Format < '% view <
llumination where you can change the direction of the light' the color of the ambient light' and the depth of the shade. )lso adGusted is the 35 angle of the disc in the Perspective dialog on the same set of tabs. The chart updates as you ma-e changes' so you can immediately see the effects. Cf you want to separate out one of the pieces' clic- on it carefullyN you should see a wire frame highlight. 5rag it out with the mouse and then' if necessary' increase the siFe of the chart wall.

35 pie chart with different fill effects in each portion of the pie% ,elect nsert < %ata labels
and select Show value as percentage. Then carefully select each of the pieces so that it has a wire frame highlight and right+clic- to get the obGect properties dialogN choose the ,rea tab. 2or one we selected a bitmap' for another a gradient and for the third we used the (ransparenc2 tab and adGusted the transparency to A0d.
##8 LibreOffice ".# $alc Guide

5onut charts shown in 2igure *< are subtypes of the pie chart. To create one' select "ie in
the Chart 0iFard dialog' and select the third or fourth type of pie chart. 2or more (ariety' use a 35 #oo-.

'igure -": Donut chart e*amples

Area charts
)n area chart shows (alues as points on the Y+a3is and the Q+a3is shows categories. The Y (alues of each data series are connected by a line and the area between lines is filled with a color. The focus of an area chart is to emphasiFe the changes from one category to the ne3t.

?ormal X this subtype plots all (alues as absolute Y (alues. Ct first plots the area of the last
column in the data range' then the ne3t to last' and so on' and finally the first column of data is drawn. Thus' if the (alues in the first column are higher than other (alues' the last drawn area will hide the other areas.

+tacked X this subtypes plots (alues cumulati(ely stac-ed on each other. Ct ensures that all
(alues are (isible' and no data set is hidden by others. /owe(er' the Y (alues no longer represent absolute (alues' e3cept for the last column which is drawn at the bottom of the stac-ed areas.

Percent X this subtype plots (alues cumulati(ely stac-ed on each other and scaled as
percentage of the category total. )n area chart is a (ersion of a line or column graph. Ct may be useful where you wish to emphasiFe (olume of change. )rea charts ha(e a greater (isual impact than a line chart' but the data you use will ma-e a difference.

'igure -%: ,rea chart e*amples E the good= the bad= and the ugl2

$hapter 3 $reating $harts and Graphs

###

)s shown in 2igure *A' an area chart is sometimes tric-y to use. This may be one good reason to use transparency (alues in an area chart. )fter setting up the basic chart using the Chart 0iFard' do this% 1& Hight+clic- on the Y a3is and select %elete 4aCor (rid from the conte3t menu. )s the data o(erlaps' some of it is missing behind the first data series' as shown in the e3ample on the left. This is not what you want. ) better solution is shown in the center e3ample. 2& )fter deselecting the Y a3is grid' right+clic- on each data series in turn and select Format %ata +eries. ;n the (ransparenc2 tab' set Transparency to A0d. The transparency ma-es it easy to see the data hidden behind the first data series. ow' right+clic- on the Q a3is and select Format A.is. ;n the #abel tab' select ,ile in the Order section and set the Te3t orientation to AA degrees. This places the long labels at an angle. 3& To create the e3ample on the right' after doing the steps abo(e' right+clic- and select Chart ,ype. ,elect the '% 2ook option and select 3ealistic from the drop+down list. 0e also twisted the chart area around and ga(e the chart wall a picture of the s-y. )s you can see' the legend turns into labels on the F+a3is. ;(erall' although it is (isually more appealing' it is more difficult to see the point you are trying to ma-e with the data. ;ther ways of (isualiFing the same data series are represented by the stac-ed area chart or the percentage stac-ed area chart $2igure *@&. Cn the first' each number of each series is added to the others so that it shows an o(erall (olume' but not a comparison of the data. The percentage stac-ed chart shows each (alue in the series as a part of the whole. 2or e3ample in .une all three (alues are added together and that number represents 100d. The indi(idual (alues are a percentage of that. 1any charts ha(e (arieties which ha(e this option.

'igure -&: )*amples of stac4ed and percentage stac4ed area charts

2ine charts
) line chart is a time series with a progression. Ct is ideal for raw data and useful for charts with plentiful data that show trends or changes o(er time where you want to emphasiFe continuity. ;n line charts' the Q+a3is is ideal to represent time series data. ) line chart shows (alues as points on the Y+a3is and the Q+a3is shows categories. The Y (alues of each data series can be connected by a line.

Points only X this subtype plots only points. Points and lines X this subtype plots points and connects points of the same data series
by a line.

2ines only X this subtype plots only lines. '% lines X this subtype connects points of the same data series by a 35 line.

##9

LibreOffice ".# $alc Guide

,elect +tack series to arrange the points for Y (alues cumulati(e abo(e each other. The Y (alues no longer represent absolute (alues' e3cept for the first column which is drawn at the bottom of the stac-ed points. Cf you select Percent' the Y (alues are scaled as percentage of the category total. ,elect +mooth lines to draw cur(es through the points instead of straight lines. Clic- Properties for a dialog to change the cur(e properties. Things to do with lines% thic-en them' ma-e them 35' smooth the contours' Gust use points. /owe(er' 35 lines can confuse the (iewer' so Gust using a thic-er line often wor-s better.

'igure -A: Line chart e*amples

+catter or OI charts
56 8!catter9
)n QY chart in its basic form is based on one data series consisting of a name' a list of Q+(alues' and a list of Y+(alues. Dach (alue pair $Q S Y& is shown as a point in a coordinate system. The name of the data series is associated with the Y+(alues and shown in the legend. 0hen creating an QY chart refer to the following e3ample tas-s. Your QY chart may ha(e more than one data series.

,cale the Q+a3is. Generate a parameter cur(e' for e3ample a spiral. 5raw the graph of a function. D3plore the statistical association of ?uantitati(e (ariables

56 c"art variants
You can select an QY chart (ariant on the first page of the Chart 0iFard' or by choosing Format < Chart ,ype for a chart in edit mode. The chart is created with default settings. )fter the chart is finished' you can edit its properties to change the appearance. #ine styles and icons can be changed on the 2ine page of the data series properties dialog. 5ouble+clic- any data point to open the 5ata ,eries dialog. Cn this dialog' you can change many properties of the data series. 2or 25 charts' you can select nsert < I #rror 7ars to enable the display of error bars. You can enable the display of mean (alue lines and trend lines using commands on the Cnsert menu.

$hapter 3 $reating $harts and Graphs

##3

Points only X each data point is shown by an icon. Calc uses default icons with different
forms and colors for each data series. The default colors are set in ,ools < =ptions < Charts < %efault Colors.

2ines =nly X this (ariant draws straight lines from one data point to the ne3t. The data
points are not shown by icons. The drawing order is the same as the order in the data series. 1ar- +ort by O >alues to draw the lines in the order of the Q (alues. This sorting applies only to the chart' not to the data in the table.

Points and 2ines X this (ariant shows points and lines at the same time. '% 2ines X the lines are shown li-e tapes. The data points are not shown by icons. Cn the
finished chart select 35 Biew to set properties li-e illumination and angle of (iew.

+mooth 2ines 1ar- +mooth 2ines to draw cur(es instead of straight line segments. Clic- Properties to set details for the cur(es. Cubic +pline interpolates your data points with polynomials of degree 3. The
transitions between the polynomial pieces are smooth' ha(ing the same slope and cur(ature.

The 3esolution determines how many line segments are calculated to draw a piece of polynomial between two data points. You can see the intermediate points if you clicany data point. 7/+pline uses a parametric' interpolating 4+spline cur(e. Those cur(es are built piecewise from polynomials. The %egree of polynomials sets the degree of these polynomials.

Exa(ple of 56 c"art
,catter charts are great for (isualiFing data that you ha(e not had time to analyFe and they may be the best for data when you ha(e a constant (alue against which to compare the dataN for e3ample' weather data' reactions under different acidity le(els' conditions at altitude' or any data which matches two series of numeric data. Cn contrast to line charts' the Q+a3is are the left to right labels' which usually indicate a time series.

'igure --: ;F 6Scatter7 chart e*ample

##"

LibreOffice ".# $alc Guide

,catter charts may surprise those unfamiliar with how they wor-. 0hile constructing the chart' if you choose %ata 3ange < %ata series in rows' the first row of data represents the Q+a3is. The rest of the rows of data are then compared against the first row data. 2igure ** shows a comparison of three currencies with the .apanese Yen. D(en though the table presents the monthly series' the chart does not. Cn fact the .apanese Yen does not appearN it is merely used as the constant series that all the other data series are compared against.

7ubble charts
) bubble chart is a specific (ariation of a scatter chart in which the data points are replaced with bubbles showing the relations of three (ariables. 4ubble charts are often used to present financial data or social/demographic data. Ct shows the relations of three (ariables in two dimensions. Two (ariables are used for the position on the Q+a3is and Y+a3is' while the third is shown as the relati(e siFe of each bubble. ;ne or more data series can be included in a single chart. The data series dialog for a bubble chart has an entry to define the data range for the bubbles and their siFes. Ct is sometimes easier to build a bubble chart manually in the data range entry section of the chart wiFard. Cn the e3ample chart shown in 2igure *:' the range including the dates and the three series was highlighted before starting the chart wiFard. Cf you do not include the top row with the dates' there is no way to include this data as a category later. The names of the series were added manually' as were the ranges for the second and third series. Dach data series was highlighted and the data points added and formatted to be in the center of the data point. Cn this case the number $which is the KdimensionL& was deselected and category $the year& selected. The data points are formatted using the transparency tab with a radial gradient.

'igure -.: Bubble chart e*ample


Cf the data series for Q+a3is contains te3t' an order number will be displayed in the labels of this a3is. ;therwise' the data of the series will be used for the Q+a3is' which can lead to irregularly arranged bubbles.

?ote

$hapter 3 $reating $harts and Graphs

##%

?et charts
) net chart is similar to a polar or radar chart and displays data (alues as points connected by some lines in a grid net that resembles a spider net or a radar tube display. 2or each row of chart data' a radial is shown on which the data is plotted. )ll data (alues are shown with the same scale' so all data (alues should ha(e about the same magnitude. ) net chart is useful for comparing data that are not time series' but show different circumstances' such as (ariables in a scientific e3periment or direction. The poles of the net chart are e?ui(alent to the Y+a3es of other charts. Generally' between three and eight a3es are bestN any more and this type of chart becomes confusing. 4efore and after (alues can be plotted on the same chart' or perhaps e3pected and real results' so that differences can be compared.

'igure .8: @et chart e*amples

'igure .#: )*ample of filled net or radar chart 2igure :0 shows e3ample of two types of net charts%

The left e3ample is a plain net chart without grids and with Gust points' no lines. The right e3ample is a net chart with lines' points and grid. )3es colors and labels changed.
Chart area color Y gradient. "oints changed to 35 ones. ;ther (arieties of net chart show the data series as stac-ed numbers or stac-ed percentages. The series can also be filled with a color as shown in 2igure :1. "artial transparency is often best for showing all the series.

##&

LibreOffice ".# $alc Guide

+tock charts
) stoc- chart illustrates the mar-et trend for stoc- and shares by gi(ing opening price' bottom price' top price and closing price. The transaction (olume can also be shown and the Q+a3is can represent a time series. 0hen you set up a stoc- chart in the Chart 0iFard' the 5ata ,eries dialog is (ery important. The data should be arranged as shown in the e3ample table below because you need to tell it which series is for the opening price' closing price' high and low price of the stoc-' and so on.
Transaction (olume 1onday Tuesday 0ednesday Thursday 2riday 2A00 3A00 1000 2200 <@00 ;pening price 20 32 1A <0 2E #ow $bottom price& 1A 22 1A 30 20 /igh $top price& 2A 3E 1E <E 32 Closing price 1E 30 1E 3A 31

The open' low' high' and closing (alues of a row build together one data unit in the chart. ) stocprice data series consists of se(eral rows containing such data units. The column containing the transaction (olume builds an optional second data series. 5epending on the chosen (ariant' you may not need all columns.

!toc0 c"art variants


,elect a stoc- chart type on the first page of the Chart wiFard and then select one of the four (ariants.

,ype 1 X based on low and high column' Type 1 shows the distance between bottom price
$low& and top price $high& by a (ertical line. 4ased on the low' high' and close columns' Type 1 shows an additional horiFontal mar- for the closing price.

,ype " X based on the open' low' high' and close columns' Type 2 generates the traditional
candle stic- chart. Type 2 draws the (ertical line between the bottom and top price and adds a rectangle in front' which (isualiFes the range between the opening and closing price. Cf you clic- on the rectangle' you see more information in the status bar. Calc uses different fill colors for rising (alues $the opening price is lower than the closing price& and falling (alues.

,ype ' X based on the (olume' low' high' and close columns' Type 3 draws a chart li-e
Type 1 with additional columns for the transaction (olume.

,ype & X based on all fi(e data columns $(olume' open' low' high' and close&' Type <
combines a chart of Type 2 with a column chart for the transaction (olume.
Cf measurement for transaction (olume is in units' a second Y a3is is introduced in chart Type 3 and Type <. The price a3is is shown on the right side and the (olume a3is on the left side.

?ote

!ettin% data source


You can select or alter a data range on the second page of the Chart wiFard or in the 5ata Hange dialog. 2or fine tuning use the 5ata ,eries dialog.

$hapter 3 $reating $harts and Graphs

##A

To specify a data range do one of the following%

Dnter the data range in the te3t bo3.


)n e3ample data range would be Ug,heet1.g4g3%g4g1<U. ote that a data range may consist of more than one region in a spreadsheet' for e3ample Ug,heet1.)1%)ANg,heet1.51%5AU is also a (alid data range. Cf the synta3 is not correct' Calc shows the te3t in red.

Clic- +elect data range to minimiFe the dialog' then drag to select the data range. 0hen
you release the mouse' the data are entered. Clic- +elect data range again to add a data range. Cn the input field of the minimiFed dialog' clic- after the entry and type a semicolon. Then drag to select the ne3t range.

Clic- one of the options for data series in rows or in columns.


Your stoc- chart data are in columns' if the information in a row belongs to the same candle stic-.

Or%ani-e data series


Cn the data series area on the left side of the dialog' you can organiFe the data series of the actual chart. ) stoc- chart has at least one data series containing the prices. Ct might ha(e a second data series for transaction (olume. Cf you ha(e more than one price data series' use the !p and 5own arrow buttons to order them. The order determines the arrangement in the chart. 5o the same for (olume data series. You cannot switch price and (olume data series. To remo(e a data series' select the data series in the list and clic- 3emove. To add a data series' select one of the e3isting data series and clic- Add. You get an empty entry below the selected one' which has the same type. Cf you ha(e no price data series or no (olume data series' you must first select a range for these series in the %ata 3ange dialog.

!ettin% data ran%es


Cn the %ata 3anges dialog you can set or change the data range of each component of the selected data series. The upper list shows the role name of the components and the current (alues. 0hen you ha(e selected a role' you can change the (alue in the te3t bo3 below the list. The label shows the selected role. Dnter the range into the te3t bo3 or clic- on +elect data range to minimiFe the dialog and select the range with the mouse. ,elect ;pen Balues' Close Balues' /igh Balues' and #ow Balues in any order. ,pecify only the ranges for those roles which you need for the chosen (ariant of the stoc- chart. The ranges need not be ne3t to each other in the table.

Le%end
The legend displays the labels from the first row or column or from the special range that you ha(e set in the 5ata ,eries dialog. Cf your chart does not contain labels' the legend displays te3t li-e UHow 1' How 2' ...U' or UColumn )' Column 4' ...U according to the row number or column letter of the chart data. The legend shows the (alue from the range' which you entered in the 3ange for ?ame field in the 5ata Hange dialog. The default entry is the column header of the closing price column. ,elect one of the position options. 0hen the chart is finished' you can specify other positions using the 2ormat menu.

##-

LibreOffice ".# $alc Guide

Column and line charts


) column and line chart is a combination of two other chart types. Ct is useful for combining two distinct but related data series' for e3ample sales o(er time $column& and the profit margin trends $line&.

Columns and 2ines X the rectangles of the column data series are drawn side by side so
that you can easily compare their (alues.

+tacked Columns and 2ines X the rectangles of the column data series are drawn
stac-ed abo(e each other' so that the height of a column (isualiFes the sum of the data (alues. The e3ample chart in 2igure :2 has manufacturing cost and profit data for two products o(er a period of time $si3 months in 200E&. To create this chart' first highlight the table of data and start the Chart 0iFard. Choose the $olumn and Line chart type with two lines and the data series in rows. Then gi(e it a title to highlight the aspect you want to show. The lines are different colors at this stage and do not reflect the product relationships. 0hen you finish with the Chart 0iFard' highlight the chart' clic- on the line' right+clic- and select Format %ata +eries. There are a few things to change% The colors should match the products. ,o both )r1anufacturing and profit are blue and "rall is red. The lines need to be more noticeable' so ma-e the lines thic-er by increasing the width to 0.0*. 2or the bac-ground' highlight the chart wall' right+clic- and select Format 8all. ;n the ,rea page' change the drop+down bo3 to show Gradient. Choose one of the preset gradient patterns and ma-e it lighter by going to the (ransparenc2 tab and ma-ing the gradient A0d transparent. To ma-e the chart loo- cleaner without the grid' go to nsert < (rids and deselect the Q+a3is option.

'igure .9: $olumn and line chart e*ample

$hapter 3 $reating $harts and Graphs

##.

$hapter " Using St2les and (emplates in $alc


Bringing uniformit2 to 2our spreadsheets

8hat is a template9
) template is a model that you use to create other documents in a standard format. 2or e3ample' you can create a template for in(oices that has your company logo and address at the top of the page. This means that any new spreadsheets $in(oices& created from this template will then ha(e your company logo and address on the first page of the spreadsheet. Templates can contain anything that regular documents can contain' such as te3t' graphics' styles' and user+specific setup information such as measurement units' language' default printer' and toolbar and menu customiFation. )ll documents in #ibre;ffice are based on templates. You can create' or download and install' as many templates as you wish. Cf you do not specify a template when you start a new spreadsheet' any new spreadsheet is then based on the default template for spreadsheets that is included with #ibre;ffice Calc. This default template consists of a blan- spreadsheet which you can customiFe to your needs and then' if you wish' use as a basis to create a custom default template. ,ee K,etting default templateL on page 13*.

8hat are styles9


) st2le is a set or group of formats that you can apply to selected elements in a document to ?uic-ly change their appearance. 0hen you apply a style' you apply a whole group of formats at the same time. 1any people manually format spreadsheet cells and pages without paying any attention to styles and are used to formatting documents according to ph2sical attributes. 2or e3ample' for the contents of a cell you might specify the font family' font siFe' and any character formatting such as bold or italic. ,tyles are logical attributes. !sing styles means that you stop applying attributes and characteristics indi(idually $for e3ample' font siFe 1<pt' Times ew Homan' bold' centered& and start using a style' for e3ample Title. )pplying attributes and characteristics is time consuming and prone to errors. Cn contrast' using a style' which has been defined to include the attributes and characteristics you want to use' will sa(e you time and gi(e greater consistency in formatting. ,tyles also ma-e maGor formatting changes easy. 2or e3ample' you may decide to change the appearance of all subtotals in your spreadsheet to be 10 pt )rial instead of * pt Times ew Homan after you ha(e created a 1A+page spreadsheet. You can change all of the subtotals in the document by simply changing the properties for the subtotal style. )nother type of style is a page style. "age styles allow you to define page margins' headers and footers' and other printing attributes gi(ing you consistency each time you print a spreadsheet.

+tyles
Calc style types
0hile some components of #ibre;ffice offer many style types' Calc offers only two% cell styles and page styles. These style types are e3plained in the following sections.

Cell st$les
Cell styles are similar to paragraph styles used in #ibre;ffice 0riter and are the most basic type of style in Calc. Cell styles are used for applying fonts' alignment' borders' bac-ground' number formats $for e3ample' currency' date' number&' and cell protection to format the data contained within the cells.
#99 LibreOffice ".# $alc Guide

) basic range of cell styles is supplied with #ibre;ffice. These styles are shown in 2igure :3. Cnitially' the basic styles are configured so that if you change the font family of Default' then all of the other styles will change to match. Creating' modifying' and accessing styles is e3plained in the following sections.

'igure .3: )*amples of basic cell st2les

1a%e st$les
"age styles in Calc are applied to sheets. )lthough one sheet may print on se(eral pages' only one page style can be applied to a sheet. Cf a spreadsheet file contains more than one sheet' then a different page style can be applied to each sheet. 2or e3ample' a spreadsheet might contain one sheet to be printed in landscape orientation and the other sheets in the spreadsheet are printed in portrait orientation. Two page styles are supplied with Calc% 5efault and Heport. You can adGust many settings using page styles and you can also define as many page styles as you re?uire. ,preadsheets are primarily used onscreen and not printed' therefore Calc does not display the page style on the screen. Cf you want a spreadsheet to fit on a certain page siFe' you ha(e to carefully control the column width and row height using File < Page Preview and >iew < Page breaks preview on the main menu bar to guide you. 5espite this limitation' it is recommended to define page styles for any spreadsheets that you are li-ely to print. This will help pre(ent any lost time or paper wastage due to trial and error. "age styles allow you to set page siFe and orientation' page margins' headers and footers' borders and bac-grounds' and the se?uence for printing sheets.

Applying cell styles


To apply cell styles in Calc' you can use the ,tyles and 2ormatting dialog' 2ill 2ormat mode' the )pply ,tyle list' or assign styles to shortcut -eys.

!t$les and For(attin% dialo%


1& Go to Format < +tyles and Formatting on the main menu bar' or press the '## -ey' or clic- the +tyles and Formatting icon 2ormatting dialog $2igure :<&. on the 2ormatting toolbar to open the ,tyles and

$hapter " Using St2les and (emplates in $alc

#93

'igure .": St2les and 'ormatting dialog 2& Clic- on the Cell +tyles icon in the ,tyles and 2ormatting dialog to open the list of cell styles. 3& /ighlight the cell or group of cells where you want to apply a cell style. <& 5ouble+clic- on the cell style name in the ,tyles and 2ormatting dialog and the formatting attributes for that style are applied to the data contained in the cell or group of cells.
The ,tyles and 2ormatting dialog can be doc-ed into the main Calc wor-space. To doc- or undoc- the window' hold down the $trl -ey and double+clic- on the icon bar at the top of the dialog' or clic- anywhere in the dialog and use the -eyboard combination $trl5Shift5'#8.

?ote

Fill For(at (ode


The 2ill 2ormat mode is useful when you want to apply the same style to many scattered cells. 1& Go to Format < +tyles and Formatting on the main menu bar' or press the '## -ey' or clic- the +tyles and Formatting icon 2ormatting dialog $2igure :<&. 2& ,elect the style you want to apply. on the 2ormatting toolbar to open the ,tyles and

3& Clic- on the Fill Format mode icon in the ,tyles and 2ormatting dialog and the cursor changes to a similar shape as the 2ill 2ormat 1ode icon. <& Clic- in each cell where you want to apply the formatting attributes. A& 0hen you ha(e finished formatting cells' clic- the 2ill 2ormat 1ode icon again or close the ,tyles and 2ormatting dialog.
0hen this mode is acti(e' a right+clic- anywhere in the document cancels the last 2ill 2ormat action. 4e careful not to accidentally right+clic- and thus cancel any formatting actions you want to -eep.

?ote

)ppl$ !t$le list


The Apply +tyle drop+down list used to select a style for selected cells is not normally included on the 2ormatting toolbar in Calc and has to be added as follows% 1& Hight+clic- in a blan- space on the 2ormatting toolbar and select >isible 7uttons from the conte3t menu $2igure :A&. 2& Clic- on Apply +tyle and the conte3t menus close. The )pply ,tyle list now appears at the left end of the 2ormatting toolbar.

#9"

LibreOffice ".# $alc Guide

'igure .%: ,dding an ,ppl2 St2le list to the 'ormatting toolbar )pply a style using the )pply ,tyles drop+down list as follows% 1& ,elect a cell or a group of cells in your spreadsheet. 2& Clic- the small triangle to open the drop+down list for )pply ,tyles. 3& ,elect the style you re?uire and the formatting attributes of the selected style are applied to the selected cells. <& Dach style in the drop+down menu is displayed with its pre(iew' but only few styles are a(ailable. Clic- on 4ore to go to the ,tyles and 2ormatting dialog where all cell styles are a(ailable.

)ssi%nin% s"ortcut 0e$s


You can create -eyboard shortcuts to apply commonly+used cell or page styles' including any custom styles that you ha(e created. ,ee $hapter #" Setting up and $ustomi1ing $alc for more information.

Applying page styles


0hen a page style has been applied to a sheet within a spreadsheet' the page style being used is indicated on the ,tatus 4ar as shown in 2igure :@.

'igure .&: Page st2le indicated on Status Bar 1& ,elect the sheet to be styled by clic-ing on its sheet tab at the bottom of the displayed spreadsheet. 2& Go to Format < +tyles and Formatting on the main menu bar' or press the '## -ey' or clic- the +tyles and Formatting icon 2ormatting dialog $2igure :<&. on the 2ormatting toolbar to open the ,tyles and .

3& Cn the ,tyles and 2ormatting dialog' clic- on the Page +tyles icon <& 5ouble+clic- on the re?uired page style.

$hapter " Using St2les and (emplates in $alc

#9%

Creating new or custom styles


You can create new or custom styles using the ,tyles and 2ormatting dialog or creating a new style from a selection.
)ny new or custom styles apply only to your spreadsheet and are not sa(ed in the template. To sa(e new styles in a template' see KTemplatesL on page 13E for more information.

?ote

.ew st$le fro( st$les and For(attin% dialo%


1& Go to Format < +tyles and Formatting on the main menu bar' or press the '## -ey' or clic- the +tyles and Formatting icon 2ormatting dialog $2igure :<&. on the 2ormatting toolbar to open the ,tyles and in the ,tyles and 2ormatting

2& To create a new cell style' clic- on the Cell +tyles icon dialog to open the list of cell styles.

3& To create a new page style' clic- on the Page +tyles icon in the ,tyles and 2ormatting dialog to open the list of page styles. <& Hight+clic- in the ,tyles and 2ormatting dialog and select ?ew from the conte3t menu to open either the Cell ,tyle dialog $2igure :E& or the "age ,tyle dialog $2igure :*&. A& !se the (arious tabbed pages in the dialogs to set the attributes for your new style. ,ee KCell style attributesL on page 12E and K"age style attributesL on page 131 for more information. @& Clic- =6 to close the dialog and sa(e your new style.

'igure .A: $ell St2le dialog E Organi1er page

'igure .-: Page St2le dialog E Organi1er page

#9&

LibreOffice ".# $alc Guide

.ew st$le fro( a selection


1& Go to Format < +tyles and Formatting on the main menu bar' or press the '## -ey' or clic- the +tyles and Formatting icon 2ormatting dialog $2igure :<&. on the 2ormatting toolbar to open the ,tyles and in the ,tyles and 2ormatting

2& To create a new cell style' clic- on the Cell +tyles icon dialog to open the list of cell styles.

3& To create a new page style' clic- on the Page +tyles icon in the ,tyles and 2ormatting dialog to open the list of page styles. <& ,elect the style you want to use as a base for your new style. A& Clic- the ?ew +tyle from +election icon to open the Create ,tyle dialog $2igure ::&. @& Type a name for the new style. The list bo3 displays the names of any e3isting custom styles used in the spreadsheet. E& Clic- =6 to sa(e the new style. *& Hight+clic- on the new style and select 4odify from the conte3t menu to open a dialog where you can change the style attributes. ,ee KCell style attributesL on page 12E and K"age style attributesL on page 131 for more information.

'igure ..: $reate St2le dialog


,tyle names are case sensiti(e. You can define' for e3ample' a style called red and another style called 3ed. 1a-e sure all style names are sufficiently different to pre(ent any confusion.

?ote

Cell style attributes


The following attributes are a(ailable on the tabbed pages of the Cell ,tyle dialog $2igure :E&.

Or%ani-er ?ame X displays the name of the selected style. Cf you are creating or modifying a custom
style' enter a name for the style. You cannot change the name of a predefined style.

2inked with X select an e3isting style that you want to base the new style on' or select
none to define your own style.

Category X displays the category for the current style. Cf you are creating or modifying a
new style' select $ustom St2le from the list. You cannot change the category for a predefined style.

Contains X describes the rele(ant formatting used in the current style. .u(bers Category X select a category from the list and then select a formatting style in the 2ormat
bo3.

Format X select how you want the contents of the selected cell$s& to be displayed. The
code for the selected option is displayed in the Format Code bo3.
$hapter " Using St2les and (emplates in $alc #9A

0hen you select $urrenc2 as a category' you ha(e to select a currency from the drop+down list and then select the format to use from the a(ailable options for that currency. The format code for currencies uses the form Vg333+nnnW' where 333 is the currency symbol' and nnn the country code. ,pecial ban-ing symbols' such as D!H $for Duro&' do not re?uire the country code. The currency format is not dependent on the language that you select in the 2anguage bo3. The default currency format for a cell is determined by the regional settings of your operating system.

2anguage X specifies the language setting for the selected cells. 0ith the language set to
)utomatic' #ibre;ffice automatically applies the number formats associated with the system default language. ,elect any language to fi3 the settings for the selected cells. The language setting ensures that date and currency formats are preser(ed e(en when the document is opened in an operating system that uses a different default language setting.

=ptions X specify the options for the selected format. Decimal places X enter the number of decimal places that you want to display. Leading 1eroes X enter the ma3imum number of Feroes to display in front of the
decimal point.

@egative numbers in red X changes the font color of negati(e numbers to red. Use thousands separator X inserts a separator between thousands. The type of separator that is used depends on your language settings.

Format code X displays the number format code for the selected format. You can also
enter a custom format. The following options are only a(ailable for user+defined number formats.

Preview Field X displays a pre(iew of the current selection. Font


The changes are applied to the current selection' to the entire word that contains the cursor' or to the new te3t that you type. 5epending on your language settings' you can change the formatting for the following font types%

0estern te3t font X #atin character sets )sian te3t font X Chinese' .apanese' or 6orean character sets Comple3 te3t layout font X right+to+left te3t direction ?ote
To enable support for comple3 te3t layout and )sian character sets' go to ,ools < =ptions < 2anguage +ettings < 2anguages and select #nabled.

Font X enter the name of an installed font family that you want to use' or select a font from
the list.

+tyle X select the formatting you want to apply% 7old or 0talic. +i5e X enter or select the font siFe that you want to apply. 2or scalable fonts' you can also
enter decimal (alues. Cf you are creating a style that is based on another style' you can enter a percentage (alue or a point (alue $for e3ample' X2pt or RApt&.

2anguage X sets the language that the spelling chec-er uses for the selected te3t or the
te3t that you type. The spelling chec-er for the selected language only functions when you ha(e installed the corresponding language module. ) language entry has a chec- mar- in front of it if the spelling chec-er is acti(ated for that language.

Preview X displays a pre(iew of the current selection.

#9-

LibreOffice ".# $alc Guide

Font Effects
The changes are applied to the current selection' to the entire word that contains the cursor' or to the new te3t that you type.

Font Color X sets the color for the selected te3t. Cf you select ,utomatic' the te3t color is
set to blac- for light bac-grounds and to white for dar- bac-grounds.

3elief X select a relief effect to apply to the selected te3t. The )mbossed relief ma-es the
characters appear as if they are raised abo(e the page. The )ngraved relief ma-es the characters appear as if they are pressed into the page.

=utline X displays the outline of the selected characters. This effect does not wor- with
e(ery font.

+hadow X adds a shadow that casts below and to the right of the selected characters. =verlining X select the o(erlining style that you want to apply. To apply the o(erlining to
words only' select ndividual words.

=verline color X select the color for the o(erlining. +trikethrough X select a stri-ethrough style for the selected te3t. ?ote
Cf you sa(e your document in 1, 0ord format' all of the stri-ethrough styles are con(erted to the single line style.

*nderlining X select the underlining style that you want to apply. To apply the underlining
to words only' select ndividual words. Cf you apply underlining to a superscript te3t' the underlining is raised to the le(el of the superscript. Cf the superscript is contained in a word with normal te3t' the underlining is not raised.

*nderline color X select the color for the underlining. ndividual words X applies the selected effect only to words and ignores spaces. Preview X displays a pre(iew of the current selection. )li%n(ent ,e.t alignment X sets the alignment options for the contents of the current cell' or the
selected cells.

+ori1ontal X select the horiFontal alignment option that you want to apply to the cell contents. Default X aligns numbers to the right and te3t to the left. Left X aligns the contents of the cell to the left. 3ight X aligns the contents of the cell to the right. $enter X horiFontally centers the contents of the cell. Lustified X aligns the contents of the cell to the left and to the right cell borders. 'illed X repeats the cell contents $number and te3t& until the (isible area of the cell is filled. This feature does not wor- on te3t that contains line brea-s. Distributed X aligns contents e(enly across the whole cell. !nli-e Lustified' it also Gustifies the (ery last line of te3t. 0ndent X indents from the left edge of the cell by the amount that you enter. Hertical X select the (ertical alignment option that you want to apply to the cell contents. Default X aligns the cell contents to the bottom of the cell.

$hapter " Using St2les and (emplates in $alc

#9.

(op X aligns the contents of the cell to the upper edge of the cell. Bottom X aligns the contents of the cell to the lower edge of the cell. :iddle X (ertically centers the contents of the cell. Lustified X aligns the contents of the cell to the top and to the bottom cell borders. Distributed X aligns contents e(enly across the whole cell. !nli-e Lustified' it also Gustifies the (ery last line of te3t.

,e.t orientation X defines the te3t direction of cell contents. ,B$D wheel X clic- anywhere in the wheel to define the te3t orientation. The characters
U)4C5U on the wheel correspond to the new setting.

Herticall2 stac4ed X assigns (ertical te3t orientation for cell contents. Degrees X allows you to manually enter the orientation angle. ) positi(e number rotates the te3t to the left and a negati(e number rotates the te3t to the right. 3eference edge X specify the cell edge from which to write the rotated te3t. (e*t )*tension 'rom Lower $ell Border X writes the rotated te3t from the bottom cell edge outwards. (e*t )*tension 'rom Upper $ell Border X writes the rotated te3t from the top cell edge outwards. (e*t )*tension 0nside $ells X writes the rotated te3t only within the cell.

Properties X determine the te3t flow in a cell. <rap te*t automaticall2 X wraps te3t onto another line at the cell border. The number of
lines depends on the width of the cell. To enter a manual line brea-' press $trl5)nter in the cell.

+2phenation active X enables word hyphenation for te3t wrapping to the ne3t line. Shrin4 to fit cell si1e X reduces the apparent siFe of the font so that the contents of the cell fit into the current cell width. You cannot apply this command to a cell that contains line brea-s.

:orders
,ets the border attributes for the selected cells.

2ine arrangement X select a predefined border style to apply. Cn a spreadsheet' you can
also add or remo(e predefined borders with the 7orders icon on the Table toolbar.

2ine X select the border style' width' and color that you want to apply. The style is applied
to the borders selected in the pre(iew.

+pacing to contents X specify the amount of space that you want to lea(e between the
border and the contents of the selection.

Left X enter the distance between the left border and the contents of the selection. 3ight X enter the distance between the right border and the contents of the selection. (op X enter the distance between the top border and the contents of the selection. Bottom X enter the distance that between the bottom border and the contents of the selection. S2nchroni1e X applies the same spacing to contents setting to all four borders when you enter a new distance.

+hadow style X applies a shadow effect to borders. 2or the best results' only apply this
effect when all four borders are (isible. Graphics or obGects that are anchored to a frame in

#38

LibreOffice ".# $alc Guide

the document cannot e3ceed the siFe of the frame. Cf you apply a shadow to the borders of an obGect that fills an entire frame' the siFe of the obGect is reduced to display the shadows.

Position X select a shadow style for the selected borders. Distance X enter the distance the shadow e3tends from the obGect. $olor X select a color for the shadow.

:ac0%round
,elect a color that you want to use as a bac-ground for your selected cells. To remo(e a bac-ground color' select @o 'ill.

Cell protection ;ide all X hides formulas and contents of the selected cells. Protected X pre(ents the selected cells from being modified. This cell protection only ta-es
effect if you also protect the sheet.

;ide formula X hides formulas in the selected cells. ;ide when printing X pre(ents the selected cells from being printed.

Page style attributes


The following attributes are a(ailable on the (arious tabbed pages of the "ages ,tyle dialog $2igure :*&.

Or%ani-er ?ame X displays the name of the selected style. Cf you are creating or modifying a custom
style' enter a name for the style. You cannot change the name of a predefined style.

2inked with X select an e3isting style that you want to base the new style on' or select
none to define your own style.

Category X displays the category for the current style. Cf you are creating or modifying a
new style' select $ustom St2le from the list. You cannot change the category for a predefined style.

Contains X describes the rele(ant formatting used in the current style. 1a%e
You can define page layouts for single and multiple+page documents' as well as page numbering and paper formats.

Paper format X select from a list of predefined paper siFes' or define a custom paper
format.

'ormat X select a predefined paper siFe' or create a custom format by entering the dimensions for the paper in the +eight and <idth bo3es. <idth X displays the width of the selected paper format. To define a custom format' enter a width here. +eight X displays the height of the selected paper format. To define a custom format' enter a height here. Orientation: Portrait X displays and prints the current document with the paper oriented (ertically.

$hapter " Using St2les and (emplates in $alc

#3#

Orientation: Landscape X displays and prints the current document with the paper oriented horiFontally. Paper tra2 X select the paper source for your printer. Cf you want' you can assign different paper trays to different page styles. 2or e3ample' you can assign a different tray for the first page style in your spreadsheet and load the tray with your company letterhead paper.

4argins X specify the amount of space to lea(e between the edges of the page and the
document te3t.

Left 0nner X enter the amount of space to lea(e between the left edge of the page and the document te3t. Cf you are using :irrored page layout' enter the amount of space to lea(e between the inner te3t margin and the inner edge of the page. 3ight Outer X enter the amount of space to lea(e between the right edge of the page and the document te3t. Cf you are using :irrored page layout' enter the amount of space to lea(e between the outer te3t margin and the outer edge of the page. (op X enter the amount of space to lea(e between the upper edge of the page and the document te3t. Bottom X enter the amount of space to lea(e between the lower edge of the page and the document te3t.

2ayout settings X select the page layout style to use in the current document. Page la2out: 3ight and left X shows both odd and e(en pages with left and right
margins as specified.

Page la2out: :irrored X shows both odd and e(en pages with inner and outer margins as specified. !se this layout if you want to bind the printed pages li-e a boo-. Dnter the binding space as the 0nner margin. Page la2out: Onl2 right X shows only odd $right& pages. D(en pages are shown as blanpages. Page la2out: Onl2 left X shows only e(en $left& pages. ;dd pages are shown as blanpages. 'ormat X select the page numbering format to use for the page style. (able alignment: +ori1ontal X centers the cells horiFontally on the printed page. (able alignment: Hertical X centers the cells (ertically on the printed page.

:orders and :ac0%round


,ee K4ordersL and K4ac-groundL in KCell style attributesL abo(e for information on how to set the borders and bac-ground for page styles.

3eader
)dds a header to the page style. ) header is an area in the top page margin where you can add te3t or graphics.

;eader on X adds a header to the page style. +ame content leftHright X e(en and odd pages share the same content. To assign a
different header to e(en and odd pages' deselect this option and then select #dit.

2eft margin X enter the amount of space to lea(e between the left edge of the page and
the left edge of the header.

3ight margin X enter the amount of space to lea(e between the right edge of the page and
the right edge of the header.

#39

LibreOffice ".# $alc Guide

+pacing X enter the amount of space to maintain between the bottom edge of the header
and the top edge of the document te3t.

;eight X enter the height that you want for the header. AutoFit height X automatically adGusts the height of the header to fit the content. Preview X displays a pre(iew of the current selection. 4ore X defines a border' bac-ground color' or bac-ground pattern for the header. #dit X allows you to add or edit header te3t.

Footer
)dds a footer to the page style. ) footer is an area in the bottom page margin where you can add te3t or graphics. ,ee K/eaderL abo(e for information on the a(ailable options you can use for a footer.

!"eet
,pecifies the elements to be included in the printout of all sheets with the page style. )dditionally' you can set the print order' the first page number' and the page scale.

Page =rder X defines the order in which data in a sheet is numbered and printed when it
does not fit on one printed page.

(op to bottom= then right X prints (ertically from the left column to the bottom of the sheet. Left to right= then down X prints horiFontally from the top row of the sheet to the right column. 'irst page number X select this option if you want the first page to start with a number other than 1.

Print X defines which elements of the spreadsheet are to be printed. $olumn and row headers X specifies whether you want the column and row headers to
be printed.

Grid X prints the borders of the indi(idual cells as a grid. 2or the (iew on screen' ma-e your selection in ,ools < =ptions /<2ibre=ffice Calc /<>iew < (rid lines. $omments X prints the comments defined in your spreadsheet. They will be printed on a separate page along with the corresponding cell reference. ObIects graphics X includes all inserted obGects $if printable& and graphics with the printed document. $harts X prints the charts that ha(e been inserted into your spreadsheet. Drawing obIects X includes all drawing obGects in the printed document. 'ormulas X prints the formulas contained in the cells' instead of the results. ?ero values X specifies that cells with a Fero (alue are printed.

+cale X defines a page scale for the printed spreadsheet. Scaling mode X select a scaling mode from the drop+down list. )ppropriate controls will
be shown below this option.

3educe enlarge printout X specifies a scaling factor to scale all printed pages. Scaling factor X enter a percentage figure for scaling your spreadsheet for printing. The default setting is 100d.

$hapter " Using St2les and (emplates in $alc

#33

'it print range6s7 to width height X specifies the ma3imum number of pages horiFontally $width& and (ertically $height& on which e(ery sheet with the same page style is to be printed. The print ranges are always scaled proportionally' so the resulting number of pages may be less than specified. You may deselect one of the options' then the unspecified dimension will use as many pages as necessary. Cf you deselect both options' this will result in a scaling factor of 100d. <idth in pages X enter the ma3imum number of pages to be printed horiFontally across. +eight in pages X enter the ma3imum number of pages to be printed (ertically stac-ed. 'it print range6s7 on number of pages X specifies the ma3imum number of pages on which e(ery sheet with the same page style is to be printed. The scale will be reduced as necessary to fit the defined number of pages. @umber of pages X enter the ma3imum number of pages to be printed.

4odifying and updating styles


Modif$in% st$les
1& Go to Format < +tyles and Formatting on the main menu bar' or press the '## -ey' or clic- the +tyles and Formatting icon 2ormatting dialog $2igure :<&. on the 2ormatting toolbar to open the ,tyles and in the ,tyles and 2ormatting dialog

2& To modify a cell style' clic- on the Cell +tyles icon to open the list of cell styles.

3& To modify a page style' clic- on the Page +tyles icon in the ,tyles and 2ormatting dialog to open the list of page styles. <& Hight+clic- on the style name you want to modify and select 4odify from the conte3t menu to open either the Cell ,tyle dialog $2igure :E& or the "age ,tyle dialog $2igure :*&. A& 1a-e the necessary changes to the style attributes. 2or more information on style attributes' see KCell style attributesL on page 12E and K"age style attributesL on page 131. @& Clic- =6 to sa(e the changes and close the dialog.

?ote

The 4odify command is una(ailable if one or more sheets are protected' e(en if the style to be modified is being used in an unprotected sheet.

+pdatin% st$les
!pdating styles can only be carried out on cell styles as follows% 1& Go to Format < +tyles and Formatting on the main menu bar' or press the '## -ey' or clic- the +tyles and Formatting icon 2ormatting dialog $2igure :<&. on the 2ormatting toolbar to open the ,tyles and

2& Clic- on the Cell +tyles icon in the ,tyles and 2ormatting dialog to open the list of cell styles. 3& ,elect a cell on the spreadsheet that is using the cell style you want to update and highlight the data in the cell. The cell style name will be highlighted in the ,tyles and 2ormatting dialog. <& 1a-e the necessary format changes to the data.
#3" LibreOffice ".# $alc Guide

A& Clic- on the *pdate +tyle icon and the cell style attributes will be updated with your changes. )ny other cells using the same cell style will also be updated to with your changes.

;iding$ showing and displaying styles


3idin% st$les
/iding styles can only be carried out on cell styles as follows. ;nly styles that are not being used in the spreadsheet can be hidden. 1& Go to Format < +tyles and Formatting on the main menu bar' or press the '## -ey' or clic- the +tyles and Formatting icon 2ormatting dialog $2igure :<&. on the 2ormatting toolbar to open the ,tyles and

2& Clic- on the Cell +tyles icon in the ,tyles and 2ormatting dialog to open the list of cell styles. 3& Hight clic- on an unused cell style and select ;ide from the conte3t menu. The style is then mo(ed to the +idden St2les category in the ,tyles and 2ormatting dialog.

!"owin% st$les
1& Go to Format < +tyles and Formatting on the main menu bar' or press the '## -ey' or clic- the +tyles and Formatting icon on the 2ormatting toolbar to open the ,tyles and 2ormatting dialog $2igure :<&. 2& Clic- on the drop+down list at the bottom of the ,tyles and 2ormatting dialog and select +idden St2les from the list. 3& Hight clic- on the hidden style you want to show and select +how from the conte3t menu. The style will then be displayed in the ,tyles and 2ormatting dialog.

*ispla$in% st$les
The ,tyles and 2ormatting dialog can display different categories of styles as follows% 1& Go to Format < +tyles and Formatting on the main menu bar' or press the '## -ey' or clic- the +tyles and Formatting icon on the 2ormatting toolbar to open the ,tyles and 2ormatting dialog $2igure :<&. 2& Clic- on the drop+down list at the bottom of the ,tyles and 2ormatting dialog. 3& ,elect the style category you want displayed in the ,tyles and 2ormatting dialog. The categories are as follows%

+ierarchical X lists the styles used in an outline and normally only applies to documents that use a hierarchical outline. ,ll St2les X lists all the styles that are a(ailable in Calc and in your spreadsheet' e3cept for +idden St2les. +idden St2les X lists all the styles that ha(e been hidden in a spreadsheet. ,pplied St2les X lists only the styles that ha(e been applied to the spreadsheet. $ustom St2les X lists only the styles that you ha(e created for use in a spreadsheet or a template.

$hapter " Using St2les and (emplates in $alc

#3%

Copying cell styles


To copy a cell style already in use to another cell in your spreadsheet or into a cell in another spreadsheet% 1& Clic- one of the cells that has been assigned the style you want to copy' and then copy the cell to the clipboard. 2& ,elect the cells that are to recei(e the same formatting as the copied cell. 3& Go to #dit < Paste +pecial on the menu bar to open the "aste ,pecial dialog $2igure 100&. <& 1a-e sure that only Formats is selected and clic- =6 to paste the style formatting attributes into the cell.

'igure #88: Paste Special dialog

%eleting styles
You can only delete styles that you ha(e created. The styles that are included with #ibre;ffice as part of the software installation cannot be deleted. 1& Go to Format < +tyles and Formatting on the main menu bar' or press the '## -ey' or clic- the +tyles and Formatting icon 2ormatting dialog $2igure :<&. on the 2ormatting toolbar to open the ,tyles and in the ,tyles and 2ormatting dialog

2& To delete a cell style' clic- on the Cell +tyles icon to open the list of cell styles.

3& To delete a page style' clic- on the Page +tyles icon in the ,tyles and 2ormatting dialog to open the list of page styles. <& Hight+clic- on the style you want to delete and select %elete from the conte3t menu. A& ,elect Ies on the warning message that opens to delete the style. )ny data in a cell or a sheet in the spreadsheet that used the deleted style will re(ert to the 5efault style included with Calc.

#3&

LibreOffice ".# $alc Guide

,emplates
Creating templates
Templates are created from a new or e3isting spreadsheet as follows% 1& ;pen a new or e3isting spreadsheet that you want to use as a base for a template. 2& )dd any necessary pre+defined content that you want to appear in a spreadsheet each time you use the new template. 2or e3ample' company logo and name' company information' page numbers' and so on. 3& Create all the cell and page styles that you want to use in your new template. <& Go to File < +ave as ,emplate on the main menu bar' or use the -eyboard combination Shift5'## to open the Template 1anager dialog $2igure 101&. A& 5ouble+clic- to open the folder where you want to sa(e your template or create a new folder for spreadsheet templates. Ct is recommended to use the 1y Templates folder for all your #ibre;ffice templates. @& Clic- the +ave icon and type a memorable name for your template. E& Clic- =6 to sa(e the new template.

'igure #8#: (emplate :anager dialog

?ote

0hen you create and sa(e a spreadsheet template' it will be automatically sa(ed in the ,preadsheets section in the Template 1anager.

#diting templates
1& Go to File < ?ew < ,emplates on the main menu bar' or clic- on the ,emplates button on the #ibre;ffice opening dialog to open the Template 1anager dialog. 4y default' the Template 1anager opens in the 1y Templates folder. 2& Clic- on the ,preadsheets tab or na(igate to the folder where you ha(e sa(ed your spreadsheet templates. 3& ,elect the template that you want to edit. 0hen you do this' a row of icons appears abo(e the templates $see 2igure 102&. <& Clic- the #dit icon and the spreadsheet template opens in Calc. A& 1a-e all necessary to the template content' cell styles' and page styles Gust as you would with a spreadsheet. @& Go to File < +ave on the menu bar to sa(e your changes' or go to File < +ave As ,emplate on the main menu bar to sa(e the edited template as a new template.
$hapter " Using St2les and (emplates in $alc #3A

'igure #89: (emplate :anager dialog E )diting templates

Creating spreadsheets from templates


To create a spreadsheet from a template% 1& Go to File < ?ew < ,emplates on the main menu bar to open the Template 1anager dialog $2igure 102&. 2& ,elect the ,preadsheets tab and na(igate to the folder where the template is located. The default folder for templates is 1y Templates. 3& ,elect the template you want to use and clic- on the =pen icon ' or double+clic- on the template to open it. The Template 1anager closes and a new spreadsheet opens in Calc. <& Go to File < +ave As on the main menu bar' or use the -eyboard combination $trl5Shift5S and sa(e your new spreadsheet with the filename you want to use.

*pdating styles from a changed template


Cf you ma-e any changes to a template and its styles' the ne3t time you open a spreadsheet that was created before you changed the template' a confirmation message is displayed. 1& Clic- *pdate +tyles to apply the changed styles in the template to the spreadsheet. 2& Clic- 6eep =ld +tyles if you do not want to apply the changed styles in the template to the spreadsheet.

?ote

Cf you select 6eep =ld +tyles' the confirmation message will not appear again the ne3t time you open the spreadsheet using the same changed template.

+etting default template


Cf you create a new spreadsheet using File < ?ew < +preadsheet on the main menu bar' Calc creates the document from the default template for spreadsheets. You can' howe(er' set any template as the default template. You can also reset the default template to the Calc default template at a later date if you want to.

#3-

LibreOffice ".# $alc Guide

!ettin% a te(plate as default


You can set any template to be the default' but the template must be located in one of the folders displayed in the Template 1anager dialog. 1& Go to File < ?ew < ,emplates on the main menu bar to open the Template 1anager dialog $2igure 102&. 2& a(igate to the folder containing the template that you want to set as the default. 3& ,elect the template. <& Clic- on the +et As %efault icon will be created from this template. . The ne3t time that you create a new spreadsheet' it

&esettin% default te(plate


To set the default spreadsheet template bac- to the default template supplied with Calc% 1& Go to File < ?ew < ,emplates on the main menu bar to open the Template 1anager dialog $2igure 102&. 2& Clic- on the Action 4enu icon. 3& ,elect 3eset %efault ,emplate < +preadsheet from the conte3t menu. The ne3t time that you create a new spreadsheet' it will be created using the Calc default template.

?ote

Hesetting the default template bac- to the Calc default template is only a(ailable if the default has been changed pre(iously.

Associating spreadsheets with a different template


)t times you might want to use or associate a spreadsheet with a different template. The main ad(antage of associating a spreadsheet with a different template is that it ma-es it easier to update the styles if the re?uirement arises. 2or best results when associating spreadsheets with another template is to ma-e sure that the style names in the spreadsheet and in the template are the same. Cf the names are not the same' you will need to use ,earch and Heplace function in Calc to replace the old styles with new ones. ,ee $hapter 9 )ntering= )diting= and 'ormatting Data for more information about finding and replacing styles. 1& Go to File < ?ew < ,emplates on the main menu bar to open the Template 1anager dialog $2igure 102&. 2& a(igate to the folder containing the template that you want to use. 3& 5ouble clic- on the template and a new blan- spreadsheet is created. <& ;pen the spreadsheet you want to associate with the template. A& Go to #dit < +elect All on the main menu bar' or use the -eyboard combination $trl5, to select e(erything in the spreadsheet you want to change. @& Go to #dit < Copy on the main menu bar' or use the -eyboard combination $trl5$ to copy the spreadsheet data to the clipboard. E& Close the old spreadsheet without sa(ing. *& Cn the new blan- spreadsheet' go to #dit < Paste on the main menu bar' or use the -eyboard combination $trl5H to paste the data into the spreadsheet. :& Go to File < +ave As on the main menu bar' or use the -eyboard combination $trl5Shift5S to sa(e this new spreadsheet with the filename as the old spreadsheet. 10& 0hen as-ed' confirm that you want to o(erwrite the old file.
$hapter " Using St2les and (emplates in $alc #3.

=rgani5ing templates
#ibre;ffice can only use templates that are in its template folders. You can create new template folders and use them to organiFe your templates and import templates into these folders. 2or e3ample' you might ha(e one template folder for sales templates and another for in(oice templates. You can also e3port templates.
The location of template folders in #ibre;ffice depends on the operating system of your computer. Cf you want to -now where the template folders are located' go to ,ools < =ptions < 2ibre=ffice < Paths.

,ip

Creatin% te(plate folders


1& Go to File < ?ew < ,emplates on the main menu bar to open the Template 1anager dialog. Cf necessary' clic- on ,ll (emplates to display the (iew shown in 2igure 101. 2& Clic- the ?ew Folder icon . 3& Cn the pop+up dialog' type a name for the new folder and clic- =6. The new folder now appears in the list of folders.

Deleting template folders


You cannot delete template folders supplied with #ibre;ffice. You can only delete template folders that you ha(e created. 1& Go to File < ?ew < ,emplates on the main menu bar to open the Template 1anager dialog $2igure 102&. 2& ,elect the folder that you want to delete. 3& Clic- the %elete icon .

<& Clic- Ies to confirm the deletion and the folder and templates inside the folder are deleted.

Movin% te(plates
To mo(e a template from one template folder to another template folder% 1& Go to File < ?ew < ,emplates on the main menu bar to open the Template 1anager dialog $2igure 102&. 2& a(igate to the folder containing the template that you want to mo(e to another folder. 3& ,elect the template you want to mo(e. <& Clic- the 4ove to folder icon and select the folder you want to use from the conte3t menu. The selected template is mo(ed to the folder.

*eletin% te(plates
You cannot delete templates supplied with #ibre;ffice. You can only delete templates that you ha(e created or imported. 1& Go to File < ?ew < ,emplates on the main menu bar to open the Template 1anager dialog $2igure 102&. 2& ,elect the folder that you want to delete. 3& Clic- the %elete icon .

<& Clic- Ies to confirm the deletion and the folder and templates inside the folder are deleted.

#"8

LibreOffice ".# $alc Guide

(portin% te(plates
You can import and add templates to your collection as follows% 1& ;pen your browser software and locate the web page where the template is located. Ct is recommended to use the lin- http%//templates.libreoffice.org/template+center which will ta-e you to the #ibre;ffice Template Center where you will find se(eral templates that are fully compatible with #ibre;ffice. 2& 5ownload the template you want to use. 3& Cn Calc' go to File < ?ew < ,emplates to open the Template 1anager dialog $2igure 103&. <& Clic- on the mport icon and na(igate to the folder where the downloaded template is located on your computer. A& ,elect the template and clic- =pen. )fter import' the template becomes a(ailable in the Template 1anager.

'igure #83: (emplate :anager dialog E 0mporting templates

?ote

Ct is recommended to import templates using the abo(e procedure as this places the templates into the correct location for #ibre;ffice to locate the templates.

Exportin% te(plates
To e3port a template from a template folder to another location% 1& Go to File < ?ew < ,emplates on the main menu bar to open the Template 1anager dialog $2igure 102&. 2& a(igate to the folder containing the template that you want to e3port. 3& ,elect the template that you want to e3port. <& Clic- the #.port icon and the ,a(e )s dialog opens. a(igate to the location where you want to e3port the template and clic- +ave. Cf necessary' you can also rename the template.

$hapter " Using St2les and (emplates in $alc

#"#

$hapter % Using Graphics in $alc

(raphics in Calc
Calc is often used to present data and ma-e forecasts and predictions. Graphics can turn an a(erage document into a memorable one. Calc can import (arious (ector $line drawing& and raster $bitmap& file formats. The most commonly used graphic formats are GC2' ."G' " G' and 41". ,ee the ;elp for a full list of the formats #ibre;ffice can import. Graphics in Calc are of three basic types%

Cmage files' such as photos' drawings' and scanned images 5iagrams created using #ibre;fficeIs drawing tools Charts and graphs created using #ibre;fficeIs Chart facility
This chapter co(ers images and diagrams. Charts are described in Chapter 3' Creating Charts and Graphs. )lthough using graphics in Calc is (ery similar to using graphics in any other component of #ibre;ffice' this chapter e3plains some of the differences in their use. Ct also co(ers some of the more ad(anced graphics functions and how they can further enhance your spreadsheet.
The term graphics refers to both pictures and drawing obGects. ;ften the word images is used when referring to pictures and other graphics that are not drawing obGects.

?ote

Adding graphics KimagesL


Cmages $also called pictures in #ibre;ffice&' such as corporate logos and photographs of people and products' are probably the most common types of graphics added to a Calc document. They may be downloaded from the Cnternet' scanned' or created with a graphics programN or they may be photos ta-en with a digital camera. Cmages can be inserted in three ways%

!sing the Cnsert "icture dialog 2rom the gallery 2rom the clipboard by copying and pasting

nserting an image file KpictureL


"erhaps the most common source of graphics is e3isting files. To insert an image from a file' use the Cnsert "icture dialog.

nsert 1icture dialo%


1& Clic- in the location in the Calc document where you want the image to appear. 5o not worry too much about the e3act placement of the image at this stageN placement can be changed easily as described in K"ositioning graphicsL on page 1A*. 2& Choose nsert < Picture < From File from the 1enu bar' or clic- the nsert Picture icon on the Cnsert toolbar&. 3& ;n the Cnsert "icture dialog' na(igate to the file to be inserted' select it' and clic- =pen.

#""

LibreOffice ".# $alc Guide

?ote

The picture is inserted into Calc floating abo(e the cells and anchored to the cell in which the cursor was placed. ,ee K"ositioning graphicsL on page 1A* for more about positioning and anchoring graphics.

'igure #8": 0nserting a picture from a file )t the bottom of the dialog are two options' 2ink and Preview. ,elect Preview to (iew a thumbnail of the selected image on the right' so you can (erify that you ha(e the correct file. The 2ink option is discussed below. 0hen the 2ink option is not selected' the picture is embedded in the Calc document.
Your Cnsert "icture dialog may loo- different from the one shown here' depending on your operating system and your choice in ,ools < =ptions < 2ibre=ffice < (eneral of whether to use the #ibre;ffice ;pen and ,a(e dialogs.

?ote

Lin0in% an i(a%e file


To create a lin- to the file containing the image instead of sa(ing a copy of the image in the Calc document' use the Cnsert picture dialog and select the 2ink option. ) warning dialog opens informing you of the haFards of lin-ing a file and as-s you to confirm you want to #in- or change to Dmbed Graphic. The image is then displayed in the document' but when the document is sa(ed' it contains only a reference to the image filecnot the image itself. The document and the image remain as two separate files' which are merged temporarily only when you open the document again.

'igure #8%: Lin4ing warning dialog

$hapter % Using Graphics in $alc

#"%

#in-ing an image has two ad(antages and one disad(antage%

Advantage X You can modify the image file separately without changing the document
because the lin- to the file remains (alid' and the modified image will appear when you ne3t open the document. This can be a big ad(antage if you $or someone else' perhaps a graphic artist& is updating images.

Advantage X #in-ing can reduce the siFe of the document when it is sa(ed' because the
image file itself is not included. The file siFe is usually not a problem on a modern computer with a reasonable amount of memory' unless the document includes many large graphics files. Calc can handle ?uite large files.

%isadvantage X Cf you send the document to someone else' or mo(e it to a different


computer' you must also send the image files' or the recei(er will not be able to see the lin-ed images. You need to -eep trac- of the location of the images and ma-e sure the recipient -nows where to put them on another machine' so the Calc document can find them. 2or e3ample' you might -eep images in a subfolder named Cmages $under the folder containing the Calc document&N the recipient of the Calc file needs to put the images in a subfolder with the same name $under the folder containing the Calc document&.
0hen inserting the same image se(eral times in the document' it might appear beneficial to create lin-s. /owe(er' this is not necessary' as #ibre;ffice embeds only one copy of the image file in the document. $5eleting one or more of the copies does not affect the others.&

?ote

E(beddin% lin0ed i(a%es


Cf you originally lin-ed the images' you can easily embed $sa(e in the Calc document& one or more of them later if you wish. To do so% 1& ;pen the document in Calc. 2& Choose #dit < 2inks from the 1enu bar. The Ddit #in-s dialog shows all the lin-ed files. Cn the Source file list' select the files you want to change from lin-ed to embedded. 3& Clic- the 7reak 2ink button.

'igure #8&: (he )dit Lin4s dialog

#"&

LibreOffice ".# $alc Guide

?ote

Going the other way' from embedded to lin-ed' is not so easycyou must delete and reinsert each image' one at a time' selecting the 2ink option when you do so.

nserting an image from the clipboard


!sing the clipboard' you can copy images into a Calc document from another Calc document' from another component of #ibre;ffice $0riter' 5raw' and so on&' and from other programs. To do this% 1& ;pen both the source document and the Calc document into which you want to copy the image. 2& Cn the source document' select the image to be copied. 3& "ress $ontrol5$ to copy the image to the clipboard. <& ,witch to the Calc window. A& Clic- to place the cursor where the graphic is to be inserted. @& "ress $ontrol5H to insert the image.

Caution

Cf the application from which the graphic was copied is closed before the graphic is pasted into Calc' the image stored on the clipboard could be lost from the clipboard.

nserting an image from the (allery


The Gallery pro(ides a con(enient way to group reusable obGects such as graphics and sounds that you can insert into your documents. The Gallery is a(ailable in all components of #ibre;ffice. Ct does not come with many graphics' but you can add your own pictures or find e3tensions containing more graphics. The Gallery is e3plained in more detail in Chapter 11' Graphics' the Gallery' and 2ontwor-' in the Getting Started guide. 2or more about e3tensions' see Chapter 1<' ,etting !p and CustomiFing Calc' in this boo-. This section e3plains the basics of inserting a Gallery image into a Calc document. 1& To open the Gallery $2igure 10E&' clic- on the Gallery icon $located in the right side of the ,tandard toolbar& or choose ,ools < (allery from the 1enu bar. 2& a(igate through the Gallery to find the desired picture. 3& To insert the picture' either right+clic- on the picture and choose nsert < Copy or clic- and drag the picture from the Gallery into the Calc document. 4y default' the Gallery is doc-ed abo(e the Calc wor-space. To e3pand the Gallery' position the pointer o(er the line that di(ides it from the top of the wor-space. 0hen the pointer changes to parallel lines with arrows' item 2 in 2igure 10E' clic- and drag downward. The wor-space re+siFes in response. To e3pand the Gallery without affecting the wor-space' undoc- it so it floats o(er the wor-space. To do so' hold down the $ontrol -ey and double+clic- on the upper part of the Gallery ne3t to the Biew icons' or press the $trl5Shift5'#8 -eys. 5ouble+clic- in the same area while holding down the $ontrol -ey to doc- it again $restore it to its position o(er the wor-space&. 0hen the Gallery is doc-ed' to hide it and (iew the full Calc wor-space' clic- the ;ideH+how button' item 1 circled in 2igure 10E' in the middle of the thin bar separating the Gallery from the wor-space.

$hapter % Using Graphics in $alc

#"A

To close the Gallery' choose ,ools < (allery to unchec- the Gallery entry' or clic- on the Gallery icon again.

igure #8A: Galler2 in $alc

4odifying images
0hen you insert a new image' you may need to modify it to suit the document. This section describes the use of the "icture toolbar' resiFing' cropping' and rotating a picture. Changes made in Calc do not affect the original picture' whether it is embedded or lin-ed. Calc pro(ides many tools for wor-ing with images. These tools are sufficient for most peopleIs e(eryday re?uirements. /owe(er' for professional results it is generally better to use an image manipulation program such as GC1" to modify images $for e3ample' to crop' resiFe' rotate' and change color (alues& and then insert the result into Calc. GC1" is an open+source graphics program that can be downloaded from http%//www.gimp.org/downloads/.

*sing the Picture toolbar


0hen you insert an image or select one already present in the document' the "icture toolbar appears. You can set it to always be present $>iew < ,oolbars < Picture&. "icture control buttons from the "icture toolbar can also be added to the ,tandard Toolbar. ,ee Chapter 1<' ,etting !p and CustomiFing Calc' for more information. This toolbar can be either floating or doc-ed. 2igure 10* shows the "icture toolbar when it is floating. ) brief e3planation of the tools is gi(en in Table <. ,ee the Draw Guide for a more detailed e3planation.

#"-

LibreOffice ".# $alc Guide

Three other toolbars can be opened from this one% the Graphic 2ilter toolbar' which can be torn off and placed elsewhere on the window' the Color toolbar' which opens as a separate floating toolbar' and the )lignment toolbar' which also can be torn off. 2rom these four toolbars' you can apply small corrections to the graphic or obtain special effects.

'igure #8-: (he Picture (oolbar (able ": Picture toolbar functions 6from left to right7 con .a(e
2ilter Graphics 1ode Color Transparency #ine )rea ,hadow Crop

:e"avior
5isplays the Graphic 2ilter toolbar. ,ee page 1A0. "ro(ides se(eral color modes in the drop+down list. ,ee page 1A0. ;pens the Color toolbar' described on page 1A1. ,ets the transparency of the selected image. ,ee page 1A1. )dGusts the border style of the selected image. 2ills an area with the selected color or pattern. )dds a drop shadow to the edges of the picture. ;pens the Crop dialog' where you can remo(e a selected part of the picture. ,ee page 1A1. Toggles between anchoring the image to the cell or to the page. ,ee page 1A:. 4rings the selected image to the front of the stac-. ,ee page 1A*. "ushes the selected image to the rear of the stac-. ,ee page 1A*. )llows image to float in the foreground or ma-es it part of the bac-ground $behind the cells&. ,ee page 1A*. Cf two or more pictures are selected' adGusts the horiFontal and (ertical alignment of the pictures in relation to each other. ,ee page 1@0.

)nchor 4ring to 2ront ,end to 4acTo 2oreground / 4ac-ground )lignment

$hapter % Using Graphics in $alc

#".

Choosing a graphics mode


You can change color images to grayscale by selecting the image and then selecting (rayscale from the Graphics mode list. (able %: Graphics modes Grap"ics (ode
5efault Grayscale 4lac- / 0hite 0atermar-

:e"avior
6eeps the picture the same as it was inserted. ,hows the picture in gradual shades of gray. Con(erts the picture into a monochromatic blac- and white image. 1a-es the picture into a watermar- that blends into the bac-ground.

*sing graphic filters


Clic- the 2ilter icon to display the Graphic 2ilter toolbar' which pro(ides options for applying basic photographic and effect filters to images from within Calc. To Ktear offL this toolbar and place it anywhere on the screen' clic- on the three parallel lines and drag it away. (able &: Graphic filters and their effects con .a(e
Cn(ert ,mooth ,harpen Hemo(e oise ,olariFation )ging "osteriFe "op )rt Charcoal ,-etch Helief

:e"avior
Cn(erts the colors in the picture li-e a negati(e. )pplies a Gaussian 4lur to the image which softens edges. ,harpens the image. )pplies crude noise reduction. He(erses a portion of the tones' then produces pronounced outlines of the highlights. )pplies a ,epia filter. ;pens a dialog to determine the number of poster colors. This effect is based on the reduction of the number of colors. Ct ma-es photos looli-e paintings. )pplies a "op )rt style to the image. )pplies a Charcoal ,-etch loo- to the image. 5isplays a dialog for creating reliefs. The position of the imaginary light source that determines the type of shadow can be chosen. .oins small groups of pi3els into rectangular areas of the same color. The larger the indi(idual rectangles are' the fewer details the graphic image has.

1osaic

#%8

LibreOffice ".# $alc Guide

Caution

)pplying #ibre;ffice picture filters to any image consecuti(ely will progressi(ely degrade the ?uality of the image. The picture filters used in Calc utiliFe what is -nown as a 5estructi(e Dditing algorithm' whereby each filter is applied to the image immediately' changing the original data of the image. ,uccessi(e transformations result in less and less original data remaining' thus compromising the ?uality of the inserted picture. 0hile this might be acceptable for use in simple documents' it is still recommended that dedicated photo or image editing software be used to perform anything but the simplest of manipulations.

AdCusting colors
!se the Color toolbar to adGust an imageIs red' green' and blue channels independently' as well as its brightness' contrast and gamma.

+etting transparency
1odify the percentage (alue in the (ransparenc2 bo3 on the "icture toolbar to ma-e the image more transparent. This is particularly useful when creating a watermar- or when wrapping an image in the bac-ground.

Customi5ing lines$ areas$ and shadows


The #ine' )rea' and ,hadow icons open dialogs where you can customiFe these elements. 5etails are in the Draw Guide.

Cropping pictures
0hen you are only interested in a section of the image for the purpose of your document' you may wish to crop $hide& parts of it. Cf you wish to remo(e $delete& areas of the image it may be a better choice to use 5raw or a graphics pac-age. Clic- the Crop icon to open a dialog where you can select which portion of the image you want to remo(e from (iew. Ct is not possible to use the mouse to select the area to be cropped' as you can in 5raw. Cnstead' in the Crop dialog' specify how far from the top' bottom' left and right borders of the image the crop should be' as illustrated in 2igure 10:. ;n the thumbnail in the figure' notice that the cropped selection is highlighted with an inner rectangle. ;n the Crop dialog' you can control the following parameters% 6eep scale H 6eep image si5e 0hen 6eep scale is selected $default&' cropping the image does not change the scale of the picture. 0hen 6eep image si5e is selected' cropping enlarges $for positi(e cropping (alues&' shrin-s $for negati(e cropping (alues&' or distorts of the image so that the image siFe remains constant. 2eft$ 3ight$ ,op$ and 7ottom The image is cropped by the amount entered in these bo3es. 2or e3ample' a (alue of 'cm in the Left bo3 cuts 3 cm from the left side of the picture.

0hen 6eep scale is selected' the siFe of the image also changes' so in this e3ample the
width will be reduced by 3 cm.
$hapter % Using Graphics in $alc #%#

0hen 6eep image si5e is selected' the remaining part of the image is enlarged $when you
enter positi(e (alues for cropping& or shrun- $when you enter negati(e (alues for cropping& so that the width and height of the image is not changed.

'igure #8.: (he $rop dialog 8idth and ;eight The <idth and +eight fields under either Scale or 0mage si1e change as you enter (alues in the #eft' Hight' Top' and 4ottom fields. !se the thumbnail ne3t to these fields to determine the correct amount by which to crop. The original image siFe is indicated abo(e the =riginal +i5e button. The bitmap image density is shown alongside this dimension. The cropped shape is always a rectangleN more comple3 cropped shapes are not possible in Calc. Cnstead' use a dedicated photo or image editing software for the Gob' then import the image into Calc.

?ote

Cf you crop an image in Calc' the picture itself is not affected. ;nly the area displayed is altered. Cf you e3port the document to /T1#' the full original image is e3ported' not the cropped image.

3esi5ing an image
To resiFe an image% 1& Clic- the picture' if necessary' to show the colored resiFing handles. 2& "osition the pointer o(er one of the colored resiFing handles. The pointer changes shape gi(ing a graphical representation of the direction of the resiFing. 3& Clic- and drag to resiFe the picture. <& Helease the mouse button when satisfied with the new siFe. The corner handles resiFe both the width and the height of the graphic obGect simultaneously' while the other four handles only resiFe one dimension at a time. 2or more accurate resiFing' use the "osition and ,iFe dialog' described on page 1A<.

#%9

LibreOffice ".# $alc Guide

,ip

To retain the original proportions of the graphic' Shift5clic4 one of the corner handles' then drag.

&otatin% a picture
,elect the image' then choose Format < (raphic < Position and +i5e from the 1enu bar' or right+clic- the image and select Position and +i5e from the conte3t menu. 1& ,elect the 3otation tab on the dialog $2igure 110&. 2& Cn the Pivot point section of the page' select the 3+y co+ordinates of the pi(ot point' from the left and top edges' using the spin bo3 settings' or set the pi(ot point in one of the default positions shown in the selection graphic. 3& Cn the 3otation angle section' either set the number of degrees for the rotation angle in the Angle spin bo3' or clic- in the rotation grid. <& Cf you change your mind' clic- the 3eset button to return the settings to what they were when the dialog opened. A& Clic- =6 to rotate the image.

'igure ##8: 3otation settings page

*sing the picture conte.t menu


1any of the options accessible from the "icture toolbar can also be reached by right+clic-ing on an image to open a conte3t menu. ,ome additional options are only a(ailable from the conte3t menuN these are described in this section.

,e.t
;pens a dialog where you can set the options for te3t that goes o(er a picture. "ress =6 when your options ha(e been set. To write te3t o(er a graphic' either' clic- on the graphic to select it' and then press )nter' or double+clic- on the picture. ) blin-ing cursor then appears inside the graphic.
$hapter % Using Graphics in $alc #%3

Type the te3t and then clic- outside the graphic to complete the entry. )ny te3t entered is part of the graphic' so if the graphic is mo(ed the te3t will mo(e with it.

Position and +i5e


;pens the dialog shown below where you can change the siFe' location' rotation' slant and corner radius of the image.

'igure ###: Position and Si1e dialog

=riginal +i5e
Hesets the dimensions of the image to the (alues when it was originally inserted into the document.

%escription
You can add metadata in the form of a title and description to the image. This information is used by accessibility tools $such as screen reader software& and as )#T $alternati(e& attributes if you e3port the document to /T1#.

?ame
You can add a custom name to be assigned to the image' to ma-e it easier to find in the a(igator.
0hen collaborating with a team on a large' multi+page publication' it may be beneficial to gi(e graphics' figures' and other obGects meaningful names and descriptions to aid in clear communication.

,ip

Flip
2lips the image either horiFontally or (ertically. )ny te3t inserted as described abo(e will change orientation with the picture only when the picture is flipped (ertically.

#%"

LibreOffice ".# $alc Guide

Assign 4acro
)dds programmable functionality to the image. Calc pro(ides rich macro functionality. 1acros are introduced in Chapter 12' Calc 1acros.

(roup
To group images% 1& ,elect one image' then hold down the Shift -ey and clic- in turn on each of the others that you want to include in the group. The in(isible Kbounding bo3L $with the * colored handles& e3pands to include all the selected images. 2& 0ith the images selected' choose Format < (roup < (roup from the 1enu bar. ;r ho(er the mouse pointer o(er one of the images. 0hen the pointer changes shape from an arrow to a hand' right+clic- and choose (roup < (roup from the conte3t menu. )fter images are grouped' the conte3t menu pro(ides other choices $*ngroup and #dit (roup& and the Format < (roup menu includes *ngroup and #nter (roup. 2or more information about grouping' see the Draw Guide.

;yperlink
You can define a picture as a hyperlin- to another location in your spreadsheet' to another document or to a web page. To do this' select the picture' right+clic- and choose ;yperlink in the conte3t menu. The /yperlin- dialog opens. ,ee Chapter 10 for more information.

Compress a picture
You can compress a picture in order to reduce the siFe of your document. To do this' select the picture' right+clic- and choose Compress graphic in the conte3t menu. The dialog which opens shows the original and displayed siFe and resolution' with the ?uality of the picture in -ibibytes $-ilobytes&. You can choose between a ."DG compression and a lossless compression $" G&' with the ability to select a ?uality or compression le(el. You can also edit the siFe and the resolution of the picture along with the choice of an interpolation algorithm. ;nce these modifications are entered' use the Calculate button to calculate the new picture ?uality. Clic- =6 to accept the settings.

#dit with an e.ternal tool


You can edit a picture with an e3ternal tool' in order to use more ad(anced tools. To do this' select the picture' right+clic- and choose #dit with an e.ternal tool in the conte3t menu.

*sing CalcPs drawing tools


Calc' li-e the other components of #ibre;ffice' has a range of tools to create custom drawings. This chapter co(ers the default options in Calc. 2or a more detailed e3planation of the drawing tools and their uses' see the Draw Guide. Cn general' if you need to create comple3 drawings' it is recommended to use #ibre;ffice 5raw or another drawing program. To begin using the drawing tools' choose >iew < ,oolbars < %rawing. The 5rawing toolbar appears at the bottom of the screen. You can tear off this toolbar and mo(e it to a con(enient place on the window.
$hapter % Using Graphics in $alc #%%

'igure ##9: (he Drawing toolbar showing default icons (able A: Drawing toolbar functions 6from left to right7 con .a(e
,elect #ine Hectangle Dllipse 2reeform #ine Te3t Callouts 4asic ,hapes ,ymbol ,hapes 4loc- )rrows 2lowcharts Callouts ,tars "oints 2ontwor- Gallery

:e"avior
,elects obGects. 5raws a line. 5raws a rectangle. To draw a s?uare' hold down Shift while you drag. 5raws an ellipse. To draw a circle' hold down Shift while you drag. 5raws a freeform line. 5raws a te3t bo3 with no border. 5raws a line that ends in a rectangular callout. ;pens the 4asic ,hapes toolbar. ;pens the ,ymbol ,hapes toolbar. ;pens the 4loc- )rrows toolbar of shapes. ;pens the 2lowchart toolbar of shapes. ;pens the Callouts toolbar of shapes. ;pens the ,tars toolbar of shapes. )llows editing of the points of a selected polygon. ;pens the 2ontwor- Gallery. Cnserts a picture using the Cnsert "icture dialog. ;pens the 3+5 ,etting toolbar and con(erts the selected shape $if any& to 3+5.

2rom 2ile D3trusion ;n/;ff

#%&

LibreOffice ".# $alc Guide

To display other icons' right+clic- the toolbar' select >isible 7uttons' and then choose the tools you want to appear on the toolbar. con .a(e
"olygon

:e"avior
5raws a line composed of a series of straight line segments. /old down the Shift -ey to position new points at <A degree angles. 5raws a smooth 47Fier cur(e. 5raws an arc. 5raws a filled shape that is defined by the arc of an o(al and two radius lines in the current document. To draw a circle pie' hold down Shift while you drag. 5raws a filled shape that is defined by the arc of a circle and a diameter line in the current document. To draw an ellipse segment' hold down Shift while you drag. Cnserts animated te3t.

Cur(e )rc

Dllipse "ie

Circle ,egment Te3t )nimation

Cf support for )sian languages has been enabled $in ,ools < =ptions < 2anguage +ettings < 2anguages&' two more tools can be added to the 5rawing toolbar% Bertical Te3t and Bertical Callouts. To use a drawing tool% 1& Clic- in the document where you want the drawing to be anchored. You can change the anchor later' if necessary. 2& ,elect the tool from the 5rawing toolbar $2igure 112&. The mouse pointer changes to a cross+hair pointer. 3& 1o(e the cross+hair pointer to the place in the document where you want the graphic to appear and then clic-+and+drag to create the drawing obGect. Helease the mouse button. $,ome tools ha(e other re?uirementsN see the /elp or the Draw Guide for details.& The selected drawing function remains acti(e' so you can draw another obGect of the same type. <& To cancel the selected drawing function' press the )sc -ey or clic- on the +elect icon $the arrow& on the 5rawing toolbar. A& You can now change the properties $fill color' line type and weight' anchoring' and others& of the drawing obGect using either the 5rawing ;bGect "roperties toolbar $2igure 113& or the choices and dialog bo3es reached by right+clic-ing on the drawing obGect.

Set or change properties for drawing objects


To set the properties for a drawing obGect before you draw it% 1& ;n the 5rawing toolbar $2igure 112&' clic- the +elect tool. 2& ;n the 5rawing ;bGect "roperties toolbar $2igure 113&' clic- on the icon for each property and select the (alue you want for that property. 3& 2or more control' or to define new attributes' you can clic- on the Area or 2ine icons on the toolbar to display detailed dialogs.

$hapter % Using Graphics in $alc

#%A

These default properties are applied only to the current document and session. They are is not retained when you close the document' and they do not apply to any other document. The defaults apply to all the drawing obGects e3cept te3t obGects. To change the properties for an e3isting drawing obGect' select the obGect and continue as described abo(e. ;ther tools and methods for modifying and positioning graphics are described in K"ositioning graphicsL below.

1 #ine " )rrow ,tyle ' #ine ,tyle & #ine 0idth

! #ine Color - )rea 7 )rea ,tyle / 2illing ) Hotate

0 Change )nchor 11 4ring to 2ront 11 ,end to 4ac-

1' )lignment

1" To 2oreground / To 4ac-ground

'igure ##3. Drawing ObIect Properties toolbar

3esi5ing a drawing obCect


,elect the obGect' clic- on one of the eight handles around it and drag it to its new siFe. 2or a scaled resiFing' select one of the corner handles and -eep the Shift -ey pressed while dragging the handle. 2or more control of the siFe of the obGect' use the "osition and ,iFe dialog $see K"osition and ,iFeL on page 1A<& to set the width and height independently. Cf the 6eep ratio option is selected' then the two dimensions change so that the proportion is maintained' allowing for a scaled resiFing.

(rouping drawing obCects


To group drawing obGects% 1& ,elect one obGect' then hold down the Shift -ey and select the others you want to include in the group. The bounding bo3 e3pands to include all the selected obGects. 2& 0ith the obGects selected' ho(er the mouse pointer o(er one of the obGects and choose Format < (roup < (roup from the menu bar or right+clic- and choose (roup < (roup from the conte3t menu.

Positioning graphics
Graphics can be positioned in #ibre;ffice Calc to wor- together and build more comple3 features.

Arranging graphics
Graphics in a Calc document are maintained in a similar manner to a dec- of cards. )s you add more images to the document' each image occupies a new layer at the top of the stac-. To arrange graphics' you tell Calc to change the order of layers in the stac-.

#%-

LibreOffice ".# $alc Guide

'igure ##": La2ering effect Calc pro(ides se(eral options to re+arrange the order of images. These options can be accessed from both the "icture toolbar and the picture conte3t menu% 7ring to Front "laces the selected image on top of any other graphics or te3t. 7ring Forward 4rings the selected image one le(el up in the stac- $F+a3is&. 5epending on the number of o(erlapping obGects' you may need to apply this option se(eral times to obtain the desired result. +end 7ackward The opposite of 4ring 2orwardN sends the selected image one le(el down in the obGect stac-. +end to 7ack ,ends the selected graphic to the bottom of the stac-' so that other graphics and te3t co(er it. ,o 7ackground and ,o Foreground )n image or a drawing obGect can be sent to the bac-ground as well. This is not the same as 4ring 2orward and ,end 4ac-ward' which set the order of a number of o(erlapping graphics. This feature pushes a graphic behind the cells' allowing cells to be edited without affecting the graphic. ) graphic in the bac-ground will ha(e ,o Foreground as a menu item' instead of ,o 7ackground. To select a bac-ground graphic $to modify or replace it&' you need to use the a(igator. ;ther methods' such as clic-ing or double+clic-ing' do not wor-.

Anchoring graphics
)nchors tell a graphic where to stay in relation to other items. Anchor to page )nchoring a graphic to the page allows it to be positioned in a specific place on the page. The graphic does not mo(e when cells are added or deleted. This is e?ui(alent to an absolute reference. The graphic will always stay in the position on the page where it is placed.
$hapter % Using Graphics in $alc #%.

Anchor to cell )nchoring a graphic to a cell ensures that the graphic always stays with the content it is originally anchored to. Cf a graphic is anchored to cell 410' and a new row is inserted' the graphic will then be anchored to cell 411. This is e?ui(alent to a relati(e reference. 2or e3ample' in 2igure 11A the picture on the left is anchored (o $ell 42 $QQQ shows where the picture is anchored&. The picture on the right is anchored to the page.

'igure ##%: ,nchoring # Cf two rows are inserted abo(e the pictures' the picture anchored to a cell will shift down two rows and the anchor will change. The picture anchored to the page will not mo(e. This is illustrated in 2igure 11@. ote that the anchor symbol and the QQQ ha(e mo(ed down to cell 4<.

'igure ##&: ,nchoring

Aligning graphics
You can align se(eral graphics relati(e to each other. To do this% 1& ,elect all of the graphics to be aligned $Shift5clic4 on each in turn&. The graphics will be surrounded by an in(isible bounding bo3 with * colored handles. 2& ;n the "icture toolbar' clic- on the Alignment icon and select one of the si3 options. ;r' position the mouse pointer o(er any of the graphics. 0hen the pointer changes shape from an arrow to a hand' right+clic- and choose Alignment' then select from the si3 options. The si3 options include three for aligning the graphics horiFontally $left' center' right& and three for aligning the graphics (ertically $top' center' bottom&.

#&8

LibreOffice ".# $alc Guide

Creating an image map


)n image map defines areas of an image $called hotspots& with hyperlin-s to web addresses' other files on the computer' or parts of the same document. /otspots are the graphic e?ui(alent of te3t hyperlin-s. CtrlRClic-ing on a hotspot causes Calc to open the lin-ed page in the appropriate program $for e3ample' the default browser for an /T1# pageN #ibre;ffice Calc for an ;5, fileN a "52 (iewer for a "52 file&. You can create hotspots of (arious shapes' and include se(eral hotspots in the same image. To use the image map editor% 1& Cn your spreadsheet' select the picture where you want to define the hotspots. 2& Choose #dit < mage4ap from the 1enu bar. The Cmage1ap Dditor $2igure 11E& opens. 3& !se the tools and fields in the dialog $described below& to define the hotspots and lin-s necessary. <& Clic- the Apply icon to apply the settings.

A& 0hen done' clic- the +ave icon to sa(e the image map to a file' then clic- the O in the upper right corner to close the dialog.

'igure ##A: (he dialog to create or edit an image map The main part of the dialog shows the image on which the hotspots are defined. ) hotspot is identified by a line indicating its shape. The toolbar at the top of the dialog contains the following tools%

Apply button% clic- this button to apply the changes. =pen$ +ave$ and +elect icons. !se =pen to load an e3isting image map' +ave to sa(e an
Cmage1ap file. !se the +elect tool to select the different hotspots for further editing.

$hapter % Using Graphics in $alc

#&#

Tools for drawing a hotspot shape% these tools wor- in e3actly the same way as the
corresponding tools in the 5rawing toolbar.

#dit' 4ove' nsert' %elete Points% ad(anced editing tools to manipulate the shape of a
polygon hotspot. ,elect the #dit Points tool to acti(ate the other tools.

*ndo and 3edo% edits the last action. Active icon% toggles the status of a selected hotspot between acti(e and inacti(e. 4acro% associates a macro with the hotspot instead of Gust associating a hyperlin-. Properties% sets the hyperlin- properties and adds the ame attribute to the hyperlin-.

4elow the toolbar' specify for the selected hotspot%

Address: the address pointed to by the hyperlin-. You can also point to an anchor in a
documentN to do this' write the address in this format% file:///<path>/document_name#anchor_name

,e.t% type the te3t that you want to be displayed when the mouse pointer is mo(ed o(er the
hotspot.

Frame: where the target of the hyperlin- will open% pic- among Qblank $opens in a new
browser window&' Qself $opens in the acti(e browser window&' Qtop or Qparent.
Cmage 1ap is not appropriate when the whole picture is a hotspot defining a single lin-% if such is the case' right+clic- the picture and choose ;yperlink in the conte3t menu. The (alue Qself for the target frame will wor- in the (ast maGority of occasions. Ct is therefore not recommended to use the other choices unless absolutely necessary.

?otes

The Cmage 1ap editor has no e3plorer to find and select the target document. Two methods you can use are%

Clic- the =pen icon in the Cmage1ap editor' select the document and ,ip
copy+paste the !rl from the ;pen dialog to the Cmage1ap editor dialog' remembering to add the file name to the pasted path.

;pen' then close' the target document and its address will appear in the
Cmage1ap editor )ddress drop+down listings' from which it can be selected.

#&9

LibreOffice ".# $alc Guide

$hapter & Printing= )*porting= and )!mailing

Muick printing
Clic- the Print File %irectly icon to send the entire document to the default printer defined for your computer.
You can change the action of the Print File %irectly icon' to send the document to the printer defined for the document' instead of the default printer for the computer. Choose ,ools < =ptions < 2oadH+ave < (eneral and select the 2oad printer settings with the document option.

?ote

Controlling printing
2or more control o(er printing' use the "rint dialog $File < Print or $trl5P&.

'igure ##-. (he Print dialog The "rint dialog has four tabs' from which you can choose a range of options' as described in the following sections.
The options selected on the "rint dialog apply to this printing of this document only.

?ote

To specify default printing settings for #ibre;ffice' go to ,ools < =ptions < 2ibre=ffice A Print and ,ools < =ptions < 2ibre=ffice Calc A Print. 2or details' see $hapter #" Setting Up and $ustomi1ing $alc.

#&"

LibreOffice ".# $alc Guide

+electing general printing options


;n the General tab of the "rint dialog $2igure 11*&' you can choose%

The printer $from the printers a(ailable& 0hich sheets and pages to print' the number of copies to print' whether to print in re(erse
page order and whether to collate multiple copies $3ange and copies section& Clic- the Properties button to display a printer+specific dialog where you can choose portrait or landscape orientation' which paper tray to use' and the paper siFe to print on. To print a range of pages' separate the range with a hyphenN for e3ample' enter '/- to print pages 3 to @. To print single pages' use a semi+colon to separate the pagesN for e3ample' enter 7R0R11 to print pages E' :' and 11. You can also print a combination of page ranges and single pages by combining these methodsN for e3ample' enter '/-R)R11R1" to print pages 3' <' A' @' *' 10' and 12. ;n the Options tab of the "rint dialog $2igure 11:&' you can choose to print to a file $instead of to a printer& and to create a single print Gob containing se(eral copies of the document $instead of a separate print Gob for each copy&.

'igure ##.: General print options

Printing multiple pages on a single sheet of paper


You can print multiple pages of a document on one sheet of paper. To do this% 1& Cn the "rint dialog' select the Page La2out tab $2igure 120&.

'igure #98: Printing multiple page per sheet of paper 2& Cn the La2out section' select the number of pages to print per sheet. The pre(iew panel on the left of the "rint dialog shows how the printed document will loo-. 0hen printing more than 2 pages per sheet' you can choose the order in which they are printed across and down the paper. The pictures abo(e and below show the difference.

$hapter & Printing= )*porting= and )!mailing

#&%

3& You can choose to draw a border around each page. <& Cn the 'rom which print choices on the General tab $2igure 121&' select whether to print all pages or only some pages. A& Clic- the =6 button to print.

+electing sheets to print


Cn addition to printing a full document' you can choose to print indi(idual sheets' ranges of sheets' or a selection of cells in a document.

'igure #9#: $hoosing what to print in $alc "rinting an indi(idual sheet% 1& Cn the spreadsheet' clic- on the sheet tab to select the sheet you want to print. 2& Choose File < Print from the menu bar. 3& Cn the 3anges and copies section of the "rint dialog' choose the Selected sheets option. <& Clic- the =6 button. "rinting a range of sheets% 1& Cn the spreadsheet' select the sheets to print. a& ,elect the first sheet. b& /old down the $trl -ey. c& Clic- on the additional sheet tabs. d& Helease the $trl -ey when all re?uired sheets are selected. 2& Choose File < Print from the menu bar. 3& Cn the 3anges and copies section of the "rint dialog' choose the Selected sheets option. <& Clic- the =6 button. "rinting a selection of cells% 1& Cn the document' select the section of cells to print. 2& Choose File < Print from the menu. 3& Cn the 3anges and copies section of the "rint dialog' select the Selected cells option. <& Clic- the =6 button. The Print in reverse page order option can be selected with any of the abo(e options.

Caution

)fter printing' be sure to deselect the e3tra sheets. Cf you -eep them selected' the ne3t time you enter data on one sheet' you enter data on all the selected sheets. This might not be what you want.

#&&

LibreOffice ".# $alc Guide

*sing print ranges


"rint ranges ha(e se(eral uses' including printing only a specific part of the data or printing selected rows or columns on e(ery page.

%efining a print range


To set a user+defined print range' which will replace any e3isting defined print range% 1& /ighlight the range of cells that are to comprise the print range. 2& Choose Format < Print 3anges < %efine from the menu bar. The automatic page brea- lines are then displayed on the screen.
You can chec- the print range by using File < Page Preview in the menu bar' or by clic-ing the Page Preview icon in the ,tandard toolbar. Calc will only display the cells in the print range. You can also use the >iew < Page break preview mode to see the print range without going to the page pre(iew. ,ee KBiewing print rangesL on page 1@*.

,ip

Adding to the print range


)fter defining a print range' you can add more cells to it. This allows multiple' separate areas of the same sheet to be printed' while not printing the whole sheet. )fter you ha(e defined a print range% 1& /ighlight the range of cells to be added to the print range. 2& Choose Format < Print 3anges < Add from the menu bar. This adds the e3tra cells to the print range. The page brea- lines display on the screen around this new addition.

?ote

The additional print range will print as a separate page' e(en if both ranges are on the same sheet.

3emoving print ranges


Ct may become necessary to remo(e a user+defined print range' for e3ample if the whole sheet needs to be printed later' or you no longer wish to print some of the added ranges. Choose Format < Print 3anges < 3emove from the menu bar. This remo(es all defined print ranges on the sheet' e3cept those in named ranges. )fter the print range is remo(ed' the default page brea- lines will appear on the screen. To remo(e only certain print ranges' see KDditing a print rangeL below.

#diting a print range


)t any time' you can directly edit the print range' for e3ample to add to' remo(e' or resiFe part of the print range. Choose Format < Print 3anges < #dit from the menu bar. Cf you ha(e already selected a print range' the Ddit "rint Hanges dialog loo-s something li-e 2igure 122. Cn this e3ample' three rectangles are selected' each separated by a comma. The first is bounded by cell )3 $g)g3& in the top left and cell C: $gCg:& in the bottom right corner. The others being 512%223 and /2<%C2A.

$hapter & Printing= )*porting= and )!mailing

#&A

Cf only a single range is defined' then clic-ing anywhere in the te3t entry bo3 shows the selected print range on the screen' bounded in blue' as shown in 2igure 123. To directly add new cells to the print range% 1& Type a comma in the te3t bo3 as the separator for the ranges. 2& ,elect the cell range using the mouse cursor' or directly type in the cell references using the format of the selection already in the te3t bo3. Hemember to separate the cell references with a colon. To remo(e a print range' select the range in the te3t bo3 and delete it. 1a-e sure the remaining ranges only ha(e a single comma as a separator and that there is not a comma at the end of the se?uence. To resiFe a print range' edit the data in the te3t bo3 for the range.

'igure #99: )dit a print range

'igure #93: Print range mar4ed b2 colored bo*M page brea4 lines visible around the selection

>iewing print ranges


4ecause defined print ranges are formatted with automatic page brea-s' they can be (iewed by using the "age 4rea- "re(iew screen' select >iew < Page 7reak Preview from the menu bar.

#&-

LibreOffice ".# $alc Guide

igure #9": (he defined print range

igure #9%: (he preview screen for the defined print range. The print ranges are outlined by default with a blue border' and contain a centered page number in gray. The nonprinting area has a gray bac-ground. To e3it the "age 4rea- "re(iew screen' select >iew < ?ormal from the menu bar.

Printing rows or columns on every page


Cf a sheet is printed on multiple pages' you can set up certain rows or columns to repeat on each printed page. 2or e3ample' if the top two rows of the sheet as well as column ) need to be printed on all pages' do the following% 1& Choose Format < Print 3anges < #dit from the menu bar. ;n the Ddit "rint Hanges dialog' type the rows in the te3t entry bo3 under 3ows to repeat. 2or e3ample' to repeat rows 1' 2 and 3' type $1:$3. This automatically changes 3ows to repeat from / none / to / user defined /. 2& To repeat columns' type the columns in the te3t entry bo3 under $olumns to repeat. 2or e3ample' to repeat column )' type $A. This automatically changes $olumns to repeat from / none / to / user defined /. 3& Clic- =6.
You can also use the mouse to select the rows or columns to repeat. To do this' clic- the corresponding te3t entry bo3 and select the desired cell range in the sheet. You do not need to select the entire range of the rows to be repeatedN simply select one cell in each row.

?ote

$hapter & Printing= )*porting= and )!mailing

#&.

'igure #9&: Specif2ing repeating rows Hows to repeat and Columns to repeat can also be defined as named ranges using the method described below' but by selecting 3epeat column or 3epeat row' instead of selecting Print range $see 2igure 12E&. These may then be selected from the list bo3 entries in the Ddit "rint Hanges dialog shown in 2igure 12@.

%efining a named print range


Cn addition to highlighting a print range for each print Gob' you can define a range of cells to be used repeatedly. This may be useful if different areas of a large spreadsheet need to be printed for different reports. ,e(eral named print ranges can be defined to meet this need. 1& To define a named print range' highlight the cells you want to define as a print range and select nsert < ?ames < %efine from the menu bar' to open the 5efine ames dialog $2igure 12E&. )lternati(ely the cells can be highlighted after opening the 5efine ames dialog. 2& Type a name for the range in the ?ame bo3. ,he name of the range cannot contain any spaces. 3& Ddit or set the cell selection range for the print range in the 3ange bo3 if needed. <& Dnsure %ocument K(lobalL is selected in the ,cope bo3.

'igure #9A: Define @ames dialog A& Clic- the plus symbol by 3ange =ptions to show more choices. ,elect the Print range option to define the settings as a print range. Clic- the Add button to accept the data and close the dialog.

#A8

LibreOffice ".# $alc Guide

To select this range to print% 1& Choose Format < Print 3anges < #dit from the menu bar $2igure 122&. The pre(iously defined name now appears in the Print range list bo3. 2& ,elect the defined print range and clic- =6. This method can be useful to ?uic-ly change the print range without highlighting a large area of cells e(ery time.

%eleting a named print range


To delete a named print range if it is no longer re?uired% 1& ,elect nsert < ?ames < 4anage from the menu bar or use $trl5'3. 2& Cn the 1anage ames dialog which opens' select the named range you want to delete. 3& Clic- the %elete button. <& Clic- =6 to close the dialog. You can clic- the 3ange =ptions button in the 1anage name is a print range before clic-ing %elete. ames dialog to confirm that the selected

Page breaks
0hile defining a print range can be a powerful tool' it may sometimes be necessary to manually adGust CalcIs printout. To do this' you can use a manual brea4. ) manual brea- helps to ensure that your data prints properly. You can insert a horiFontal page brea- abo(e' or a (ertical page brea- to the left of' the acti(e cell.

nserting a page break


To insert a page brea-% 1& a(igate to the cell where the page brea- will begin. 2& ,elect nsert < Page 7reak from the menu bar. 3& ,elect 3ow 7reak or Column 7reak depending on your need. The brea- is now set.

&ow brea0
,electing 3ow Brea4 creates a page brea- abo(e the selected cell. 2or e3ample' if the acti(e cell is /1A' then the brea- is created between rows 1< and 1A.

Colu(n brea0
,electing $olumn Brea4 creates a page brea- to the left of the selected cell. 2or e3ample' if the acti(e cell is /1A' then the brea- is created between columns G and /.

,ip

To see page brea- lines more easily on screen' you can change their color. Choose ,ools < =ptions < 2ibre=ffice < Appearance and scroll down to the ,preadsheet section.

$hapter & Printing= )*porting= and )!mailing

#A#

%eleting a page break


To remo(e a page brea-% 1& a(igate to a cell that is ne3t to the brea- you want to remo(e. 2& ,elect #dit < %elete 4anual 7reak. 3& ,elect 3ow 7reak or Column 7reak depending on your need. The brea- is remo(ed.

3emoving multiple page breaks


1ultiple manual row and column brea-s can e3ist on the same page. 0hen you want to remo(e all of them' do as follows% 1& ;n the menu bar' select >iew < Page 7reak Preview. 2& Hight+clic- in the document and select %elete All 4anual 7reaks from the conte3t menu. )ll manual brea-s are remo(ed. 3& ,elect >iew < ?ormal to return to the standard document (iew.

Printing options setup in page styles


,e(eral printing options are set in the page style for sheets. These include the page order' details' and scale to be printed' 4ecause these options are set in the page style' different page styles can be set up to ?uic-ly change the print properties of the sheets in the spreadsheet. ,ee $hapter " Using St2les and (emplates in $alc for more about page styles. The Sheet tab of the "age ,tyle dialog $2igure 12*& pro(ides the following options.

'igure #9-. (he Sheet tab of the Page St2le dialog

#A9

LibreOffice ".# $alc Guide

Page =rder You can set the order in which pages print. This is especially useful in a large documentN for e3ample' controlling the print order can sa(e time if you ha(e to collate the document a certain way. 0here a sheet prints to more than one piece of paper' it can be printed either by column' where the first column of pages prints' and then the second column and so on' or by row as shown in the graphic on the top right of the dialog in 2igure 12*. Print You can specify which details to print. These details include%

How and column headers ,heet gridcprints the borders of the cells as a grid Commentscprints the comments defined in your spreadsheet on a separate page' along with the corresponding cell reference ;bGects and graphics Charts 5rawing obGects 2ormulascprints the formulas contained in the cells' instead of the results Tero (aluescprints cells with a Fero (alue

+cale !se the scale features to control the number of pages the data will print on.

3educeH#nlarge printoutcscales the data in the printout either larger or smaller. 2or e3ample' if a sheet would normally print out as four pages $two high and two wide&' a scaling of A0d would print as one page $both width and height are hal(ed&. Fit print rangeKsL on number of pagescdefines e3actly how many pages the printout will ta-e up. This option will only reduce a printoutN it will not enlarge it. To enlarge a printout' the reduce/enlarge option must be used. Fit print rangeKsL to widthHheightcdefines how high and wide the printout will be' in number of pages.

;eaders and footers


/eaders and footers are predefined pieces of te3t that are printed at the top or bottom of a sheet outside of the sheet area. /eaders are set the same way as footers. You can choose to ha(e different content on left and right pages of the same page style. /eaders and footers are assigned to a page style. You can define more than one page style for a spreadsheet and assign different page styles to different sheets. 2or more about page styles' see Chapter <.

+etting a header or a footer


To set a header or footer% 1& a(igate to the sheet for which you want to set the header or footer. ,elect Format < Page from the menu bar. 2& ,elect the /eader $or 2ooter& tab. 3& ,elect the ;eader on option. <& 1a-e other selections according to your re?uirements' using the 4ore button to re(eal other options. Clic- =6.
$hapter & Printing= )*porting= and )!mailing #A3

'igure #9.: +eader dialog You can set the margins' the spacing' and height for the header or footer. To automatically adGust the height of the header or footer' select the AutoFit height bo3. You can also select to ha(e different content for left and right pages. 4argin Changing the siFe of the left or right margin adGusts how far the header or footer is from that side of the page. +pacing ,pacing affects how far abo(e or below the sheet the header or footer will print. ,o' if spacing is set to 1.00U' then there will be 1 inch between the header or footer and the sheet. ;eight /eight affects how big the header or footer will be.

;eader or footer appearance


To change the appearance of the header or footer' clic- the 4ore button in the dialog. This opens the 4order/4ac-ground dialog. 2rom this dialog you can set the bac-ground and border style of the header or footer. ,ee $hapter " Using St2les and (emplates in $alc for more information.

#A"

LibreOffice ".# $alc Guide

'igure #38: +eader 'ooter Border Bac4ground dialog

+etting the contents of the header or footer


The header or footer of a Calc spreadsheet has three columns for te3t. Dach column can be empty or ha(e different contents. To set the contents of the header or footer' clic- the #dit button in the header or footer dialog shown in 2igure 12: to display the dialog shown in 2igure 131.

'igure #3#: )dit contents of header or footer Areas Dach area in the header or footer is independent and can ha(e different information in it. ;eader You can select from se(eral preset choices in the /eader drop+down list' or specify a custom header using the buttons below the area bo3es. $To format a footer' the choices are the same.&
$hapter & Printing= )*porting= and )!mailing #A%

Custom header Clic- in the area $#eft' Center' Hight& that you want to customiFe' then use the buttons to add elements or change te3t attributes. ;pens the Te3t )ttributes dialog. Cnserts the 2ile ame field. Cnserts the ,heet ame field.

Cnserts the current page number. Cnserts the total number of pages. Cnserts the 5ate field. Cnserts the Time field.

#.porting to P%F
Calc can e3port documents to "52 $"ortable 5ocument 2ormat&. This industry+standard file format is ideal for sending the file to someone else to (iew using )dobe Header or other "52 (iewers.

Muick e.port to P%F


Clic- the #.port %irectly as P%F icon to e3port the entire document using your default "52 settings. You are as-ed to enter the file name and location for the "52 file' but you do not get a chance to choose a page range' the image compression' or other options.

Controlling P%F content and @uality


2or more control o(er the content and ?uality of the resulting "52' use File < #.port as P%F from the menu bar. The "52 ;ptions dialog opens. This dialog has fi(e pages $General' Cnitial Biew' !ser Cnterface' #in-s' and ,ecurity&. ,elect the appropriate settings on each page' and then clic#.port. You are then as-ed to enter the location and file name of the "52 to be created. Clic+ave to e3port the file.

General pa%e of 1*F Options dialo%


;n the General page' you can choose which pages to include in the "52' the type of compression to use for images $which affects the ?uality of images in the "52&' and other options. 3ange section All% D3ports the entire document if no print range has been defined or otherwise the print range content.

Pages% To e3port a range of pages' use the format '/- $pages 3 to @&. To e3port single
pages' use the format 7R0R11 $pages E' :' and 11&. You can also e3port a combination of page ranges and single pages' by using a format li-e '/-R)R11R1".

Caution

The numbers used abo(e are related to the page numbers and not the sheet numbers in your spreadsheet. To find these page numbers' select all the sheets in your spreadsheet and clic- the Preview button.

+election% D3ports whate(er content is selected.


#A& LibreOffice ".# $alc Guide

'igure #39: General page of PD' Options dialog mages section 2ossless compression% Cmages are stored without any loss of ?uality. Tends to ma-e large files when used with photographs.

NP#( compression% )llows for (arying degrees of ?uality. ) setting of :0d wor-s well with
photographs $small file siFe' little perceptible loss&.

3educe image resolution% #ower 5"C $dots per inch& images ha(e lower ?uality. /igher
5"C settings greatly increase the siFe of the e3ported file. The end+purpose of the file will dictate the resolution you find acceptable.
D", $Dncapsulated "ost,cript& images with embedded pre(iews are e3ported only as pre(iews. D", images without embedded pre(iews are e3ported as empty placeholders.

?ote

8atermark section +ign with 8atermark: 0hen this option is selected' a transparent o(erlay of the te3t you enter into the 8atermark ,e.t bo3 will appear on each page of the "52 file. (eneral section #mbed =pen%ocument file% This setting enables you to e3port the document as a "52 file containing two file formats% .pdf and .odf. Cn "52 (iewers it beha(es li-e a normal .pdf file and it remains fully editable in #ibre;ffice. ,electing this option inhibits the use of the 3ange options and grays them out.

P%FHA/1a% "52/) is an C,; standard for long+term preser(ation of documents' by


embedding all the information necessary for faithful reproduction $such as fonts& while forbidding other elements $including forms' security' and encryption&. "52 tags are written. Cf you select "52/)+1a' the forbidden elements are grayed+out $not a(ailable&.

,agged P%F% Tagged "52 contains information about the structure of the documentIs
contents. This can help to display the document on de(ices with different screens' and
$hapter & Printing= )*porting= and )!mailing #AA

when using screen reader software. ,ome tags that are e3ported are table of contents' hyperlin-s' and controls. This option can increase file siFes significantly.

Create P%F form / +ubmit format: Choose the format for submitting forms from within the
"52 file. This setting o(errides the controlIs !H# property that you set in the document. There is only one common setting (alid for the whole "52 document% "52 $sends the whole document&' 252 $sends the control contents&' /T1#' and Q1#. 1ost often you will choose the "52 format.

#.port bookmarks: D3ports sheet names in Calc documents as Kboo-mar-sL $a table of


contents list displayed by most "52 readers' including )dobe Header&.

#.port comments% D3ports comments in Calc documents as "52 notes. You may not
want this.

#.port automatically inserted blank pages% ot a(ailable in Calc. #mbed standard fonts: Dnable this option to embed the standard fonts that are installed
on your system and that are used in the document. !se this option if you e3pect to ha(e a better loo-ing or more useful standard font than the font that is a(ailable in the recipients> "52 reader software.

>iew P%F after #.port: 0hen this option is selected' the e3ported "52 document will be
opened in a "52 (iewer.

nitial ;iew pa%e of 1*F Options dialo%


;n the 0nitial Hiew page $2igure 133&' you can choose how the "52 opens by default in a "52 (iewer. The selections are self+e3planatory.

'igure #33: 0nitial Hiew page of PD' Options dialog

+ser nterface pa%e of 1*F Options dialo%


;n the User 0nterface page $2igure 13<&' you can choose more settings to control how a "52 (iewer displays the file. ,ome of these choices are particularly useful when you are creating a "52 to be used as a presentation or a -ios-+type display. 8indow options section 3esi5e window to initial page: Causes the "52 (iewer window to resiFe to fit the first page of the "52.

Center window on screen: Causes the "52 (iewer window to be centered on the
computer screen.
#ALibreOffice ".# $alc Guide

=pen in full screen mode: Causes the "52 (iewer to open full+screen instead of in a
smaller window.

%isplay document title: Causes the "52 (iewer to display the documentIs title in the title
bar.

'igure #3": User 0nterface page of PD' Options dialog *ser interface options section ;ide menubar: Causes the "52 (iewer to hide the menu bar.

;ide toolbar: Causes the "52 (iewer to hide the toolbar. ;ide window controls: Causes the "52 (iewer to hide other window controls.
,ransitions ot a(ailable in Calc. 7ookmarks ;nly one boo-mar- le(el $sheet names& is a(ailable in Calc' regardless of the setting selected here.

Lin0s pa%e of 1*F Options dialo%


;n this page you can choose how lin-s are e3ported to "52.

'igure #3%: Lin4s page of PD' Options dialog #.port bookmarks as named destinations Cf you ha(e defined 0riter boo-mar-s' Cmpress or 5raw slide names' or Calc sheet names' this option e3ports them as Knamed destinationsL to which 0eb pages and "52 documents can lin-. Convert document references to P%F targets Cf you ha(e defined lin-s to other documents with ;pen5ocument e3tensions $for e3ample' .odt' .ods' and .odp&' this option con(erts the e3tensions of file names to .pdf in the e3ported "52 document.
$hapter & Printing= )*porting= and )!mailing #A.

#.port *32s relative to file system Cf you ha(e defined relati(e lin-s in a document' this option e3ports those lin-s to the "52. Cross/document links 5efines the beha(ior of lin-s clic-ed in "52 files.

!ecurit$ pa%e of 1*F Options dialo%


"52 e3port includes options to encrypt the "52 $so it cannot be opened without a password& and apply some digital rights management $5H1& features.

0ith an open password set' the "52 can only be opened with the password. ;nce opened'
there are no restrictions on what the user can do with the document $for e3ample' print' copy' or change it&.

0ith a permissions password set' the "52 can be opened by anyone' but its permissions
can be restricted. ,ee 2igure 13@. )fter you set a password for permissions' the other choices on the ,ecurity page become a(ailable.

0ith both the open password and permission password set' the "52 can only be opened
with the correct password' and its permissions can be restricted.
"ermissions settings are effecti(e only if the userIs "52 (iewer respects the settings.

?ote

2igure 13E shows the dialog displayed when you clic- the +et passwords button on the ,ecurity page of the "52 ;ptions dialog.

'igure #3&: Securit2 page of PD' Options dialog

#-8

LibreOffice ".# $alc Guide

'igure #3A: Setting a password to encr2pt a PD'

#.porting to other formats


#ibre;ffice uses the term Ke3portL for some file operations in(ol(ing a change of file type. ,elect File < +ave As from the menu bar' loo- in the 'ile t2pe list bo3 in the ,a(e )s dialog for a wide range of file types.

#.porting to O;,42
Calc can e3port spreadsheets to Q/T1#. Choose File < #.port from the menu bar. ;n the D3port dialog' specify a file name for the e3ported document' then select the Q/T1# in the 'ile format list and clic- the #.port button.

#/mailing spreadsheets
#ibre;ffice pro(ides se(eral ?uic- and easy ways to send spreadsheets as an e+mail attachment in one of three formats% ;pen5ocument ,preadsheet $#ibre;fficeIs default format&' 1icrosoft D3cel' or "52. To send the current document in ;pen5ocument format% 1& Choose File < +end < %ocument as #/mail from the menu bar. #ibre;ffice opens your default e+mail program with the spreadsheet $Z.ods& document attached. 2& Cn your e+mail program' enter the recipient' subGect' and any te3t you want to add' then send the e+mail. File < +end < #/mail as =pen%ocument +preadsheet has the same result. Cf you choose #/mail as 4icrosoft #.cel' #ibre;ffice first creates a file in D3cel format and then opens your e+mail program with the $Z.3ls& file attached. Cf you choose #/mail as P%F$ #ibre;ffice opens the "52 ;ptions dialog for you to select the parameters you want' as pre(iously described for e3porting to "52' clic-ing +end on the dialog then opens your email program with the "52 file attached.

#/mailing a spreadsheet to several recipients


To e+mail a document to se(eral recipients' you can use the features in your e+mail program or you can use #ibre;ffice 0riterIs mail merge facilities to e3tract email addresses from an address boo-. 2or details' see $hapter #8 Printing= )*porting= and )!mailing in the Getting Started guide.

$hapter & Printing= )*porting= and )!mailing

#-#

%igital signing of documents


To sign a document digitally' you need a personal -ey' also -nown as a certificate. ) personal -ey is stored on your computer as a combination of a pri(ate -ey' which must be -ept secret' and a public -ey' which you add to your documents when you sign them. You can get a certificate from a certification authority' which may be a pri(ate company or a go(ernmental institution. 0hen you apply a digital signature to a document' a chec-sum is computed from the documentIs content plus your personal -ey. The chec-sum and your public -ey are stored together with the document. 0hen someone later opens the document on any computer with a recent (ersion of #ibre;ffice' the program will compute the chec-sum again and compare it with the stored chec-sum. Cf both are the same' the program will signal that you see the original' unchanged document. Cn addition' the program can show you the public -ey information from the certificate. You can compare this -ey with the public -ey that is published on the web site of the certificate authority. 0hene(er someone changes something in the document' this change brea-s the digital signature. ;n 0indows operating systems' the 0indows features of (alidating a signature are used. ;n #inu3 systems' files that are supplied by 1oFilla Thunderbird or 2irefo3 are used. 2or a more detailed description of how to get and manage a certificate' and signature (alidation' see K!sing 5igital ,ignaturesL in the #ibre;ffice /elp. To sign a document% 1& Choose File < %igital +ignatures. 2& Cf the document contains comments' a warning dialog appears stating this and as-ing if you wish to continue. Clic- Ies if you wish to continue' or clic- ?o to e3it and ta-e appropriate action to remo(e them and restart this procedure from step 1. 3& Cf you ha(e not sa(ed the document since the last change' a message bo3 appears. ClicIes to sa(e the file. Cf you clic- ?o' the procedure e3its. <& )fter sa(ing' you see the 5igital ,ignatures dialog. Clic- Add to add a public -ey to the document. A& Cn the ,elect Certificate dialog' select your certificate and clic- =6. @& You see again the 5igital ,ignatures dialog' where you can add more certificates if you want. Clic- =6 to add the public -ey to the sa(ed file. ) signed document shows an icon certificate. in the status bar. You can double+clic- the icon to (iew the

3emoving personal data


You may wish to ensure that personal data' (ersions' notes' hidden information' or recorded changes are remo(ed from files before you send them to other people or create "52s from them. Cn ,ools < =ptions < 2ibre=ffice < +ecurity < =ptions' you can set Calc to remind $warn& you when files contain certain information and remo(e personal information automatically on sa(ing. To remo(e personal and some other data from a file' go to File < Properties. ;n the General tab' unchec- Apply user data and then clic- the 3eset button. This remo(es any names in the created and modified fields' deletes the modification and printing dates' and resets the editing time to Fero' the creation date to the current date and time' and the (ersion number to 1. To remo(e (ersion information' either go to File < >ersions' select the (ersions from the list and clic- %elete' or use +ave As and sa(e the file with a different name.

#-9

LibreOffice ".# $alc Guide

$hapter A Using 'ormulas and 'unctions

ntroduction
Cn pre(ious chapters' we ha(e been entering one of two basic types of data into each cell% numbers and te3t. /owe(er' we will not always -now what the contents should be. ;ften the contents of one cell depends on the contents of other cells. To handle this situation' we use a third type of data% the formula. 2ormulas are e?uations using numbers and (ariables to get a result. Cn a spreadsheet' the (ariables are cell locations that hold the data needed for the e?uation to be completed. ) function is a predefined calculation entered in a cell to help you analyFe or manipulate data in a spreadsheet. )ll you ha(e to do is add the arguments' and the calculation is automatically made for you. 2unctions help you create the formulas needed to get the results that you are loo-ing for.

+etting up a spreadsheet
Cf you are setting up more than a simple one+wor-sheet system in Calc' it is worth planning ahead a little. )(oid the following traps%

Typing fi3ed (alues into formulas ot including notes and comments describing what the system does' including what input
is re?uired and where the formulas come from $if not created from scratch&

ot incorporating a system of chec-ing to (erify that the formulas do what is intended

,he trap of fi.ed values


1any users set up long and comple3 formulas with fi3ed (alues typed directly into the formula. 2or e3ample' con(ersion from one currency to another re?uires -nowledge of the current con(ersion rate. Cf you input a formula in cell C1 of =0.75*B1 $for e3ample to calculate the (alue in Duros of the !,5 dollar amount in cell 41&' you will ha(e to edit the formula when the e3change rate changes from 0.EA to some other (alue. Ct is much easier to set up an input cell with the e3change rate and reference that cell in any formula needing the e3change rate. <hat!if type calculations are also simplified% what if the e3change rate (aries from 0.EA to 0.E0 or 0.*0= o formula editing is needed and it is clear what rate is used in the calculations. 4rea-ing comple3 formulas down into more manageable parts' described below' also helps to minimiFe errors and aid troubleshooting.

2ack of documentation
#ac- of documentation is a (ery common failing. 1any users prepare a simple wor-sheet which then de(elops into something much more complicated o(er time. 0ithout documentation' the original purpose and methodology is often unclear and difficult to decipher. Cn this case it is usually easier to start again from the beginning' wasting the wor- done pre(iously. Cf you insert comments in cells' and use labels and headings' a spreadsheet can later be modified by you or others and much time and effort will be sa(ed.

#rror/checking formulas
)dding up columns of data or selections of cells from a wor-sheet often results in errors due to omitting cells' wrongly specifying a range' or double+counting cells. Ct is useful to institute chec-s in your spreadsheets. 2or e3ample' set up a spreadsheet to calculate columns of figures' and use ,!1 to calculate the indi(idual column totals. You can chec- the result by including $in a non+ printing column& a set of row totals and adding these together. The two figurescrow total and column totalcmust agree. Cf they do not' you ha(e an error somewhere.

#-"

LibreOffice ".# $alc Guide

'igure #3-: )rror chec4ing of formulas You can e(en set up a formula to calculate the difference between the two totals and report an error in case a non+Fero result is returned $see 2igure 13*&.

Creating formulas
You can enter formulas in two ways' either by using the 2unction 0iFard' or by typing directly into the cell or into the input line. ) formula must begin with an Y symbol' so when typing in directly' you need to start a formula with one of the following symbols% Y' R or X. Calc automatically adds the Y symbol for the formula' when starting with the R or P character. ,tarting with anything else causes the formula to be treated as if it were te3t.

=perators in formulas
Dach cell on the wor-sheet can be used as a data holder or a place for data calculations. Dntering data is accomplished simply by typing in the cell and mo(ing to the ne3t cell or pressing )nter. 0ith formulas' the e?uals sign indicates that the cell will be used for a calculation. ) mathematical calculation li-e 1A R <@ can be accomplished as shown in 2igure 13:. 0hile the calculation on the left was accomplished in only one cell' the real power is shown on the right where the data is placed in cells and the calculation is performed using references bac- to the cells. Cn this case' cells 43 and 4< were the data holders' with 4A the cell where the calculation was performed. otice that the formula was shown as Y43R4<. The plus sign indicates that the contents of cells 43 and 4< are to be added together and then ha(e the result in the cell holding the formula. )ll formulas build upon this concept. ;ther ways of using formulas are shown in Table *. These cell references allow formulas to use data from anywhere in the wor-sheet being wor-ed on or from any other wor-sheet in the wor-boo- that is opened. Cf the data needed was in different wor-sheets' they would be referenced by referring to the name of the wor-sheet' for e3ample =SUM Sheet!."#!$Sheet%.&##'.

$hapter A Using 'ormulas and 'unctions

#-%

?ote

To enter the Y symbol for a purpose other than creating a formula as described in this chapter' type an apostrophe or single ?uotation mar- before the Y. 2or e3ample' in the entry JN means different things to different people' Calc treats e(erything after the single ?uotation mar-cincluding the Y signcas te3t.

!i(ple Calculation in 1 Cell

Calculation b$ &eference

'igure #3.: , simple calculation (able -: $ommon wa2s to use formulas For(ula
Y)1R10 Y)1Z1@d Y)1Z)2 YH;! 5$)1'1& YD22DCTCBD$Ad'12& Y4*+,!1$410%41<& Y,!1$4*',!1$410%41<&& Y,!1$41%410<*AE@&

*escription
5isplays the contents of cell )1 plus 10. 5isplays 1@d of the contents of )1. 5isplays the result of multiplying the contents of )1 and )2. 5isplays the contents of cell )1 rounded to one decimal place. Calculates the effecti(e interest for Ad annual nominal interest with 12 payments a year. Calculates 4* minus the sum of the cells 410 to 41<. Calculates the sum of cells 410 to 41< and adds the (alue to 4*. ,ums all numbers in column 4.

#-&

LibreOffice ".# $alc Guide

For(ula
Y)BDH)GD$4lood,ugar& YC2$C31e1<0' U/CG/U' U;6U&

*escription
5isplays the a(erage of a named range defined under the name 4lood,ugar. 5isplays the results of a conditional analysis of data from two sources. Cf the contents of C31 is greater than 1<0' then /CG/ is displayed' otherwise ;6 is displayed.

?ote

!sers of #otus 1+2+3' Juattro "ro and other spreadsheet software may be familiar with formulas that begin with R' +' Y' $' 9' .' g' or h. ) mathematical formula would loo- li-e R52RC2 or R2Z3. 2unctions begin with the 9 symbol such as 9,!1$52..5E&' 9C;,$95DGT;H)5$30&& and 9CHH$G!D,,'C),/2#;0,&. Hanges are identified such as )1..53.

2unctions can be identified in Table * by a word' for e3ample H;! 5' followed by parentheses enclosing references or numbers. Ct is also possible to establish ranges for inclusion by naming them using nsert < ?ames' for e3ample 4lood,ugar representing a range such as 43%410. #ogical functions can also be performed as represented by the C2 statement which results in a conditional response based upon the data in the identified cell' for e3ample =() &!>=*+,-ositive,+,.e/ative,' ) (alue of 3 in cell )2 would return the result Positive' a (alue of X: the result @egative.

=perator types
You can use the following operator types in #ibre;ffice Calc% arithmetic' comparati(e' te3t' and reference.

)rit"(etic operators
The addition' subtraction' multiplication and di(ision operators return numerical results. The egation and "ercent operators identify a characteristic of the number found in the cell' for e3ample +3E. The e3ample for D3ponentiation illustrates how to enter a number that is being multiplied by itself a certain number of times' for e3ample 23 Y 2Z2Z2. (able .: ,rithmetical operators Operator
R $"lus& X $1inus& X $1inus& Z $asteris-& / $,lash& d $"ercent& i $Caret&

.a(e
)ddition ,ubtraction egation 1ultiplication 5i(ision "ercent D3ponentiation

Exa(ple
Y1R1 Y2X1 XA Y2Z2 Y10/A 1Ad 2i3

$hapter A Using 'ormulas and 'unctions

#-A

Co(parative operators
Comparati(e operators are found in formulas that use the C2 function and return either a true or false answerN for e3ample' =() "0>1#!+ #!2+ *' which' loosely translated' means if the contents of cell 4@ are greater than the contents of cell G12' then return the number 12E' otherwise return the number 0. ) direct answer of TH!D or 2)#,D can be obtained by entering a formula such as ="0>"#!. Cf the numbers found in the referenced cells are accurately represented' the answer TH!D is returned' otherwise 2)#,D is returned. (able #8: $omparative operators Operator
Y e f eY fY fe

.a(e
D?ual Greater than #ess than Greater than or e?ual to #ess than or e?ual to Cne?uality

Exa(ple
)1Y41 )1e41 )1f41 )1eY41 )1fY41 )1fe41

Cf cell )1 contains the numerical (alue < and cell 41 the numerical (alue A' the abo(e e3amples would yield results of 2)#,D' 2)#,D' TH!D' 2)#,D' TH!D' and TH!D.

/ext operators
Ct is common for users to place te3t in spreadsheets. To pro(ide for (ariability in what and how this type of data is displayed' te3t can be Goined together in pieces coming from different places on the spreadsheet. 2igure 1<0 shows an e3ample.

'igure #"8: (e*t concatenation Cn this e3ample' specific pieces of the te3t were found in three different cells. To Goin these segments together' the formula also adds re?uired spaces and punctuation enclosed within ?uotation mar-s' resulting in a formula of ="! 3 , , 3 4! 3 ,+ , 3 5!. The result is the concatenation into a date formatted in a particular se?uence. Calc has a C; C)TD )TD function which performs the same operation.

#--

LibreOffice ".# $alc Guide

Ta-ing this e3ample further' if the result cell is defined as a name' then te3t concatenation is performed using this defined name. This process is demonstrated in 2igures 1<1' 1<2' and 1<3 where the cell with the date is named K0iFard5ayL and subse?uently used in a formula in another cell.

'igure #"#: Defining a name for a range of cells

$hapter A Using 'ormulas and 'unctions

#-.

'igure #"9: @aming a cell or range of cells for inclusion in a formula The defined name <i1ardDa2 in 52.

Te3t entered into )<' the formula into )@.

The result displayed in )@.

'igure #"3: Using @ames in a formula

&eference operators
)n indi(idual cell is identified by the column identifier $letter& located along the top of the columns and a row identifier $number& found along the left+hand side of the spreadsheet. ;n spreadsheets read from left to right' the reference for the upper left cell is )1. Thus in its simplest form a reference refers to a single cell' but references can also refer to a rectangle or cuboid range or a reference in a list of references. To build such references you need reference operators.
#.8 LibreOffice ".# $alc Guide

3ange operator The range operator is written as a colon. )n e3pression using the range operator has the following synta3%
reference upper left : reference lo6er ri/ht The range operator builds a reference to the smallest range including both the cells referenced with the left reference and the cells referenced with the right reference.

'igure #"": 3eference Operator for a range Cn the upper left corner of 2igure 1<< the reference )1%512 is shown' corresponding to the cells included in the drag operation with the mouse to highlight the range. #.amples )2%4< Heference to a rectangle range with @ cells' 2 column width j 3 row height. 0hen you clic- on the reference in the formula in the input line' a border indicates the rectangle. Heference to a rectangle range with cell )2 top left and cell C: bottom right. ,o the range contains 2< cells' 3 column width j * row height. This method of addressing e3tends the initial range from )2%4< to )2%C:. Heference to a cuboid range with 2< cells' < column width j 2 row height j 3 sheets depth.

$)2%4<&%C:

,heet1.)3%,heet3.5<

0hen you enter 4<%)2 or )<%42 directly' then Calc will turn it to )2%4<. ,o the left top cell of the range is left of the colon and the bottom right cell is right of the colon. 4ut if you name the cell 4< for e3ample with _start and )2 with _end' you can use _start:_end without any error. Calc can not reference a whole column of unspecified length using )%) or a whole row using 1%1 which you might be familiar with in other spreadsheet programs.

3eference concatenation operator The concatenation operator is written as a tilde. )n e3pression using the concatenation operator has the following synta3%
reference left 7 reference ri/ht The result of such an e3pression is a reference list' which is an ordered list of references. ,ome functions can ta-e a reference list as an argument' ,!1' 1)Q or C 5DQ for e3ample.
$hapter A Using 'ormulas and 'unctions #.#

The reference concatenation is sometimes called >union>. 4ut it is not the union of the two sets >reference left> and >reference right> as normally understood in set theory. C;! T$)1%C3k42%52& returns 12 $Y:R3&' but it has only 10 cells when considered as the union of the two sets of cells. otice that ,!1$)1%C3'42%52& is different from ,!1$)1%C3k42%52& although they gi(e the same result. The first is a function call with 2 parameters' each of them is reference to a range. The second is a function call with 1 parameter' which is a reference list.

ntersection operator The intersection operator is written as an e3clamation mar-. )n e3pression using the intersection operator has the following synta3%
reference left 8 reference ri/ht Cf the references refer to single ranges' the result is a reference to a single range' containing all cells' which are both in the left reference and in the right reference. Cf the references are reference lists' then each list item from the left is intersected with each one from the right and these results are concatenated to a reference list. The order is to first intersect the first item from the left with all items from the right' then intersect the second item from the left with all items from the right' and so on. D3amples &!:"9 8 "%:50 This results in a reference to the range 43%4<' because these cells are inside )2%4< and inside 43%5<. &!:"97"#:4!' 8 "!:4074#:5%' 2irst the intersections )2%4<l42%C@' )2%4<lC1%53' 41%C2l42%C@ and 41%C2lC1%53 are calculated. This results in 42%4<' empty' 42%C2' and C1%C2. Then these results are concatenated' dropping empty parts. ,o the final result is the reference list 42%4< k 42%C2 k C1%C2. You can use the intersection operator to refer a cell in a cross tabulation in an understandable way. Cf you ha(e columns labeled >Temperature> and >"recipitation> and the rows labeled >.anuary>' >2ebruary>' >1arch>' and so on' then the following e3pression :)e;ruar<: 8 :=emperature: will reference to the cell containing the temperature in 2ebruary. The intersection operator $l& has a higher precedence than the concatenation operator $k&' but do not rely on precedence.

,ip

)lways put in parentheses the part that is to be calculated first.

3elative and absolute references


Heferences are the way that we refer to the location of a particular cell in Calc and can be either relati(e $to the current cell& or absolute $a fi3ed amount&.

&elative referencin%
)n e3ample of a relati(e reference will illustrate the difference between a relati(e reference and absolute reference using the spreadsheet from 2igure 1<A. 1& Type the numbers < and 11 into cells C3 and C< respecti(ely of that spreadsheet.

#.9

LibreOffice ".# $alc Guide

2& Copy the formula in cell 4A $Y43R4<& to cell CA. You can do this by using a simple copy and paste or clic- and drag 4A to CA as shown below. The formula in 4A calculates the sum of (alues in the two cells 43 and 4<. 3& Clic- in cell CA. The formula bar shows YC3RC< rather than Y43R4< and the (alue in CA is 1A' the sum of < and 11 which are the (alues in C3 and C<. Cn cell 4A the references to cells 43 and 4< are relati(e references. This means that Calc interprets the formula in 4A' applies it to the cells in the 4 column' and puts the result in the cell holding the formula. 0hen you copied the formula to another cell' the same procedure was used to calculate the (alue to put in that cell. This time the formula in cell CA referred to cells C3 and C<.

'igure #"%: 3elative references You can thin- of a relati(e address as a pair of offsets to the current cell. Cell 41 is 1 column to the left of Cell CA and < rows abo(e. The address could be written as HV+1WCV+<W. Cn fact earlier spreadsheets allowed this notation method to be used in formulas. 0hene(er you copy this formula from cell 4A to another cell the result will always be the sum of the two numbers ta-en from the two cells one and two rows abo(e the cell containing the formula. Helati(e addressing is the default method of referring to addresses in Calc.

)bsolute referencin%
You may want to multiply a column of numbers by a fi3ed amount. ) column of figures might show amounts in !, 5ollars. To con(ert these amounts to Duros it is necessary to multiply each dollar amount by the e3change rate. g!,10.00 would be multiplied by 0.EA to con(ert to Duros' in this case DurE.A0. The following e3ample shows how to input an e3change rate and use that rate to con(ert amounts in a column form !,5 to Duros. 1& Cnput the e3change rate Dur%!,5 $0.EA& in cell 51. Dnter amounts $in !,5& into cells 52' 53 and 5<' for e3ample 10' 20' and 30. 2& Cn cell D2 type the formula Y52Z51. The result is E.A' correctly shown. 3& Copy the formula in cell D2 to cell D3. The result is 200' clearly wrongl Calc has copied the formula using relati(e addressing% the formula in D3 is Y53Z52 and not what we want' which is Y53Z51. <& Cn cell D2 edit the formula to be Y52Zg5g1. Copy it to cells D3 and D<. The results are now 1A and 22.A which are correct. The g signs before the 5 and the 1 con(ert the reference to cell 51 from relati(e to absolute or fi3ed. Cf the formula is copied to another cell the second part will always show g5g1. The

$hapter A Using 'ormulas and 'unctions

#.3

interpretation of this formula is Kta-e the (alue in the cell one column to the left in the same row and multiply it by the (alue in cell 51L.

Dntering the con(ersion formula into D2' correct result' then copying it to D3.

D3 result is clearly wrong' change the formula in D2 to read absolute reference.

)pplying the correct formula from D2 to D3 to get the correct answer.

'igure #"&: ,bsolute references Cell references can be shown in four ways. &eference
51 g5g1 g51 5g1

Explanation
Helati(e' from cell D3 it is the cell one column to the left and two rows abo(e )bsolute' from cell D3 it is the cell 51 "artially absolute' from cell D3 it is the cell in column 5 and two rows abo(e "artially absolute' from cell D3 it is the cell one column to the left and in row 1

,ip

To change references in formulas' highlight the cell and press Shift!'" to cycle through the four types of references. This method is of limited (alue in more complicated formulasN it is usually ?uic-er to edit the formula by hand.

6nowledge of the use of relati(e and absolute references is essential if you want to copy and paste formulas and to lin- spreadsheets.

#."

LibreOffice ".# $alc Guide

=rder of calculation
Order of calculation refers to the se?uence in which numerical operations are performed. 5i(ision and multiplication are performed before addition or subtraction. There is a common tendency to e3pect calculations to be made from left to right as the e?uation would be read in Dnglish. Calc e(aluates the entire formula' then based upon programming precedence brea-s the formula down e3ecuting multiplication and di(ision operations before other operations. Therefore' when creating formulas you should test your formula to ma-e sure that the correct result is being obtained. 2ollowing is an e3ample of the order of calculation in operation. (able ## E Order of $alculation Left /o &i%"t Calculation
1R3Z2R3 Y 11 1R3 Y <' then < Q 2 Y *' then *R3 Y 11 )nother possible intention could be% 1R3Z2R3 Y 20 1R3 Y <' then 2R3 Y A' then < Q AY20

Ordered Calculation
Y1R3Z2R3 result 10 3Z2 Y @' then 1R@R3 Y 10 The program resol(es the multiplication of 3 Q 2 before dealing with the numbers being added.

Cf you intend for the result to be either of the two possible solutions on the left' the way to achie(e these results would be to order the formula as%

$$1R3& Z 2&R3 Y 11 ?ote

$1R3& Z $2R3& Y 20

!se parentheses to group operations in the order you intendN for e3ample' ="9$1#!*49/M#! might become = "9$1#!'*49'/M#!.

Calculations linking sheets


)nother powerful feature of Calc is the ability to lin- data through se(eral wor-sheets. The naming of wor-sheets can be helpful to identify where specific data may be found. ) name such as "ayroll or 4oise ,ales is much more meaningful than ,heet1. The function named ,/DDT$& returns the sheet number $position& in the collection of wor-sheets. There may be se(eral wor-sheets in each boo- and they may be numbered from the left% ,heet1' ,heet2' and so forth. Cf you drag the wor-sheets around to different locations among the tabs' the function returns the number referring to the current position of this wor-sheet. Cn a new instance of Calc' the default is a single wor-sheet. 2or e3ample' if the formula Y,/DDT$& is put into )1 on ,heet 1 it returns the (alue 1. Cf you drag ,heet 1 to be positioned between sheets 2 and 3 then the (alue changes to 2' it is now the second sheet in the order. )n e3ample of calculations obtaining data from other wor- can be seen in a business setting where a business combines re(enues and costs of each of its branch operations into a single combined wor-sheet.

$hapter A Using 'ormulas and 'unctions

#.%

,heet containing data for 4ranch 1.

,heet containing data for 4ranch 2.

#.&

LibreOffice ".# $alc Guide

,heet containing data for 4ranch 3.

,heet containing combined data for all branches.

'igure #"A: $ombining data from several sheets into a single sheet The spreadsheets ha(e been set up with identical structures. The easiest way to do this is to open a new spreadsheet' set up the first 4ranch spreadsheet' input data' format cells' and prepare the formulas for the (arious sums of rows and columns. 1& ;n the wor-sheet tab' right+clic- and select 3ename +heet. Type Branch1. Hight+clic- on the tab again and select 4oveHCopy +heet. 2& Cn the 1o(e/Copy ,heet dialog' select the Copy option $automatically selected if there is only one sheet in the spreadsheet& and select !move to end position! in the 0nsert before window. Change the entry in ?ew name to 4ranch2. Clic- =6. Hepeat to produce the 4ranch3 and Combined wor-sheets.

$hapter A Using 'ormulas and 'unctions

#.A

'igure #"-: $op2ing a wor4sheet 3& Dnter the data for 4ranch 2 and 4ranch 3 into the respecti(e sheets. Dach sheet stands alone and reports the results for the indi(idual branches. <& Cn the Combined wor-sheet' clic- on cell 6E. Type Y' clic- on the tab 4ranch1' clic- on cell 6E' press R' repeat for sheets 4ranch2 and 4ranch3 and press Dnter. You now ha(e a formula in cell 6E which adds the re(enue from Greenery ,ales for the 3 4ranches.

'igure #".: $ombined wor4sheet showing lin4ing between branch sheets

#.-

LibreOffice ".# $alc Guide

A& Copy the formula' highlight the range 6E% 1E' clic- #dit < Paste +pecial' unchec- the Paste all and Formats bo3es in the ,election area of the dialog bo3 and clic- =6. You will see the following message%

'igure #%8: Lin4ing sheets: pasting a formula to a cell range @& Clic- Ies. You ha(e now copied the formulas into each cell while maintaining the format you set up in the original wor-sheet. ;f course' in this e3ample you would ha(e to tidy the wor-sheet up by remo(ing the Feros in the non+formatted rows.

'igure #%#: Lin4ing Sheets: $op2 Paste Special from DA:@#A


#ibre;ffice default is to paste all the attributes of the original cell$s& + formats' notes' obGects' te3t strings and numbers.

?ote

The 2unction 0iFard can also be used to accomplish the lin-ing. !se of this 0iFard is described in detail in the section on 2unctions.

*nderstanding functions
Calc includes o(er 3A0 functions to help you analyFe and reference data. 1any of these functions are for use with numbers' but many others are used with dates and times' or e(en te3t. ) function may be as simple as adding two numbers together' or finding the a(erage of a list of numbers. )lternati(ely' it may be as comple3 as calculating the standard de(iation of a sample' or a hyperbolic tangent of a number. Typically' the name of a function is an abbre(iated description of what the function does. 2or instance' the 2B function gi(es the future (alue of an in(estment' while 4C 2/DQ con(erts a binary
$hapter A Using 'ormulas and 'unctions #..

number to a he3adecimal number. 4y tradition' functions are entered entirely in upper case letters' although Calc will read them correctly if they are in lower or mi3ed case' too. ) few basic functions are somewhat similar to operators. D3amples% R Z This operator adds two numbers together for a result. ,!1$& on the other hand adds groups of contiguous ranges of numbers together. This operator multiplies two numbers together for a result. "H;5!CT$& does the same for multiplying that ,!1$& does for adding.

Dach function has a number of arguments used in the calculations. These arguments may or may not ha(e their own name. Your tas- is to enter the arguments needed to run the function. Cn some cases' the arguments ha(e predefined choices' and you may need to refer to the online help or )ppendi3 4 $5escription of 2unctions& in this boo- to understand them. 1ore often' howe(er' an argument is a (alue that you enter manually' or one already entered in a cell or range of cells on the spreadsheet. Cn Calc' you can enter (alues from other cells by typing in their name or range' or cunli-e the case in some spreadsheetscby selecting cells with the mouse. Cf the (alues in the cells change' then the result of the function is automatically updated. 2or compatibility' functions and their arguments in Calc ha(e almost identical names to their counterparts in 1icrosoft D3cel. /owe(er' both D3cel and Calc ha(e functions that the other lac-s. ;ccasionally' functions with the same names in Calc and D3cel ha(e different arguments' or slightly different names for the same argumentcneither of which can be imported to the other. /owe(er' the maGority of functions can be used in both Calc and D3cel without any change. ) comparison list may be found on the #ibre;ffice wi-i' lin-ed from the 5ocumentation/"ublications page.

*nderstanding the structure of functions


)ll functions ha(e a similar structure. Cf you use the right tool for entering a function' you can escape learning this structure' but it is still worth -nowing for troubleshooting. To gi(e a typical e3ample' the structure of a function to find cells that match entered search criteria is% = 54>U.= 5ata;ase+5ata;ase field+Search_criteria' ,ince a function cannot e3ist on its own' it must always be part of a formula. Conse?uently' e(en if the function represents the entire formula' there must be an Y sign at the start of the formula. Hegardless of where in the formula a function is' the function will start with its name' such as 5C;! T in the e3ample abo(e. )fter the name of the function comes its arguments. )ll arguments are re?uired' unless specifically listed as optional. )rguments are added within the parentheses and are separated by commas' with no space between the arguments and the commas. 1any arguments are numbers. ) Calc function can ta-e up to thirty numbers as an argument. That may not sound li-e much at first. /owe(er' when you realiFe that the number can be not only a number or a single cell' but also an array or range of cells that contain se(eral or e(en hundreds of cells' then the apparent limitation (anishes. 5epending on the nature of the function' arguments may be entered as follows% Ute3t dataU : U:U )1 The ?uotes indicate te3t or string data is being entered. The number nine is being entered as a number. The number nine is being entered as te3t The address for whate(er is in Cell )1 is being entered

988

LibreOffice ".# $alc Guide

?ested functions
2unctions can also be used as arguments within other functions. These are called nested functions. =SUM !+-?>5U4= @+2'' To get an idea of what nested functions can do' imagine that you are designing a self+directed learning module. 5uring the module' students do three ?uiFFes' and enter the results in cells )1' )2' and )3. Cn )<' you can create a nested formula that begins by a(eraging the results of the ?uiFFes with the formula =&AB?&1B &#:&%'. The formula then uses the () function to gi(e the student feedbac- that depends upon the a(erage grade on the ?uiFFes. The entire formula would read% =() &AB?&1B &#:&%' >C@+ ,4on/ratulations8 Dou are read< to advance to the next module,+ ,)ailed. -lease revie6 the material a/ain. (f necessar<+ contact <our instructor for help,' 5epending on the a(erage' the student would recei(e the message for either congratulations or failure. otice that the nested formula for the a(erage does not re?uire its own e?ual sign. The one at the start of the e?uation is enough for both formulas. Cf you are new to spreadsheets' the best way to thin- of functions is as a scripting language. 0e>(e used simple e3amples to e3plain the concept more clearly' but' through nesting of functions' a Calc formula can ?uic-ly become comple3.

?ote

Calc -eeps the synta3 of a formula displayed in a tool tip ne3t to the cell as a handy memory aid as you type.

) more reliable method is to use the 'unction List $2igure 1A2&. )(ailable from the nsert menu' the 2unction #ist automatically doc-s as a pane on the right side of the Calc editing window. Cf you wish' you can $ontrol5double!clic4 on a blan- space at the top of the pane to undoc- this pane and ma-e it a floating window. The 2unction #ist includes a brief description of each function and its argumentsN highlight the function and loo- at the bottom of the pane to see the description. Cf necessary' ho(er the cursor o(er the di(ision between the list and the descriptionN when the cursor becomes a two+headed arrow' drag it upwards to increase the space for the description. 5ouble+clic- on a functionIs name to add it to the current cell' together with placeholders for each of the functionIs arguments. Clic-ing on the bar where the A dots and arrows are shown $shown by the ellipse in 2igure 1A2& will hide the list on the right hand side of the screen. Clic-ing this area again will show the list' ma-ing it easy to -eep the list a(ailable for easy reference. !sing the 2unction #ist is almost as fast as manual entry' and has the ad(antage of not re?uiring that you memoriFe a formula that you want to use. Cn theory' it should also be less error+prone. Cn practice' though' some users may fumble when replacing the placeholders with (alues. )nother feature is the ability to display the last formulas used.

$hapter A Using 'ormulas and 'unctions

98#

'igure #%9: 'unction List doc4ed to right side of $alc window

Function 8i5ard
The most commonly used input method is the 'unction <i1ard $2igure 1A<&. To open the 2unction 0iFard' choose nsert < Function' or clic- the f* button on the 2ormula bar' or press $trl5'9. ;nce open' the 2unction 0iFard pro(ides the same help features as the 2unction #ist' but adds fields in which you can see the result of a completed function' as well as the result of any larger formula of which it is part. ,elect a category of functions to shorten the list' then scroll down through the named functions and select the re?uired one by double+clic-ing on it. 0hen you select a function its description appears on the right+hand side of the dialog. The 0iFard now displays an area to the right where you can enter data manually in te3t bo3es or clic- the ,hrin- button to shrin- the wiFard so you can select cells from the wor-sheet.

'igure #%3: 'unction <i1ard after shrin4ing

989

LibreOffice ".# $alc Guide

'igure #%": 'unctions page of 'unction <i1ard. To select cells' either clic- directly upon the cell or hold down the left mouse button and drag to select the re?uired area. 0hen the area has been selected' clic- the +hrink button again to return to the wiFard. Cf multiple arguments are needed select the ne3t te3t bo3 below the first and repeat the selection process for the ne3t cell or range of cells. Hepeat this process as often as re?uired. The 0iFard will accept up to 30 ranges or arguments in the ,!1 function. Clic- =6 to accept the function and add it to the cell and get the result.
Cf you select a function by double+clic-ing it in the list' and then change your mind and select a different one by double+clic-ing again' then the second choice formula is added into the first choice formula in the 2ormula te3t bo3. You must clear the formula bo3 and then double+clic- the function to add it to the bo3. This additi(e facility allows you to create comple3 formulas by building them up in the 2ormula bo3.

Caution

You can also select the Structure tab $2igure 1AA& to see a tree (iew of the parts of the formula. The main ad(antage o(er the 2unction #ist is that each argument is entered in its own field' ma-ing it easier to manage. The price of this reliability is slower input' but this is often a small price to pay' since precision is generally more important than speed when creating a spreadsheet.
"ressing the dialog ;elp button after selecting certain functions with either a single+ or double+clic- will cause #ibre;ffice to crash. This early bug may be corrected for later releases in the Bersion <.1. series. )ffected functions are% )BDH)GDC2N )BDH)GDC2,N ,!1C2,N C;! TC2,N C2DHH;HN C2 )N Q;HN !14DHB)#!DN ,6D0"

Caution

$hapter A Using 'ormulas and 'unctions

983

'igure #%%: Structure page of 'unction <i1ard 2unctions can be entered into the Cnput line. )fter you enter a function on the Cnput line' press the )nter -ey or clic- the Accept button on the 2ormula toolbar to add the function to the cell and get its result.

1 " '

ame 4o3 showing list of common functions 2unction 0iFard & )ccept Cancel ! Cnput #ine

'igure #%&: (he 'unction toolbar Cf you see the formula in the cell instead of the result' then 'ormulas are selected for display in ,ools < =ptions < 2ibre=ffice Calc < >iew < %isplay. 5eselect 'ormulas' and the result will display. /owe(er' you can still see the formula in the Cnput line.

+trategies for creating formulas and functions


2ormulas that do more than a simple calculation or summation of rows or columns of (alues usually ta-e a number of arguments. 2or e3ample' the classic e?uation of motion s = s*$ vt E Fat! calculates the position of a body -nowing its original position' its final (elocity' its acceleration' and the time ta-en to mo(e from the initial state to the final state. 2or ease of presentation' it is good practice to set up a spreadsheet in a manner similar to that shown in 2igure 1AE. Cn this e3ample' the indi(idual (ariables are input into cells on the sheet and no editing of the formula $in cell 4:& is re?uired.

98"

LibreOffice ".# $alc Guide

'igure #%A: Setting up a formula with arguments You can ta-e se(eral broad approaches when creating a formula. Cn deciding which approach to ta-e' consider how many other people will need to use the wor-sheets' the life of the wor-sheets' and the (ariations that could be encountered in use of the formula. Cf people other than yourself will use the spreadsheet' ma-e sure that it is easy to see what input is re?uired and where. D3planation of the purpose of the spreadsheet' basis of calculation' input re?uired and output$s& generated are often placed on the first wor-sheet. ) spreadsheet that you build today' with many complicated formulas' may not be ?uite so ob(ious in its function and operation in @ or 12 months time. !se comments and notes liberally to document your wor-. You might be aware that you cannot use negati(e (alues or Fero (alues for a particular argument' but if someone else inputs such a (alue will your formula be robust or simply return a standard $and often not too helpful& Drr% message= Ct is a good idea to trap errors using some form of logic statements or with conditional formatting.

Place a uni@ue formula in each cell


The most basic strategy is to (iew whate(er formulas are needed as simple and with a limited useful life. The strategy is then to place a uni?ue formula in each appropriate cell. This can be recommended only for (ery simple or Kthrow awayL $single use& spreadsheets.

7reak formulas into parts and combine the parts


The second strategy is similar to the first' but instead you brea- down longer formulas into smaller parts and then combine the parts into the whole. 1any e3amples of this type e3ist in comple3 scientific and engineering calculations where interim results are used in a number of places in the wor-sheet. The result of calculating the flow (elocity of water in a pipe may be used in estimating losses due to friction' whether the pipe is flowing full or partially empty' and in optimiFing the diameter for the gi(en flow regime. Cn all cases you should adopt the basic principles of formula creation described pre(iously.

$hapter A Using 'ormulas and 'unctions

98%

*se the 7asic editor to create functions


) third strategy is to use the 4asic editor and create your own functions and macros. This approach would be used where the result would greatly simplify the use of the spreadsheet by the end user and -eep the formulas simple with a better chance of a(oiding errors. This approach also can ma-e the maintenance easier by ha(ing corrections or updates -ept in one central location. The use of macros is described in Chapter 12 of this boo- and is a specialiFed topic in itself. The danger of o(erusing macros and custom functions is that the principles upon which the spreadsheet is based become much more difficult to see by a user other than the original author $and sometimes e(en by the authorl&.

Finding and fi.ing errors


Ct is common to find situations where errors are displayed. D(en with all the tools a(ailable in Calc to help you to enter formulas' ma-ing mista-es is easy. 1any people find inputting numbers difficult and many may ma-e a mista-e about the -ind of entry that a functionIs argument needs. Cn addition to correcting errors' you may want to find the cells used in a formula to change their (alues or to chec- the answer. Calc pro(ides three tools for in(estigating formulas and the cells that they reference% error messages' color coding' and the 5etecti(e.

#rror messages
The most basic tool is error messages. Drror messages display in a formulaIs cell or in the 2unction 0iFard instead of the result. )n error message for a formula is usually a three+digit number from A01 to A2E' or sometimes an unhelpful piece of te3t such as h )1D=' hHD2' or hB)#!D. The error number appears in the cell' and a brief e3planation of the error on the right side of the status bar. 1ost error messages indicate a problem with how the formula was input' although se(eral indicate that you ha(e run up against a limitation of either Calc or its current settings. Drror messages are not user+friendly' and may intimidate new users. /owe(er' they are (aluable clues to correcting mista-es. You can find detailed e3planations of them in the help' by searching for Drror codes in #ibre;ffice Calc. ) few of the most common are shown in the following table. h )1D= hHD2 hB)#!D Cnstead of displaying Drr%A2A. o (alid reference e3ists for the argument. Cnstead of displaying Drr%A2<. The column' row' or sheet for the referenced cell is missing. Cnstead of displaying Drr%A1:. The (alue for one of the arguments is not the type that the argument re?uires. The (alue may be entered incorrectlyN for e3ample' double+?uotation mar-s may be missing around the (alue. )t other times' a cell or range used may ha(e the wrong format' such as te3t instead of numbers. Cnstead of displaying Drr%A32. 5i(ision by Fero ) calculation results in an o(erflow of the defined (alue range. )n operator such as an e?uals sign is missing from the formula. ) (ariable is missing from the formula.

h5CB0l h !1l A0: A10

98&

LibreOffice ".# $alc Guide

#.amples of common errors


<* ;,=> *ivision b$ -ero
This error is the result of di(iding a number by either the number Fero $0& or a blan- cell. There is an easy way to a(oid this type of problem. 0hen you ha(e a Fero or blan- cell displayed' use a conditional function. 2igure 1A* depicts di(ision of column 4 by column C yielding 2 errors arising from a Fero and a blan- cell showing in column C.

'igure #%-: )*amples of OD0H 8P= Division b2 1ero error Ct is (ery common to find an error such as this arising from a situation where data was not reported or reported incorrectly. 0hen such an occurrence is possible' an C2 function can be used to display the data correctly. The formula =() 4%>*+ "%/4%+ ,.o ?eport,' can be entered. The formula is then copied o(er the remainder of Column 5. The meaning of this formula roughly would be% KCf C3 is greater than 0' then compute 43 di(ided by C3' otherwise enter M o HeportIL. Ct is also possible for the last parameter to use double ?uotes for a blan- $no (alue& to be entered' or a different formula with a standardiFed number being substituted for the lower number. )n e3ample is shown in 2igure 1A:.

'igure #%.: Division b2 1ero solution

$hapter A Using 'ormulas and 'unctions

98A

<;)L+E .o result and <&EF ncorrect references


The hBalue error is also (ery common.

'igure #&8: 0ncorrect entr2 causing OH,LU) error ) common occurrence of this error arises when a cell contains an incorrect (alue type. Cn the e3ample of 2igure 23' te3t K oneL has been entered in C*' where our formula in column 5 is e3pecting a number. The hHD2 error is caused by a missing reference. Cn the e3ample below' the formula references a sheet which has been deleted.

Color coding for input


)nother useful tool when re(iewing a formula is the color coding for input. 0hen you select a formula that has already been entered' the cells or ranges used for each argument in the formula are outlined in color.

Calc uses eight colors for outlining referenced cells' starting with blue for the first cell' and continuing with red' magenta' green' dar- blue' brown' purple and yellow before cycling through the se?uence again.

98-

LibreOffice ".# $alc Guide

,he %etective
Cn a long or complicated spreadsheet' color coding becomes less useful. Cn these cases' consider using the submenu under ,ools < %etective. The 5etecti(e is a tool for chec-ing which cells are used as arguments by a formula $precedents& and which other formulas it is nested in $dependents&' and trac-ing errors. Ct can also be used for tracing errors' mar-ing in(alid data $that is' information in cells that is not in the proper format for a functionIs argument&' or e(en for remo(ing precedents and dependents. To use the 5etecti(e' select a cell with a formula' then start the 5etecti(e. ;n the spreadsheet' you will see lines ending in circles to indicate precedents' and lines ending in arrows for dependents. The lines show the flow of information. !se the 5etecti(e to assist in following the precedents referred to in a formula in a cell. 4y tracing these precedents' you fre?uently can find the source of the errors. "lace the cursor in the cell in ?uestion and then choose ,ools < %etective < ,race Precedents from the menu bar or press Shift5'A. 2igure 1@1 shows a simple e3ample of tracing precedents. This allows us to chec- the source cells $which may be a range& for any errors which ha(e caused us to ?uery the calculation result. Cf a source is a range' then that range is highlighted in blue. Cn other instances we may ha(e to trace an error. 2or this we use the Trace Drror function' found under ,ools < %etective < ,race #rror, to find the cells that caused the error.

a7 $ell containing formula selected. 'igure #&#: (racing precedents using the Detective

$hapter A Using 'ormulas and 'unctions

98.

b7 0nitiate trace b2 clic4ing (race Precedents

c7 Source cells indicated with blue dots= with arrow pointing to the calculation cell 6continued7: (racing precedents using the Detective

#.amples of functions
2or no(ices' functions are one of the most intimidating features of #ibre;ffice>s Calc. ew users ?uic-ly learn that functions are an important feature of spreadsheets' but there are hundreds' and many re?uire input that assumes specialiFed -nowledge. 2ortunately' Calc includes doFens of functions that anyone can use.

9#8

LibreOffice ".# $alc Guide

7asic arithmetic and statistics


The most basic functions create formulas for basic arithmetic or for e(aluating numbers in a range of cells.

:asic arit"(etic
The simple arithmetic functions are addition' subtraction' multiplication' and di(ision. D3cept for subtraction' each of these operations has its own function%

,!1 for addition "H;5!CT for multiplication J!;TCD T for di(ision


Traditionally' subtraction does not ha(e a function. ,!1' "H;5!CT' and J!;TCD T are useful for entering ranges of cells in the same way as any other function' with arguments in brac-ets after the function name. /owe(er' for basic e?uations' many users prefer the time+honored computer symbols for these operations' using the plus sign $R& for addition' the hyphen $X& for subtraction' the asteris- $Z& for multiplication and the forward slash $/& for di(ision. These symbols are ?uic- to enter without re?uiring your hands to stray from the -eyboard. ) similar choice is also a(ailable if you want to raise a number by the power of another. Cnstead of entering Y";0DH$)1'2&' you can enter Y)1i2. 1oreo(er' they ha(e the ad(antage that you enter formulas with them in an order that more closely appro3imates human readable format than the spreadsheet+readable format used by the e?ui(alent function. 2or instance' instead of entering Y,!1 $)1%)2&' or possibly Y,!1 $)1')2&' you enter Y)1R)2. This almost+human readable format is especially useful for compound operations' where writing Y)1Z$)2R)3& is briefer and easier to read than Y"H;5!CT$)1',!1$)2%)3&&. The main disad(antage of using arithmetical operators is that you cannot directly use a range of cells. Cn other words' to enter the e?ui(alent of Y,!1 $)1%)3&' you would need to type Y)1R)2R)3. ;therwise' whether you use a function or an operator is largely up to youce3cept' of course' when you are subtracting. /owe(er' if you use spreadsheets regularly in a group setting such as a class or an office' you might want to standardiFe on an entry format so that e(eryone who handles a spreadsheet becomes accustomed to a standard input.

!i(ple statistics
)nother common use for spreadsheet functions is to pull useful information out of a list' such as a series of test scores in a class' or a summary of earnings per ?uarter for a company. You can' of course' scan a list of figures if you want basic information such as the highest or lowest entry or the a(erage. The only trouble is' the longer the list' the more time you waste and the more li-ely you are to miss what you are loo-ing for. Cnstead' it is usually ?uic-er and more efficient to enter a function. ,uch reasons e3plain the e3istence of a function li-e C;! T' which does no more than gi(e the total number of entries in the designated cell range. ,imilarly' to find the highest or lowest entry' you can use 1C or 1)Q. 2or each of these formulas' all arguments are either a range of cells' or a series of cells entered indi(idually. Dach also has a related function' 1C ) or 1)Q)' which performs the same function' but also treats a cell formatted for te3t as ha(ing a (alue of 0 $The same treatment of te3t occurs in any (ariation of another function that adds an U)U to the end&. Dither function gi(es the same result' and

$hapter A Using 'ormulas and 'unctions

9##

could be useful if you used a te3t notation to indicate' for e3ample' if any student were absent when a test was written' and you wanted to chec- whether you needed to schedule a ma-eup e3am. 2or more fle3ibility in similar operations' you could use #)HGD or ,1)##' both of which add a specialiFed argument of ran-. Cf the ran- is 1 used with #)HGD' you get the same result as you would with 1)Q. /owe(er' if the ran- is 2' then the result is the second largest result. ,imilarly' a ran- of 2 used with ,1)## gi(es you the second smallest number. 4oth #)HGD and ,1)## are handy as a permanent control' since' by changing the ran- argument' you can ?uic-ly scan multiple results. You would need to be an e3pert to want to find the "oisson 5istribution of a sample' or to find the s-ew or negati(e binomial of a distribution $and' if you are' you will find functions in Calc for such things&. /owe(er' for the rest of us' there are simpler statistical functions that you can ?uic-ly learn to use. Cn particular' if you need an a(erage' you ha(e a number of functions to choose from. You can find the arithmetical meancthat is' the result when you add all entries in a list then di(ided by the number of entries' by entering a range of numbers when using )BDH)GD' or )BDH)GD ) to include te3t entries and to gi(e them a (alue of Fero. Cn addition' you can get other information about the data set%

1D5C) % The entry that is e3actly half way between the highest and lowest number in a
list.

1;5D% The most common entry in a list of numbers. J!)HTC#D% The entry at a set position in the array of numbers. 4esides the cell range' you
enter the type of Juartile% 0 for the lowest entry' 1 for the (alue of 2Ad' 2 for the (alue of A0d' 3 for EAd' and < for the highest entry. ote that the result for types 1 through 3 may not represent an actual item entered.

H) 6% The position of a gi(en entry in the entire list' measured either from top to bottom or
bottom to top. You need to enter the cell address for the entry' the range of entries' and the type of ran- $1 for the ran- from the highest' or 1 for the ran- from the bottom. ,ome of these functions o(erlapN for e3ample' 1C and 1)Q are both co(ered by J!)HTC#D. Cn other cases' a custom sort or filter might gi(e much the same result. 0hich you use depends on your temperament and your needs. ,ome might prefer to use 1C and 1)Q because they are easy to remember' while others might prefer J!)HTC#D because it is more (ersatile.

+sin% t"ese functions


Cn some cases' you may be able to get similar results to some of these functions by setting up a filter or a custom sort. /owe(er' in general' functions are more easily adGusted than filters or sorts' and pro(ide a wide range of possibilities. )t times' you may Gust want to enter one or more formulas temporarily in a con(enient blan- cell' and delete it once you ha(e finished. /owe(er' if you find yourself using the same functions constantly' you should consider creating a template and including space for all the functions you use' with the cell to their left used as a label for them. ;nce you ha(e created the template' you can easily update each formula as entries change' either automatically and on+the+fly or pressing the '. -ey to update all selected cells. o matter how you use these functions' you will probably find them simple to use and adaptable for many purposes. 4y the time you ha(e mastered this handful' you will be ready to try more comple3 functions.

9#9

LibreOffice ".# $alc Guide

3ounding off numbers


2or statistical and mathematical purposes' Calc includes a (ariety of ways to round off numbers. Cf you are a programmer' you may also be familiar with some of these methods. /owe(er' you do not need to be a specialist to find some of these methods useful. You may want to round off for billing purposes' or because decimal places do not translate well into the physical worldcfor instance' if the parts you need come in pac-ages of 100' then the fact you only need @@ is irrele(ant to youN you need to round up for ordering. 4y learning the options for rounding up or down' you can ma-e your spreadsheets more immediately useful. 0hen you use a rounding function' you ha(e two choices about how to set up your formulas. Cf you choose' you can nest a calculation within one of the rounding functions. 2or instance' the formula YH;! 5$$,!1$)1')2&& adds the figures in cells )1 and )2' then rounds them off to the nearest whole number. /owe(er' e(en though you do not need to wor- with e3act figures e(ery day' you may still want to refer to them occasionally. Cf that is the case' then you are probably better off separating the two functions' placing Y,!1$)1')2& in cell )3' and YH;! 5 $)3& in )<' and clearly labeling each function.

&oundin% (et"ods
The most basic function for rounding numbers in Calc is H;! 5. This function will round off a number according to the usual rules of symmetric arithmetic rounding% a decimal (alue of .< or less gets rounded down' while one of .A or more gets rounded up. /owe(er' at times' you may not want to follow these rules. 2or instance' if you are one of those contractors who bills a full hour for any fraction of an hour you wor-' you would want to always round up so you did not lose any money. Con(ersely' you might choose to round down to gi(e a slight discount to a long+established customer. Cn these cases' you might prefer to use H;! 5!" or H;! 55;0 ' which' as their names suggest' round a number to the nearest integer abo(e or below it. )ll three of these functions re?uire the single argument of numbercthe cell or number to be rounded. !sed with only this argument' all three functions round to the nearest whole number' so that <@.A would round to <E with H;! 5 or H;! 5!" and <@ with H;! 55;0 . /owe(er' if you use the optional count argument' you can specify the number of decimal places to include. 2or instance' if number was set to 1' then <*.@A would round to <*.E with H;! 5 or H;! 5!" and to <*.@ with H;! 55;0 . )s an alternati(e to H;! 55;0 when wor-ing with decimals' you can use TH! C $short for truncate&. Ct ta-es e3actly the same arguments as H;! 55;0 ' so which function you use is a matter of choice. Cf you are not wor-ing with decimals' you might choose to use C T $short for integer&' which ta-es only the number argument. )nother option is the ;55 and DBD pair of functions. ;55 rounds up to the nearest odd number if what is entered in the number argument is a positi(e number' and rounds down if it is a negati(e number' while DBD does the same for an e(en number. 2urther options are the CDC#C G and 2#;;H functions. )s you can guess from the names' CDC#C G rounds up and 2#;;H rounds down. 2or both functions' the number that they round to is determined by the closest multiple of the number that you enter as the significance argument which is abo(e or below the (alue being tested. 2or instance' if your business insurance is billed by the wor- wee-' the fact that you were only open three days one wee- would be irrele(ant to your costsN you would still be charged for an entire wee-' and therefore might want to use CDC#C G in your monthly e3penses. Cf cell D1 contains the (alue <@.E' YCDC#C G$D1'E& will return the (alue <:' this being the closest multiple of E abo(e the (alue. Con(ersely' if you are building customiFed computers and completed <.A in a day' your client would only be interested in the number ready to ship' so you might use 2#;;H in a report of your progress.
$hapter A Using 'ormulas and 'unctions 9#3

Cf cell D1 contains the (alue <@.E' Y2#;;H$D1'E& will return the (alue <2' this being the closest multiple of E below the (alue. 4esides number and significance' both CDC#C G and 2#;;H include an optional argument called mode' which ta-es a (alue of 0 or 1. Cf mode is set to 0' and both the number and the significance are negati(e numbers' then the result of either function is rounded upN if it is set to 1' and both the number and the significance are negati(e numbers' then the results are rounded down. Cn other words' if the number is +11 and the significance is +A' then the result is +10 when the mode is set to 0' but +1A when set to 1. /owe(er' if you are e3changing spreadsheets between Calc and 1, D3cel' remember that the mode argument is not supported by D3cel. Cf you want the answers to be consistent between the two spreadsheets' lea(e the optional mode argument out of your formulas. ) function somewhat similar to CDC#C G and 2#;;H is 1H;! 5. #i-e CDC#C G ) 5 2#;;H' 1H;! 5 re?uires two arguments' although' somewhat confusingly' the second one is called multiple rather than significance' e(en though the two are identical. The difference between 1H;! 5 and CDC#C G and 2#;;H is that 1H;! 5 rounds up or down using symmetric arithmetic rounding. 2or e3ample' if the number is EE and the multiple is A' then 1H;! 5 gi(es a result of EA. /owe(er' if the multiple is changed to E' then the result of 1H;! 5 becomes EE. ;nce you become familiar with CalcIs long' undifferentiated list of functions' you can start to decide which is most useful for your purposes. /owe(er' one last point is worth mentioning% Cf you are wor-ing with more than two decimal places' do not be surprised if you do not see the same number of decimal places on the spreadsheet in unformatted cells' as you do on the function wiFard. Cf you do not' the reason may be that ,ools < =ptions < 2ibre=ffice Calc < Calculate < 2imit decimals for general number format has been enabled and the default changed from 0. Dither deselect this option to return it to the default setting' or change the number of decimal places' and' if necessary' unchec- the Precision as shown bo3 on the same page' and the spreadsheet will display as e3pected.

*sing regular e.pressions in functions


) number of functions in Calc allow the use of regular e3pressions% ,!1C2' C;! TC2' 1)TC/' ,D)HC/' #;;6!"' /#;;6!"' B#;;6!"' 5C;! T' 5C;! T)' 5,!1' 5"H;5!CT' 51)Q' 51C ' 5)BDH)GD' 5,T5DB' 5,T5DB"' 5B)H' 5B)H"' 5GDT. 0hether or not regular e3pressions are used is selected on the ,ools < =ptions < 2ibre=ffice Calc < Calculate dialog. Ct is enabled in a default installation.

9#"

LibreOffice ".# $alc Guide

'igure #&9: Default settings for $alculate page 2or e3ample YC;! TC2$)1%)@'Ur.dU& with #nable regular e.pressions in formulas selected will count cells in )1%)@ which contain red and 3OD. )dditionally if +earch criteria S and T< must apply to whole cells is not selected' then 'red' bride' and 3idge will also be counted. Cf that setting is selected' then it can be o(ercome by wrapping the e3pression thus% YC;! TC2$)1%)@'U.Zr.d.ZU&.

igure #&3: Using the $OU@(0' function Hegular e3pression searches within functions are always case insensiti(e' irrespecti(e of the setting of the Case sensitive chec-bo3 on the dialog in 2igure 1@2cso red and 3OD will always be matched in the abo(e e3ample. This case+insensiti(ity also applies to the regular e3pression structures $V%lower%W& and $V%upper%W&' which match characters irrespecti(e of case. Hegular e3pressions will not wor- in simple comparisons. 2or e3ample% )1YUr.dU will always return 2)#,D if )1 contains red' e(en if regular e3pressions are enabled. Ct will only return TH!D if )1 contains r.d $r then a dot then d&. Cf you wish to test using regular e3pressions' try the C;! TC2 function% C;! TC2$)1'Ur.dU& will return 1 or 0' interpreted as TH!D or 2)#,D in formulas li-e YC2$C;! TC2$)1'Ur.dU&'UhoorayU'UbooU&.

$hapter A Using 'ormulas and 'unctions

9#%

)cti(ating the #nable regular e.pressions in formulas option means all the abo(e functions will re?uire any regular e3pression special characters $such as parentheses& used in strings within formulas' to be preceded by a bac-slash' despite not being part of a regular e3pression. These bac-slashes will need to be remo(ed if the setting is later deacti(ated.

Advanced functions
)s is common with other spreadsheet programs' #ibre;ffice Calc can be enhanced by user+ defined functions or add+ins. ,etting up user+defined functions can be done either by using the 4asic C5D or by writing separate add+ins or e3tensions. The basics of writing and running macros is co(ered in Chapter 12' Calc 1acros. 1acros can be lin-ed to menus or toolbars for ease of operation or stored in template modules to ma-e the functions a(ailable in other documents. Calc )dd+ins are specialiFed office e3tensions which can e3tend the functionality of #ibre;ffice with new built+in Calc functions. 0riting )dd+ins re?uires -nowledge of the CRR language' the #ibre;ffice ,56' and is for e3perienced programmers. ) number of e3tensions for Calc ha(e been written and these can be found on the e3tensions site at http%//e3tensions.libreoffice.org/. Hefer to Chapter 1<' ,etting up and CustomiFing Calc' for more details.

9#&

LibreOffice ".# $alc Guide

$hapter Using Pivot (ables

ntroduction
1any re?uests for spreadsheet support are the result of using complicated formulas and solutions to sol(e simple day+to+day problems. 1ore efficient and effecti(e solutions use the "i(ot Table' a tool for combining' comparing' and analyFing large amounts of data easily. !sing "i(ot Tables' you can (iew different summaries of the source data' display the details of areas of interest' and create reports' whether you are a beginner or an intermediate or ad(anced user.

%atabase preconditions
The first thing needed to wor- with the "i(ot Table is a list of raw data' similar to a database table' consisting of rows $data sets& and columns $data fields&. The field names are in the first row abo(e the list. The data source could be an e3ternal file or database. 2or the simplest case' where data is contained in a Calc spreadsheet' Calc offers sorting functions that do not re?uire the "i(ot Table. 2or processing data in lists' the program needs to -now where in the spreadsheet the table is. The table can be anywhere in the sheet' in any position. ) spreadsheet can contains se(eral unrelated tables. Calc recogniFes your lists automatically. Ct uses the following logic% ,tarting from the cell you ha(e selected $which must be within the list&' Calc chec-s the surrounding cells in all < directions $left' right' abo(e' below&. The border is recogniFed if the program disco(ers an empty row or column' or if it hits the left or upper border of the spreadsheet. This means that the described functions can only wor- correctly if there are no empty rows or columns in your list. )(oid empty lines $for e3ample for formatting&. You can format your list by using cell formats.

3ule

o empty rows or empty columns are allowed within lists.

Cf you select more than one single cell before you start sorting' filtering' or calling the "i(ot Table' then the automatic list recognition is switched off. Calc assumes that the list matches e3actly the cells you ha(e selected.

3ule

2or sorting' filtering' or using the "i(ot Table' always select only one cell.

) relati(ely common source of errors is to inad(ertently declare a list by mista-e and then to sort that list. Cf you select multiple cellscfor e3ample' a whole columncthen the sorting mi3es up the data that should be together in one row. Cn addition to these formal aspects' the logical structure of your table is also (ery important.

3ule

Calc lists must ha(e the normal formN that is' they must ha(e a simple linear structure.

0hen entering the data' do not add outlines' groups' or summaries. /ere are some mista-es commonly made by ine3perienced spreadsheet users% 1& You made se(eral unnecessary sheetsN for e3ample' a sheet for each group of articles. Cn this case' analyses are then possible only within each group. 2& Cn a ,ales list' instead of only one column for the amount' you made a column for the amounts for each employee. Cn this case' the system will ha(e difficulty grouping data from the (arious columns together. Thus' an analysis with the "i(ot Table would no longer be

9#-

LibreOffice ".# $alc Guide

possible. )ll data must be entered into the same column for the "i(ot Table to be able to analyFe it. 3& You entered the amounts in chronological order. )t the end of each month' you made a sum total. Cn this case' sorting the list for different criteria is not possible because the "i(ot Table will treat the sum totals the same as any other figure. Getting monthly results is one of the (ery fast and easy features of the "i(ot Table.

%ata sources
)t this time' the possible data sources for the "i(ot Table are a Calc spreadsheet or an e3ternal data source that is registered in #ibre;ffice.

Calc spreads"eet
)nalyFing a list in a Calc spreadsheet is the simplest and most often used case. #ists might be updated regularly' or the data might be imported from a different application. The beha(ior of Calc while inserting data from a different application depends on the format of the data. Cf the data is in a common spreadsheet format' it is copied directly into Calc. /owe(er' if the data is in plain te3t format' the Te3t Cmport dialog $2igure 1@A& appears after you select the file containing the dataN see Chapter 1' Cntroducing Calc' for more more information about this dialog.

'igure #&": (e*t 0mport dialog Calc is able to import data from a huge number of foreign data formats' such as other spreadsheets $D3cel' #otus 1' 2' 3&N from databases $li-e d4ase&N and from simple te3t files' including C,B formats. /owe(er' in Calc' imported foreign data will not update automatically if changes are made to the source file. Cn #ibre;ffice Calc' you can use up to 1'0<*'AE@ rows.

$hapter - Using Pivot (ables

9#.

&e%istered data source


) registered data source is a connection to data held in a database outside of #ibre;ffice. 0hen using a registered data source' the data to be analyFed will not be sa(ed in CalcN Calc always uses the data from the original source. Calc is able to use many different data sources in addition to databases that are created and maintained with #ibre;ffice 4ase. 2or more information' see Chapter 10' #in-ing Calc 5ata.

Creating a Pivot ,able


Create the "i(ot Table using %ata < Pivot ,able < Create from the menu bar. Cf the list to be analyFed is in a spreadsheet table' select only one cell within this list. Calc recogniFes and selects the list automatically for use with the "i(ot Table $2igure 1@A&.

'igure #&%: Selecting the source data for the Pivot (able

,he Pivot ,able dialog


The function of the "i(ot Table is managed in two places% first' in the "i(ot Table dialog' and second' through manipulations of the result in the spreadsheet. This section describes the dialog in detail.

7asic layout
Cn the "i(ot Table dialog $2igure 1@@& are four white areas that show the layout of the result. 4eside these white areas are buttons with the names of the fields in your data source. To choose a layout' drag and drop the field buttons into the white areas. The Data 'ields area in the middle must contain at least one field. )d(anced users can use more than one field here. 2or the 5ata 2ield an aggregate function is used. 2or e3ample' if you mo(e the sales field into the Data 'ields area' it appears there as +um A sales.

998

LibreOffice ".# $alc Guide

'igure #&&: Pivot (able dialog 3ow 'ields and $olumn 'ields indicate from which groups the result will be sorted. ;ften more than one field is used at a time to get partial sums for rows or columns. The order of the fields gi(es the order of the sums from o(erall to specific. 2or e3ample' if you drag region and employee into the 3ow 'ields area' the sum will be di(ided into the employees. 0ithin the employees will be the listing for the different regions $see 2igure 1@E&.

'igure #&A: Pivot (able field order for anal2sis= and resulting la2out in pivot table 2ields that are placed into the Page 'ields area appear in the result abo(e as a drop down list. The summary in your result ta-es only that part of your base data into account that you ha(e selected. 2or e3ample' if you use employee as a "age 2ield' you can filter the result shown for each employee. To remo(e a field from the white layout area' Gust drag it past the border and drop it $the cursor will change to a crossed symbol&' or select it and clic- the 3emove button.

4ore options
To e3pand the "i(ot Table dialog and show more options' clic- 4ore.

$hapter - Using Pivot (ables

99#

'igure #&-: )*panded dialog of the Pivot (able +election from ,hows the sheet name and the range of cells used for the "i(ot Table. 3esults to 3esults to defines where your result will be shown. ,etting 3esults to as A undefined A and then entering a cell reference tells the "i(ot Table where to show the results.1 )n error dialog is displayed if you fail to enter a cell reference. ,electing 3esults to as / new sheet A adds a new sheet to the spreadsheet file and places the results there. The new sheet is named using the format Pivot ,ableQsheetnameQON where Q is the number of the table created' 1 for first' 2 for second and so on. 2or the source shown in 2igure 3' the new sheet for the first table produced would be named Pivot ,ableQsheetnameQ1. Dach new sheet is inserted ne3t to the source sheet. gnore empty rows Cf the source data is not in the recommended form' this option tells the "i(ot Table to ignore empty rows. dentify categories 0ith this option selected' if the source data has missing entries in a list and does not meet the recommended data structure $see 2igure 1@:&' the "i(ot Table adds it to the listed category abo(e it. Cf this option is not chosen' then the "i(ot Table inserts 6empt27 $see 2igure 1E1&.

'igure #&.: )*ample of data with missing entries in $olumn , The option 0dentif2 categories ensures that in this e3ample rows 3 and < are included for the product ,pples and that row @ is included for Pears $see 2igure 1E0&.

'igure #A8: Pivot (able result with 0dentif2 categories selected


1 Cn this case the word ! undefined E is misleading because the output position is in fact defined.

999

LibreOffice ".# $alc Guide

0ithout category recognition' the "i(ot Table shows an 6empt27 category $2igure 1E1&.

'igure #A#: Pivot (able result without 0dentif2 categories selected #ogically' the beha(ior with category recognition is better. ) list showing missing entries is also less useful' because you cannot use functions such as sorting or filtering. ,otal columns$ ,otal rows 0ith these options you can decide if the "i(ot Table shows an e3tra row with the sums of each column' or if it adds on the (ery right a column with the sums of each row. Cn some cases' an added total sum is meaningless' for e3ample if your entries are accumulated or the result of comparisons. Add filter !se this option to add or hide the cell labeled Filter abo(e the "i(ot Table results. This cell is a con(enient button for additional filtering options within the "i(ot Table. #nable drill to details 0ith this option enabled' if you double+clic- on a single data cell' including a cell produced from (otal columns or (otal rows' in the "i(ot Table result' a new sheet opens gi(ing a detailed listing of the indi(idual entry. Cf you double+clic- on a cell in either the How 2ields or the Column 2ields' then the Show Detail dialog open $see K5rilling $showing details&L on page 23<&. Ta-ing 2igure 1@E as an e3ample' if a pi(ot table uses more than one field $region and employee& and you double+clic- a left+most field $say' east&' then this collapses the row' combining the totals for employees for that field and displaying the totals for east. Cf this function is disabled' the double+clic- will -eep its usual edit function within a spreadsheet.

4ore settings for the fields: Field options


The options discussed in the pre(ious section are (alid for the "i(ot Table in general. You can also change settings for e(ery field that you ha(e added to the "i(ot Table layout. To do this'either select a field and clic- on the =ptions button in the "i(ot Table dialog' or double+clic- on the appropriate field. The options a(ailable for fields when put into the 5ata 2ields differ from those when put into the How' Column' and "age 2ields of the "i(ot Table.

Options for *ata Fields


Cn the ;ptions dialog of a 5ata 2ield' you can select the ,um function to accumulate the (alues from your data source. 0hile you will often use the sum function' other functions $li-e standard distribution or a counting function& are also a(ailable. 2or e3ample' the counting function can be useful for non+numerical data fields. ;n the 5ata 2ield dialog' clic- 4ore to see the Displa2ed value section.

$hapter - Using Pivot (ables

993

'igure #A9: )*panded dialog for a Data 'ield Cn the Displa2ed value section' you can choose other possibilities for analysis by using the aggregate function. 5epending on the setting for ,ype' you may ha(e to choose definitions for 7ase field and 7ase item.

'igure #A3: )*ample choices for Base field and item The table below lists the possible types of displayed (alue and associated base field and item' together with a note on usage. /$pe
ormal

:ase field
c

:ase ite(
c

)nal$sis
,imple use of the chosen aggregate function $for e3ample' sum&. The result is the difference between the result of the 4ase field and the 4ase item $for e3ample' sales (olume of the employees against the sales (olume of 4rigitteN see 2igure 1E<&.

5ifference from

,election of a field from the data source of the "i(ot Table $for e3ample' employee&.

,election of an element from the selected base field $for e3ample' 4rigitte&

99"

LibreOffice ".# $alc Guide

/$pe
d of

:ase field
,election of a field from the data source of the "i(ot Table $for e3ample' employee& ,election of a field from the data source of the "i(ot Table $for e3ample' employee&

:ase ite(
,election of an element from the selected base field $for e3ample' 4rigitte&

)nal$sis
The result is a percentage ratio of the (alue of the base field to the base item $for e3ample' sales result of the employee relati(e to the sales result of 4rigitteN see 2igure 1EA&. 2rom each result' its reference (alue is subtracted' and the difference is di(ided by the reference (alue $for e3ample' sales of the employees as relati(e difference from the sales of 4rigitteN see 2igure 1E@&. Dach result is added to the sum of the results for preceding items in the base field' in the base fieldIs sort order' and the total sum is shown. Hesults are always summed' e(en if a different summary function was used to get each result.

d difference from

,election of an element from the selected base field $for e3ample. 4rigitte&

Hunning total in

,election of a field from the data source of the "i(ot Table $for e3ample' date&

d of row

The result is a percentage of the (alue of the whole row $for e3ample' the row sum&. The result is a percentage of the total column (alue $for e3ample' the column sum&. The result is a percentage of the o(erall result $for e3ample' the total sum&. $5efault result 3 total result& / $row total 3 column total&

d of column d of total

Cnde3

'igure #A": Original Pivot (able 6top7 and a *ifference fro( e*ample 6below7

$hapter - Using Pivot (ables

99%

'igure #A%: )*ample of a ? of anal2sis

'igure #A&: )*ample of ? difference fro( anal2sis

Options for &ow and Colu(n Fields


Cn the ;ptions dialog for the How or Column 2ields' you can choose to show subtotals for each category. ,ubtotals are deacti(ated by default. ,ubtotals are useful only if the (alues in one row or column field can be di(ided into subtotals for another $sub&field. ,ome e3amples are shown in the ne3t three figures.

'igure #AA: @o subdivision with onl2 one row or column field

'igure #A-: Division of the regions for emplo2ees 6two row fields7 without subtotals

99&

LibreOffice ".# $alc Guide

'igure #A.: Division of the regions for emplo2ees with subtotals 6b2 region7 To calculate subtotals that can also be used for the data fields $see abo(e&' select the Automatic option in the ,ubtotals section of the 5ata 2ield dialog. You can choose the type of subtotal to use by selecting *ser/defined and then clic-ing the type of subtotal you want to calculate from the list. 2unctions are only a(ailable when User!defined is selected.

'igure #-8: Preferences dialog of a row or column field

$hapter - Using Pivot (ables

99A

ormally' the "i(ot Table does not show a row or column for categories that ha(e no entries in the underlying database. 4y choosing the +how items with no data option' you can force this. 2or illustration purposes' the data was manipulated in such a way that the employee 4rigitte has no sales (alues for the category golfing.

'igure #-#: Default setting

'igure #-9: Setting QShow 0tems with no dataR

Options for 1a%e Fields


The ;ptions dialog for "age 2ields is the same as for How and Column fields' e(en though it appears to be useless to ha(e the same settings as described for the How and Column fields. 0ith the fle3ibility of the "i(ot Table' you can switch the different fields between pages' columns' or rows. The fields -eep the settings that you made for them. The "age 2ield has the same properties as a How or Column field. These settings only ta-e effect when you use the field not as a "age 2ield but as How or Column field.

8orking with the results of the Pivot ,able


)s mentioned abo(e' the "i(ot Table dialog is (ery fle3ible. ) "i(ot Table can be totally restructured with only a few mouse clic-s. ,ome functions of the "i(ot Table dialog can only be used with the "i(ot Table.

Changing the layout


The layout of the "i(ot Table can be changed ?uic-ly and easily by using drag+and+drop. 0ith the "i(ot Table open' fields can be dragged around from row' column' page and the 5ata 2ields areas to any position you want to put them' and then dropped. !nused fields can also be added' and fields remo(ed in error can be replaced by dragging and dropping them into the positions re?uired. ,ome manipulation can also be carried out in the pi(ot table (iew. 0ithin the results table of the "i(ot Table' mo(e one of the page' column' or row fields to a different position. The cursor will change shape from its starting shape $horiFontal or (ertical bloc- on the arrow head& to the opposite if mo(ing to a different field' such as from row to column' and it is ;6 to drop.
99LibreOffice ".# $alc Guide

'igure #-3: Drag a column field. @ote the cursor shape

'igure #-": Drag a row field. @ote the cursor shape

You can remo(e a column' row' or page field from the "i(ot Table by clic-ing on it and dragging it out of the table. The cursor changes to that shown in 2igure 1*A. ) field remo(ed in error cannot be reco(ered' and it is necessary to return to the "i(ot Table to replace it.

'igure #-%: 'ield dragged out of the Pivot (able

(rouping rows or columns


2or many analyses or summaries' the categories ha(e to be grouped. You can merge the results in classes. You can only carry out grouping on an ungrouped "i(ot Table. You can access grouping by selecting %ata < (roup and =utline < (roup from the menu bar' or by pressing '#9 after selecting the correct cell area. The type of (alues that ha(e to be grouped is what mainly determines how the grouping function wor-s. You need to distinguish between scalar (alues' or other (alues' such as te3t' that you want grouped.
4efore you can group' you ha(e to produce a "i(ot Table with ungrouped data. The time needed for creating a "i(ot Table depends mostly on the number of columns and rows and not on the siFe of the basic data. Through grouping you can produce the "i(ot Table with a small number of rows and columns. The "i(ot Table can contain a lot of categories' depending on your data source.

?ote

(rouping of categories with scalar values


2or grouping scalar (alues' select a single cell in the row or column of the category to be grouped. Choose %ata < (roup and =utline < (roup from the menu bar or press '#9N you get the Grouping dialog shown in 2igure 1*@. You can define in which (alue range $start/end& the grouping should ta-e place. The default setting is the whole range' from the smallest to the largest (alue. Cn the field Group b2= you can enter the class siFe' also -nown as the inter(al siFe $in the e3ample shown in 2igures 1*E and 1**' groups of 10 -m/h each&.

$hapter - Using Pivot (ables

99.

'igure #-&: Grouping dialog with scalar categories

'igure #--: Pivot (able with grouping 6classes of #8 4m h each7 'igure #-A: Pivot (able without grouping 6freKuenc2 of the 4m h values of a radar control7

(rouping without automatic creation of intervals


Categories containing te3t fields cannot create inter(als. You can define for each field $for e3ample' 5epartment& which (alues you want to put together in one group. 0ith more than one cell selected' choose %ata < (roup and =utline < (roup from the menu bar' or press '#9' to group those cells. ,ee 2igures 1*: and 1:0. 2or grouping of non+scalar categories' select in the result of the "i(ot Table all the indi(idual field (alues that you want to put in the one group.

,ip

You can select se(eral non+contiguous cells in one step by pressing and holding the $ontrol -ey while left+clic-ing with the mouse.

Gi(en the input data shown in 2igure 1*:' e3ecute the "i(ot Table with 5epartment in the How 2ield and ,um $,ic- 5ays& in the 5ata 2ield. The output should loo- li-e that in 2igure 1:0. 0ith the mouse' select the 5epartments )ccounting' "urchasing and ,ales.

938

LibreOffice ".# $alc Guide

'igure #-.: Database with non!scalar categories 6departments7

'igure #.8: Pivot (able with non!scalar categories

Choose the %ata < (roup and =utline < (roup from the 1enu bar or press '#9. The output should now loo- li-e that in 2igure 1:1. Hepeat this for all groups that you want to create from the different categories $,elect )ssembly' "roduction and 0arehouse and Group again. The output should loo- li-e 2igure 1:2.

'igure #.#: Summar2 of single categories in one group

'igure #.9: Grouping finished

You can change the default names for the groups and the newly created group field by editing the name in the input field $for e3ample changing >Group9> to >(echnical>&. The "i(ot Table will remember these settings' e(en if you change the layout later on. 2or the following pictures' the dialog was called again $right+clic-' #dit 2ayout& and by selecting the icon K%epartment "L' then =ptions' and finally from the preferences menu Automatic was selected. This generated the partial sum results shown in 2igure 1:3. 5ouble clic-ing (roup 1 and ,echnical collapses the entries' as shown in 2igure 1:<.

'igure #.": 3educed to the new groups

'igure #.3: 3enamed groups and partial results

$hapter - Using Pivot (ables

93#

?ote

) well+structured database ma-es manual sorting within the "i(ot Table obsolete. Cn the e3ample shown' you could add another column with the name 5epartment' that has the correct entry for each person based on whether the employeeIs department belongs to the group ;ffice or Technical. The mapping for this $1%n relationship& can be done easily with the B#;;6!" function from Calc.

+orting the result


The result of any "i(ot Table is sorted $categories& in columns and rows in ascending order. You can change the sorting in three ways%

,elect sort order from drop+down menus on each column heading. ,ort manually by using drag and drop. ,ort automatically by choosing the options in the preferences dialog of the row or column
field.

!elect sort order fro( drop'down (enus on eac" colu(n "eadin%


The simplest way to sort entries is to clic- the arrow on the right side of the heading and chec- the bo3$es& for the desired sort order. The custom sorting dialog is shown in 2igure 1:@. )dditional options e3ist to show all' show onl2 the current item' or hide onl2 the current item. ;nce sorting has been carried out using the drop+down list' the color of the arrow changes and a small s?uare of matching color is added to the bottom right of the arrow button.

'igure #.%: ,rrow color change and indicator sKuare on button

'igure #.&: $ustom sorting

939

LibreOffice ".# $alc Guide

!ort (anuall$ b$ usin% dra% and drop


You can change the order within the categories by mo(ing the cells with the category (alues in the result table of the "i(ot Table. The cell will be inserted abo(e the cell on which you drop it. 4e aware that in Calc' a cell must be selected. Ct is not enough that the cursor is in the cell. The bac-ground of a selected cell is mar-ed with a different color. To select se(eral cells' clic- in one cell with no e3tra -ey pressed' then press the Shift or $trl -ey while clic-ing in other cells. )nother possibility is to -eep the mouse button pressed on the cell you want to select' mo(e the mouse to a neighbor cell' and then mo(e bac- to the original cell before you release the mouse button.

!ort auto(aticall$
To sort automatically' right+clic- within the "i(ot Table and choose #dit 2ayout. This will open the "i(ot Table $2igure 1@@&. 0ithin the #ayout area of the "i(ot Table' double+clic- the row or column field you want to sort. Cn the 5ata 2ield dialog which opens $2igure 1*0&' clic- =ptions to display the 5ata 2ield ;ptions dialog. 2or Sort b2' choose either ,scending or Descending. ;n the left side is a drop+down list where you can choose the field this setting should apply to. 0ith this method' you can specify that sorting does not happen according to the categories but according to the results of the data field.

'igure #.A: Options for a row or column field

$hapter - Using Pivot (ables

933

%rilling Kshowing detailsL


5rill allows you to show the related detailed data for a single' compressed (alue in the "i(ot Table result. To acti(ate a drill' double+clic- on the cell or choose %ata < (roup and =utline < +how %etails. There are two possibilities% 1& The acti(e cell is a row or column field. Cn this case' drill means an additional brea-down into the categories of another field. 2or e3ample' double+clic- on the cell with the (alue golfing. Cn this instance the (alues that are aggregated within golfing can be subdi(ided using another field.

'igure #.-: Before the drill down for the categor2 golfing ) dialog appears allowing you to select the field to use for further subdi(ision. Cn this e3ample' employee.

'igure #..: Selecting the field for the subdivision

'igure 988: ,fter the drill down To hide the details again' double+clic- on the cell golfing or choose %ata < (roup and =utline < ;ide %etails.

93"

LibreOffice ".# $alc Guide

The "i(ot Table remembers your selection $in our e3ample the field employee& by adding and hiding the selected field' so that for the ne3t drill down for a category in the field category the dialog does not appear. To remo(e the selection employee' open the "i(ot Table dialog by right+clic-ing and choosing #dit 2ayout' then delete the unwanted selection in the row or column field. 2& The acti(e cell is a (alue of the 5ata 2ield. Cn this case' drill down results in a listing of all data entries of the data source that aggregates to this (alue. Cn our e3ample' if we were to double+clic- on the cell with the (alue g1*'E<1 from 2igure 1:*' we would now ha(e a new list of all data sets that are included in this (alue. This list is displayed in a new sheet.

'igure 98#: @ew table sheet after the drill down for a value in a data field

Filtering
To limit the "i(ot Table analysis to a subset of the information that is contained in the data basis' you can filter with the "i(ot Table.

?ote

)n )utofilter or default filter used on the sheet has no effect on the "i(ot Table analysis process. The "i(ot Table always uses the complete list that was selected when it was started.

To do this' clic- Filter on the top left side abo(e the results.

'igure 989: 'ilter field in the upper left area of the Pivot (able Cn the 2ilter dialog' you can define up to 3 filter options that are used in the same way as CalcIs default filter.

?ote

D(en if they are not called a filter' page fields are a practical way to filter the results. The ad(antage is that the filtering criteria used are clearly (isible.

$hapter - Using Pivot (ables

93%

'igure 983: Dialog for defining the filter

*pdating KrefreshingL changed values


)fter you ha(e created the "i(ot Table' changes in the source data do not cause an automatic update in the resulting table. You must update $refresh& the "i(ot Table manually after changing any of the underlying data (alues. Changes in the source data could appear in two ways% 1& The content of e3isting data sets has been changed. 2or e3ample' you might ha(e changed a sales (alue afterward. To update the "i(ot Table' right+clic- in the result area and choose 3efresh $or choose %ata < Pivot ,able < 3efresh from the menu bar&. 2& You ha(e added or deleted data sets in the original list. Cn this case the change means that the "i(ot Table has to use a different area of the spreadsheet for its analysis. 2undamental changes to the data set collection means you must redo the "i(ot Table from the beginning.

Cell formatting
The cells in the results area of the "i(ot Table are automatically formatted in a simple format by Calc. You can change this formatting using all the tools in Calc' but note that if you ma-e any change in the design of the "i(ot Table or any updates' the formatting will return to the format applied automatically by Calc. 2or the number format in the data field' Calc uses the number format that is used in the corresponding cell in the source list. Cn most cases' this is useful $for e3ample' if the (alues are in the currency format' then the corresponding cell in the result area is also formatted as currency&. /owe(er' if the result is a fraction or a percentage' the "i(ot Table does not recogniFe that this might be a problemN such results must either be without a unit or be displayed as a percentage. )lthough you can correct the number format manually' the correction stays in effect only until the ne3t update.

*sing shortcuts
Cf you use the "i(ot Table (ery often' you might find the fre?uent use of the menu paths $%ata < Pivot ,able < Create and %ata < (roup and =utline < (roup& incon(enient. 2or grouping' a shortcut is already defined% '#9. 2or starting the "i(ot Table' you can define your own -eyboard shortcut. Cf you prefer to ha(e toolbar icons instead of -eyboard shortcuts' you can create a user+defined symbol and add it to either your own custom made toolbar or the ,tandard toolbar. 2or an e3planation how to create -eyboard shortcuts or add icons to toolbars' see Chapter 1<' ,etting !p and CustomiFing Calc.

93&

LibreOffice ".# $alc Guide

*sing Pivot ,able results elsewhere


,he problem
ormally' you create a reference to a (alue by entering the address of the cell that contains the (alue. 2or e3ample' the formula =40*! creates a reference to cell C- and returns the doubled (alue. Cf this cell is located in the results area of the "i(ot Table' it contains the result that was calculated by referencing specific categories of the row and column fields. Cn 2igure 20<' the cell C- contains the sum of the sales (alues of the employee /ans in the category ,ailing. The formula in the cell C1" uses this (alue.

'igure 98": 'ormula reference to a cell of the Pivot (able Cf the underlying data or the layout of the "i(ot Table changes' then you must ta-e into account that the sales (alue for /ans might appear in a different cell. Your formula still references the cell Cand therefore uses a wrong (alue. The correct (alue is in a different location. 2or e3ample' in 2igure 20A' the location is now C7.

'igure 98%: (he value that 2ou reall2 want to use can be found now in a different location.

$hapter - Using Pivot (ables

93A

,he solution: Function (#,P >=,%A,A


!se the function GDT"CB;T5)T) to ha(e a reference to a (alue inside the "i(ot Table by using the specific identifying categories for this (alue. This function can be used with formulas in Calc if you want to reuse the results from the "i(ot Table elsewhere in your spreadsheet.

!$ntax
The synta3 has two (ariations% 1B=-(A>=5&=& tar/et field+ -ivot =a;le+ G )ield name / Blement+ ... H' 1B=-(A>=5&=& -ivot =a;le+ specification'

First s$ntax variation


The target field specifies which data field of the "i(ot Table is used within the function. Cf your "i(ot Table has only one data field' this entry is ignored' but you must enter it anyway. Cf your "i(ot Table has more than one data field' then you ha(e to enter the field name from the underlying data source $for e3ample KsalesL& or the field name of the data field itself $for e3ample Ksum X salesL&. The argument Pivot ,able specifies the "i(ot Table that you want to use. Ct is possible that your document contains more than one "i(ot Table. Dnter here a cell reference that is inside the area of your "i(ot Table. Ct might be a good idea to always use the upper left corner cell of your "i(ot Table' so you can be sure that the cell will always be within your "i(ot Table' e(en if the layout changes. D3ample% 1B=-(A>=5&=& ,sales,+&#' Cf you enter only the first two arguments' then the function returns the total result of the "i(ot Table $K,um X salesL entered as the field' will return a (alue of <0*'E@A&. You can add more arguments as pairs with field name and item to retrie(e specific partial sums. Cn the e3ample in 2igure 20<' where we want to get the partial sum of /ans for sailing' the formula in cell C1" would loo- li-e this% =1B=-(A>=5&=& ,sales,+&#+,emplo<ee,+,Ians,+,cate/or<,+,sailin/,'

'igure 98&: 'irst s2nta* variation

93-

LibreOffice ".# $alc Guide

!econd s$ntax variation


The argument Pivot ,able has to be gi(en in the same way as for the first synta3 (ariation. 2or the specifications' enter a list separated by spaces to specify the (alue you want from the "i(ot Table. This list must contain the name of the data field' if there is more than one data fieldN otherwise it is not re?uired. To select a specific partial result' add more entries in the form of )ield nameGitemH. Cn the e3ample in 2igure 20<' where we want to get the partial sum of /ans for ,ailing' the formula in cell C1" would loo- li-e this% =1B=-(A>=5&=& &#+,sales emplo<eeGIansH cate/or<Gsailin/H,'

'igure 98A: Second s2nta* variation 0hen wor-ing with data sets containing date information' you must ta-e care if you use the date information in the GDT"CB;T5)T) function. The function will only recogniFe the date entry if it is entered into the formula in e3actly the same way that it appears in the data set from which the pi(ot table is produced. Cn the e3ample of 2igure 20*' an error is returned when the date format does not match that of the data. ;nly with the correct format is the result returned.

'igure 98-: )rror produced if date information is not entered correctl2

Caution

4y using GDT"CB;T5)T) function with the second synta3 (ariation' not that which is used in the 2unction 0iFard' the function can return a hHD2 error. 4ug E123<

$hapter - Using Pivot (ables

93.

$hapter . Data ,nal2sis


Using Scenarios= Goal See4= Solver= others

ntroduction
;nce you are familiar with functions and formulas' the ne3t step is to learn how to use CalcIs automated processes to perform useful analysis of your data ?uic-ly. Calc includes se(eral tools to help you manipulate the information in your spreadsheets' ranging from features for copying and reusing data' to creating subtotals automatically' to (arying information to help you find the answers you need. These tools are di(ided between the Tools and 5ata menus. Cf you are a newcomer to spreadsheets' these tools can be o(erwhelming at first. /owe(er' they become simpler if you remember that they all depend on input from either a cell or a range of cells that contain the data with which you are wor-ing. You can always enter the cells or range manually' but in many cases it is easier to select the cells with the mouse. Clic- the ,hrin-/1a3imiFe icon beside a field to temporarily reduce the siFe of the toolIs window' so you can see the spreadsheet underneath and select the cells re?uired. ,ometimes' you may ha(e to e3periment to find out which data goes into which field' but then you can set a selection of options' many of which can be ignored in any gi(en case. .ust -eep the basic purpose of each tool in mind' and you should ha(e little trouble with CalcIs function tools. You donIt need to learn them' especially if your spreadsheet use is simple' but as your manipulation of data becomes more sophisticated' they can sa(e time in ma-ing calculations' especially as you start to deal with hypothetical situations. .ust as importantly' they can allow you to preser(e your wor- and to share it with other peoplecor yourself at a later session. ;ne function tool not mentioned here is "i(ot Table' but it is a topic that is sufficiently comple3 that it re?uires a separate chapter% see Chapter * in this boo-.

Consolidating data
%ata < Consolidate pro(ides a way to combine data from two or more ranges of cells into a new range while running one of se(eral functions $such as ,um or )(erage& on the data. 5uring consolidation' the contents of cells from se(eral sheets can be combined into one place. The effect is that copies of the identified ranges are stac-ed with their top left corners at the specified result position' and the selected operation is used in each cell to calculate the result (alue. 1& ;pen the document containing the cell ranges to be consolidated. 2& Choose %ata < Consolidate to open the Consolidate dialog. 2igure 20: shows this dialog after ma-ing the changes described below. 3& The +ource data range list contains any e3isting named ranges $created using %ata < %efine 3ange& so you can ?uic-ly select one to consolidate with other areas. Cf the source range is not named' clic- in the field to the right of the drop+down list and either type a reference for the first source data range or use the mouse to select the range on the sheet. $You may need to mo(e the Consolidate dialog or clic- on the ,hrin- icon to reach the re?uired cells.& <& Clic- Add. The selected range is added to the $onsolidation ranges list. A& ,elect additional ranges and clic- Add after each selection. @& ,pecify where you want to display the result by selecting a target range from the Copy results to drop+down list. Cf the target range is not named' clic- in the field ne3t to Copy results to and enter the reference of the target range or select the range using the mouse or position the cursor in the top left cell of the target range. $op2 results to ta-es only the first cell of the target range instead of the entire range as is the case for Source data range.

9"9

LibreOffice ".# $alc Guide

'igure 98.: Defining the data to be consolidated E& ,elect a function from the 2unction list. This specifies how the (alues of the consolidation ranges will be calculated. The default setting is ,um' which adds the corresponding cell (alues of the ,ource data range and gi(es the result in the target range. 1ost of the a(ailable functions are statistical $such as )(erage' 1in' 1a3' ,tde(&' and the tool is most useful when you are wor-ing with the same data o(er and o(er. *& )t this point you can clic- 4ore in the Consolidate dialog to access the following additional settings%

Cn the Options section' select 2ink to source data to insert the formulas that generate the results into the target range' rather than the actual results. Cf you lin- the data' any (alues modified in the source range are automatically updated in the target range.
The corresponding cell references in the target range are inserted in consecuti(e rows' which are automatically ordered and then hidden from (iew. ;nly the final result' based on the selected function' is displayed.

Caution

Cn the $onsolidate b2 section' select either 3ow labels or $olumn labels if the cells of the source data range are not to be consolidated corresponding to the identical position of the cell in the range' but instead according to a matching row label or column label. To consolidate by row labels or column labels' the label must be contained in the selected source ranges. The te3t in the labels must be identical' so that rows or columns can be accurately matched. Cf the row or column label of one source data range does not match any that e3ist in other source data ranges' it is added to the target range as a new row or column.

:& Clic- =6 to consolidate the ranges.

,ip

Cf you are continually wor-ing with the same range' then you probably want to use 5ata e 5efine Hange to gi(e it a name.

The consolidation ranges and target range are sa(ed as part of the document. Cf you later open a document in which consolidation has been defined' this data is still a(ailable.
$hapter . Data ,nal2sis 9"3

Creating subtotals
,ubtotals are implemented in two ways%

The ,!4T;T)# function %ata < +ubtotals from the menu bar.

*sing the +*7,=,A2 function


,!4T;T)# is listed under the 1athematical category when you use the 2unction 0iFard $ nsert < Function or press $trl5'9&. This function is a relati(ely limited method for generating a subtotal. To obtain a subtotal for our sales information for the employee 4rigitte' we must first implement an )uto2ilter on the data $%ata < Filter < AutoFilter&. This displays the selection arrows to the right of each column headerN select 4rigitte in the Dmployee field as shown in 2igure 210.

'igure 9#8: ,uto'ilter applied and Brigitte selected in the )mplo2ee column 1& ,elect the location for the subtotal to be displayed by clic-ing in the chosen cell. 2& ,elect nsert < Function from the 1enu bar' or clic- the 2unction 0iFard button on the 2unction 4ar' or press $trl5'9 to open the 2unction 0iFard. 3& ,elect ,!4T;T)# from the function list in the 2unction 0iFard dialog and clic- ?e.t<< at the bottom of the dialog. <& Dnter the re?uired information into the two input bo3es as shown in 2igure 211. The range is selected from the filtered data' and the function is selected from the list of a(ailable possible functions as shown in the /elp file e3tract of 2igure 212. Cn our e3ample we select the sales figures $column 4& and we re?uire the sum total $function inde3 :&. A& Clic- =6 to return the summed (alues of 4rigitteIs sales $2igure 213&.
9"" LibreOffice ".# $alc Guide

'igure 9##: )nter the information into the two input bo*es

'igure 9#9: 'unction inde*es for available functions

'igure 9#3: SUB(O(,L result for BrigitteJs sales


$hapter . Data ,nal2sis 9"%

You will appreciate that this is a tedious and time consuming e3ercise for a sales report if you want to subtotal for more than a couple of categories.

*sing %ata < +ubtotals


) more comprehensi(e solution is to create subtotals using %ata < +ubtotals from the 1enu bar' which opens the ,ubtotals dialog. ,ubtotal creates totals for data arranged in an arraycthat is' a group of cells with labels for columns. !sing the ,ubtotals dialog' you can select up to three arrays' then choose a statistical function to apply to them. 0hen you clic- =6' Calc adds subtotal and grand total rows to the selected arrays' using the Hesult and Hesult2 cell styles to differentiate those entries. 4y default' matching items throughout your array will be gathered together as a single group abo(e a subtotal. To insert subtotal (alues into a sheet% 1& Dnsure that the columns ha(e labels $we will use our sales data e3ample again&. 2& ,elect' or clic- in a single cell in the range of cells that you want to calculate subtotals for' and then choose %ata < +ubtotals. 3& Cn the ,ubtotals dialog $2igure 21<&' in the (roup by list' select the column by which the subtotals need to be grouped. ) subtotal will be calculated for each distinct (alue in this column. <& Cn the Calculate subtotals for bo3' select the columns containing the (alues that you want to create subtotals for. Cf the contents of the selected columns change later' the subtotals are automatically recalculated. A& Cn the *se function bo3' select the function that you want to use to calculate the subtotals. @& You can create a further two (roup by subtotals using the 2nd Group and 3rd Group tabs and repeating steps 3 to A. E& Clic- =6.

'igure 9#": Setting up subtotals ) partial (iew of the results using our e3ample data is shown in 2igure 21A. ,ubtotals for ,ales by Dmployee and Category were used Calc inserts' to the left of the row numbering labels' an outline area that graphically represents the structure of the subtotals. umber 1 represents the highest le(el of grouping' the Grand Total. umbers 2 to < show reducing grouping le(els' with number < showing indi(idual entries. The number of le(els depends on the number of groupings in the subtotals.
9"& LibreOffice ".# $alc Guide

'igure 9#%: Subtotals are calculated for each emplo2ee 6partial view7 using the 1st Group and @nd Group Clic-ing on a number at the top of the column shrin-s the structure of that element of the subtotal. 2or column 1' this changes the minus button in the column to one with a plus symbol' indicating that it is e3pandable. 2or column 2 and others with content' each element of the column shrin-s' and each button changes to a plus. 2or our e3ample subtotal displayed in 2igure 21A' the structure which is displayed is Column 1 is the Grand (otal' column 2 is the )mplo2ee subtotal' and column 3 is the $ategor2 subtotal. 2or column 2' and for others if you ha(e more groups' you can also clic- each indi(idual minus button to shrin- only that subtotal. Cf you clic- on the numbered button at the top' you must then clic- on the resultant plus buttons to e3pand the structure again $see 2igure 21@&. ,hrin-ing any element' temporarily hides any element contained in a column to its right. Cn 2igure 21@ Cndi(idual entries are hidden by shrin-ing the Category subtotals for 4rigitte. To turn off outlines' select %ata < (roup and =utline < 3emove from the 1enu bar. ,elect Auto=utline to reinstate the outlines.

'igure 9#&: $lic4 the plus buttons to e*pand the elements again
$hapter . Data ,nal2sis 9"A

2urther choices are a(ailable in the ;ptions page of the ,ubtotals dialog. Cn the Groups section%

,electing Page break between groups inserts a new page after each group of subtotaled
data.

,electing Case sensitive recalculates subtotals when you change the case of a data label. ,electing the "re+sort area according to groups option sorts the area that you selected in
the (roup by bo3 of the Group tabs according to the columns that you selected. Cn the Sort section%

,electing Ascending or %escending' sorts beginning with the lowest or the highest (alue.
You can define the sort rules on %ata < +ort < =ptions.

,electing nclude formats option gi(es consideration to the formatting attributes when
sorting.

,electing Custom sort order sorts according to one of the predefined custom sorts defined
in ,ools < =ptions < 2ibre=ffice Calc < +ort 2ists.

'igure 9#A: $hoosing options for subtotals

*sing Uwhat ifV scenarios


The ,cenario is a tool to test Kwhat+ifL ?uestions. Dach scenario is named' and can be edited and formatted separately. 0hen you print the spreadsheet' only the contents of the currently acti(e scenario are printed. ) scenario is essentially a sa(ed set of cell (alues for your calculations. You can easily switch between these sets using the a(igator or a drop+down list which can be shown beside the changing cells. 2or e3ample' if you wanted to calculate the effect of different interest rates on an in(estment' you could add a scenario for each interest rate' and ?uic-ly (iew the results. 2ormulas that rely on the (alues changed by your scenario are updated when the scenario is opened. Cf all your sources of income used scenarios' you could efficiently build a comple3 model of your possible income.

9"-

LibreOffice ".# $alc Guide

Creating scenarios
,ools < +cenarios opens a dialog with options for creating a scenario. To create a new scenario% 1& ,elect the cells that contain the (alues that will change between scenarios. To select multiple ranges' hold down the $trl -ey as you clic-. You must select at least two cells. 2& Choose ,ools < +cenarios. 3& ;n the Create ,cenario dialog $2igure 21*&' enter a name for the new scenario. CtIs best to use a name that clearly identifies the scenario' not the default name as shown in the illustration. This name is displayed in the a(igator and in the title bar of the border around the scenario on the sheet itself.

'igure 9#-: $reating a scenario <& ;ptionally add some information to the Comment bo3. The e3ample shows the default comment. This information is displayed in the a(igator when you clic- the ,cenarios icon and select the desired scenario. A& ;ptionally select or deselect the options in the Settings section. ,ee below for more information about these options. @& Clic- =6 to close the dialog. The new scenario is automatically acti(ated. You can create se(eral scenarios for any gi(en range of cells.

+ettings
The lower portion of the Create ,cenario dialog contains se(eral options. The default settings $as shown in 2igure 21*& are li-ely to be suitable in most situations. %isplay border "laces a border around the range of cells that your scenario alters. To choose the color of the border' use the field to the right of this option. The border has a title bar displaying the name of the acti(e scenario. Clic- the arrow button to the right of the scenario name to open a drop+ down list of all the scenarios that ha(e been defined for the cells within the border. You can choose any of the scenarios from this list at any time.
$hapter . Data ,nal2sis 9".

Copy back Copies any changes you ma-e to the (alues of scenario cells bac- into the acti(e scenario. Cf you do not select this option' the sa(ed scenario (alues are ne(er changed when you ma-e changes. The actual beha(ior of the Copy back setting depends on the cell protection' the sheet protection' and the Prevent changes setting $see Table 12 on page 2A0&.
Cf you are (iewing a scenario which has Copy back enabled and then create a new scenario by changing the (alues and selecting ,ools < +cenarios' you also inad(ertently o(erwrite the (alues in the first scenario. This is easily a(oided if you lea(e the current (alues alone' create a new scenario with Copy back enabled' and then change the (alues only when you are (iewing the new scenario.

Caution

Copy entire sheet )dds to your document a sheet that permanently displays the new scenario in full. This is in addition to creating the scenario and ma-ing it selectable on the original sheet as normal. Prevent changes "re(ents changes to a scenario enabled as a $op2 bac4' when the sheet is protected but the cells are not. )lso pre(ents changes to the settings described in this section while the sheet is protected. ) fuller e3planation of the effect this option has in different situations is gi(en below.

Changing scenarios
,cenarios ha(e two aspects that can be altered independently%

,cenario properties $the settings described abo(e& ,cenario cell (alues $the entries within the scenario border&
The e3tent to which either of these aspects can be changed is dependent upon both the e3isting properties of the scenario and the current protection state of the sheet and cells.

C"an%in% scenario properties


Cf the sheet is protected $,ools < Protect %ocument < +heet&' and Prevent changes is selected then scenario properties cannot be changed. Cf the sheet is protected' and Prevent changes is not selected' then all scenario properties can be changed e3cept Prevent changes and Copy entire sheet' which are disabled. Cf the sheet is not protected' then Prevent changes does not ha(e any effect' and all scenario properties can be changed.

C"an%in% scenario cell values


Table 12 summariFes the interaction of (arious settings in pre(enting or allowing changes in scenario cell (alues. (able #9: Prevent changes behavior for scenario cell value changes !ettin%s
,heet protection ; ,cenario cell protection ;22 "re(ent changes ; Copy bac- ;

C"an%e allowed
,cenario cell (alues cannot be changed.

9%8

LibreOffice ".# $alc Guide

!ettin%s
,heet protection ; ,cenario cell protection ;22 "re(ent changes ;22 Copy bac- ; ,heet protection ; ,cenario cell protection ;22 "re(ent changes ; or ;22 Copy bac- ;22 ,heet protection ; ,cenario cell protection ; "re(ent changes ) Y ,DTTC G Copy bac- ) Y ,DTTC G ,heet protection ;22 ,cenario cell protection ) Y ,DTTC G "re(ent changes ) Y ,DTTC G Copy bac- ) Y ,DTTC G

C"an%e allowed
,cenario cell (alues can be changed' and the scenario is updated.

,cenario cell (alues can be changed' but the scenario is not updated due to the Copy bacsetting.

,cenario cell (alues cannot be changed.

,cenario cell (alues can be changed and the scenario is updated or not' depending on the Copy bac- setting.

8orking with scenarios using the ?avigator


)fter scenarios are added to a spreadsheet' you can Gump to a particular scenario by selecting it from the list in the a(igator. Clic- the +cenarios icon in the a(igator $see Drror% Heference source not found&. The defined scenarios are listed' along with the comments that were entered when the scenarios were created.

'igure 9#.: Scenarios in the @avigator To apply a scenario to the current sheet' double+clic- the scenario name in the a(igator. To delete a scenario' right+clic- the name in the a(igator and choose %elete. To edit a scenario' including its name and comments' right+clic- the name in the a(igator and choose Properties. The Ddit "roperties dialog is the same as the Create ,cenario dialog $2igure 21*&.
$hapter . Data ,nal2sis 9%#

,racking values in scenarios


To learn which (alues in the scenario affect other (alues' choose ,ools < %etective < ,race %ependents. )rrows point to the cells that are directly dependent on the current cell.

*sing other Uwhat ifV tools


#i-e scenarios' %ata < 4ultiple =perations is a planning tool for Kwhat ifL ?uestions. !nli-e a scenario' the 1ultiple ;perations tool does not present the alternate (ersions in the same cells or with a drop+down list. Cnstead' the 1ultiple ;perations tool creates a formula array% a separate set of cells showing the results of applying the formula to a list of alternati(e (alues for the (ariables used by the formula. )lthough this tool is not listed among the functions' it is really a function that acts on other functions' allowing you to calculate different results without ha(ing to enter and run them separately. To use the 1ultiple ;perations tool' you need two arrays of cells. The first array contains the original or default (alues and the formulas applied to them. The formulas must be in a range. The second array is the formula array. Ct is created by entering a list of alternati(e (alues for one or two of the original (alues. ;nce the alternati(e (alues are created' you use the 1ultiple ;perations tool to specify which formulas you are using' as well as the original (alues used by the formulas. The second array is then filled with the results of using each alternati(e (alue in place of the original (alues. The 1ultiple ;perations tool can use any number of formulas' but only one or two (ariables. 0ith one (ariable' the formula array of alternati(e (alues for the (ariables will be in a single column or row. 0ith two (ariables' you should outline a table of cells such that the alternati(e (alues for one (ariable are arranged as column headings' and the alternati(e (alues for the other (ariable act as row headings. ,etting up multiple operations can be confusing at first. 2or e3ample' when using two (ariables' you need to select them carefully' so that they form a meaningful table. ot e(ery pair of (ariables is useful to add to the same formula array. Yet' e(en when wor-ing with a single (ariable' a new user can easily ma-e mista-es or forget the relationships between cells in the original array and cells in the formula array. Cn these situations' ,ools < %etective can help to clarify the relations. You can also ma-e formula arrays easier to wor- with if you apply some simple design logic. "lace the original and the formula array close together on the same sheet' and use labels for the rows and columns in both. These small e3ercises in organiFational design ma-e wor-ing with the formula array much less painful' particularly when you are correcting mista-es or adGusting results.
Cf you e3port a spreadsheet containing multiple operations to 1icrosoft D3cel' the location of the cells containing the formula must be fully defined relati(e to the data range.

?ote

4ultiple operations in columns or rows


Cn your spreadsheet' enter a formula to calculate a result from (alues that are stored in other cells. Then' set up a cell range containing a list of alternati(es for one of the (alues used in the formula. The 4ultiple =perations command produces a list of results adGacent to your alternati(e (alues by running the formula against each of these alternati(es.

9%9

LibreOffice ".# $alc Guide

?ote

4efore you choose the %ata < 4ultiple =perations option' be sure to select not only your list of alternati(e (alues but also the adGacent cells into which the results should be placed.

Cn the 'ormulas field of the 1ultiple ;perations dialog' enter the cell reference to the formula that you wish to use. The arrangement of your alternati(e (alues dictates how you should complete the rest of the dialog. Cf you ha(e listed them in a single column' you should complete the field for $olumn input cell. Cf they are along a single row' complete the 3ow input cell field. You may also use both in more ad(anced cases. 4oth single and double+(ariable (ersions are e3plained below. The abo(e can be e3plained best by e3amples. Cell references correspond to those in the following figures. #etIs say you produce toys that you sell for g10 each $cell 41&. Dach toy costs g2 to ma-e $cell 42&' in addition to which you ha(e fi3ed costs of g10'000 per year $cell 43&. /ow much profit will you ma-e in a year if you sell a particular number of toys=

Calculatin% wit" one for(ula and one variable


1& To calculate the profit' first enter any number as the ?uantity $items sold&N in this e3ample' 2000 $cell 4<&. The profit is found from the formula ProfitNCuantit2 S 6Selling price E Direct costs7 E 'i*ed costs. Dnter this formula in 4A% =B4*(B1-B2)-B3. 2& Cn column 5 enter a (ariety of alternati(e annual sales figures' one below the otherN for e3ample' A00 to A000' in steps of A00. 3& ,elect the range 52%D11' and thus the (alues in column 5 and the empty cells $which will recei(e the results of the calculations& alongside in column D. <& Choose %ata < 4ultiple =perations. A& 0ith the cursor in the 'ormulas field of the 1ultiple operations dialog' clic- cell 4A. @& ,et the cursor in the $olumn input cell field and clic- cell 4<. This means that 4<' the ?uantity' is the (ariable in the formula' which is to be replaced by the column of alternati(e (alues. 2igure 220 shows the wor-sheet and the 1ultiple operations dialog. E& Clic- =6. The profits for the different ?uantities are now shown in column D. ,ee 2igure 221.
You may find it easier to mar- the re?uired reference in the sheet if you clic- the ,hrin- icon to reduce the 1ultiple operations dialog to the siFe of the input field. The icon then changes to the 1a3imiFe iconN clic- it to restore the dialog to its original siFe.

,ip

$hapter . Data ,nal2sis

9%3

'igure 998: Sheet and :ultiple operations dialog showing input

'igure 99#: Sheet showing results of multiple operations calculations

Calculatin% wit" several for(ulas si(ultaneousl$


1& Cn the sheet from the pre(ious e3ample' delete the contents of column D. 2& Dnter the following formula in CA% =B5/B4. You are now calculating the annual profit per item sold. 3& ,elect the range 52%211' thus three columns. <& Choose %ata < 4ultiple =perations.

9%"

LibreOffice ".# $alc Guide

A& 0ith the cursor in the 'ormulas field of the 1ultiple operations dialog' select cells 4A and CA. @& ,et the cursor in the $olumn input cell field and clic- cell 4<. 2igure 222 shows the wor-sheet and the 1ultiple operations dialog.

'igure 999: Sheet and dialog showing input E& Clic- =6. ow the profits are listed in column D and the annual profit per item in column 2.

'igure 993: 3esults of multiple operations calculations

4ultiple operations across rows and columns


You can carry out multiple operations simultaneously for both columns and rows in so+called cross+ tables. The formula must use at least two (ariables' the alternati(e (alues for which should be arranged so that one set is along a single row and the other set appears in a single column. These

$hapter . Data ,nal2sis

9%%

two sets of alternati(e (alues will form column and row headings for the results table produced by the 1ultiple ;perations procedure. ,elect the range defined by both data ranges $thus including all of the blan- cells that are to contain the results& and choose %ata < 4ultiple operations. Dnter the cell reference to the formula in the 'ormulas field. The 3ow input cell and the $olumn input cell fields are used to enter the reference to the corresponding cells of the formula.

Caution

4eware of entering the cell reference of a (ariable into the wrong field. The How input cell field should contain not the cell reference of the (ariable which changes down the rows of your results table' but that of the (ariable whose alternati(e (alues ha(e been entered along a single row.

Calculatin% wit" two variables


You now want to (ary not Gust the ?uantity produced annually' but also the selling price' and you are interested in the profit in each case. D3pand the table shown in 2igure 222. 52 thru 511 already contain the numbers A00' 1000 and so on' up to A000. Cn D1 through /1 enter the numbers *' 10' 1A and 20. 1& ,elect the range 51%/11. 2& Choose %ata < 4ultiple =perations.

'igure 99": Sheet and dialog showing input 3& 0ith the cursor in the 'ormulas field of the 1ultiple operations dialog' clic- cell 4A $profit&. <& ,et the cursor in the 3ow input cell field and clic- cell 41. This means that 41' the selling price' is the horiFontally entered (ariable $with the (alues *' 10' 1A and 20&. A& ,et the cursor in the $olumn input cell field and clic- cell 4<. This means that 4<' the ?uantity' is the (ertically entered (ariable. @& Clic- =6. The profits for the different selling prices are now shown in the range D2%/11 $,ee 2igure 22A&.

9%&

LibreOffice ".# $alc Guide

'igure 99%: 3esults of multiple operations calculations

8orking backwards using (oal +eek


!sually' you create a formula to calculate a result based upon e3isting (alues. 4y contrast' using ,ools < (oal +eek you can disco(er what (alues will produce the result that you want. To ta-e a simple e3ample' imagine that the Chief 2inancial ;fficer of a company is de(eloping sales proGections for each ?uarter of the forthcoming year. ,he -nows what the companyIs total income must be for the year to satisfy stoc-holders. ,he also has a good idea of the companyIs income in the first three ?uarters' because of the contracts that are already signed. 2or the fourth ?uarter' howe(er' no definite income is a(ailable. ,o how much must the company earn in J< to reach its goal= The C2; can enter the proGected earnings for each of the other three ?uarters along with a formula that totals all four ?uarters. Then she runs a goal see- on the empty cell for J< sales' and recei(es her answer. ;ther uses of goal see- may be more complicated' but the method remains the same. ;nly one argument can be altered in a single goal see-.

(oal +eek e.ample


To calculate annual interest $C&' create a table with the (alues for the capital $C&' number of years $n&' and interest rate $i&. The formula is I = C*n*i. #et us assume that the interest rate i of E.Ad and the number of years n $1& will remain constant. /owe(er' you want to -now how much the in(estment capital C would ha(e to be modified in order to attain a particular return C. 2or this e3ample' calculate how much capital C would be re?uired if you want an annual return of g1A'000. Dnter each of the (alues mentioned abo(e into adGacent cells $for Capital' C' an arbitrary (alue li-e g100'000 or it can be left blan-N for number of years' n' 1N for interest rate' i' E.Ad&. Dnter the formula to calculate the interest' C' in another cell. Cnstead of C' n' and i' use the reference to the cell with the corresponding (alue. Cn our e3ample $2igure 22@&' this would be Y41Z42Z43. 1& "lace the cursor in the formula cell $4<&' and choose ,ools < (oal +eek. 2& Cn the Goal ,ee- dialog' the correct cell is already entered in the 'ormula cell field. 3& "lace the cursor in the Hariable cell field. Cn the sheet' clic- in the cell that contains the (alue to be changed' in this e3ample it is 41. <& Dnter the desired result of the formula in the (arget value field. Cn this e3ample' the (alue is 15000. 2igure 22@ shows the cells and fields.

$hapter . Data ,nal2sis

9%A

'igure 99&: )*ample setup for goal see4 A& Clic- =6. ) dialog appears informing you that the Goal ,ee- was successful. Clic- Ies to enter the goal (alue into the (ariable cell. The result is shown below indicating a capital re?uirement of g200'000 is needed to achie(e g1A'000 annual return.

'igure 99A: 3esult of goal see4 operation

*sing the +olver


,ools < +olver amounts to a more elaborate form of Goal ,ee-. The difference is that the ,ol(er deals with e?uations with multiple un-nown (ariables. Ct is specifically designed to minimiFe or ma3imiFe the result according to a set of rules that you define. Dach of these rules defines whether an argument in the formula should be greater than' less than' or e?ual to the figure you enter. Cf you want the argument to remain unchanged' you must enter a rule that specifically states that the cell should be e?ual to its current entry. 2or arguments that you would li-e to change' you need to add two rules to define a range of possible (alues% the limiting conditions. 2or e3ample' you can set the constraint that one of the (ariables or cells must not be bigger than another (ariable' or not bigger than a gi(en (alue. You can also define the constraint that one or more (ariables must be integers $(alues without decimals&' or binary (alues $where only 0 and 1 are allowed&. ;nce you ha(e finished setting up the rules' clic- the +olve button to begin the automatic process of adGusting (alues and calculating results. 5epending on the comple3ity of the tas-' this may ta-e some time.

9%-

LibreOffice ".# $alc Guide

+olver e.ample
#etIs say you ha(e g10'000 that you want to in(est in two mutual funds for one year. 2und Q is a low ris- fund with *d interest rate and 2und Y is a higher ris- fund with 12d interest rate. /ow much money should be in(ested in each fund to earn a total interest of g1000= To find the answer using ,ol(er% 1& Dnter labels and data%

How labels% Fund X' Fund

' and !"!a#' in cells )2 thru )<.

Column labels% in!$r$%! $arn$d' a&"un! in'$%!$d' in!$r$%! ra!$' and !i&$ ($ri"d' in cells 41 thru D1. Cnterest rates% ) and 12' in cells 52 and 53. Time period% 1' in cells D2 and D3. Total amount in(ested% 10000' in cell C<. Dnter an arbitrary (alue $0 or lea(e blan-& in cell C2 as amount in(ested in 2und Q. Cn cell C3' enter the formula C4*C2 $total amount X amount in(ested in 2und Q& as the amount in(ested in 2und Y. Cn cells 42 and 43' enter the formula for calculating the interest earned $see 2igure 22*&. Cn cell 4<' enter the formula B2+B3 as the total interest earned.

2& Dnter formulas%

'igure 99-: )*ample setup for Solver 3& Choose ,ools < +olver. The ,ol(er dialog $2igure 22:& opens. <& Clic- in the (arget cell field. Cn the sheet' clic- in the cell that contains the target (alue. Cn this e3ample it is cell 4< containing total interest (alue. A& ,elect Halue of and enter 1000 in the field ne3t to it. Cn this e3ample' the target cell (alue is 1000 because your target is a total interest earned of g1000. ,elect :a*imum or :inimum if the target cell (alue needs to be one of those e3tremes. @& Clic- in the B2 changing cells field and clic- on cell C2 in the sheet. Cn this e3ample' you need to find the amount in(ested in 2und Q $cell C2&. E& Dnter limiting conditions for the (ariables by selecting the $ell reference= Operator and Halue fields. Cn this e3ample' the amount in(ested in 2und Q $cell C2& should not be greater than the total amount a(ailable $cell C<& and should not be less than 0. *& Clic- =6. ) dialog appears informing you that the ,ol(ing successfully finished. Clic- 6eep 3esult to enter the result in the cell with the (ariable (alue. The result is shown in 2igure 230.

$hapter . Data ,nal2sis

9%.

'igure 99.: (he Solver dialog

'igure 938: 3esult of Solver operation

9&8

LibreOffice ".# $alc Guide

$hapter #8 Lin4ing $alc Data


Sharing data in and out of $alc

8hy use multiple sheets9


Chapter 1 introduced the concept of multiple sheets $also called wor-sheets& in a spreadsheet. 1ultiple sheets help -eep information organiFedN once you lin- those sheets together' you unleash the full power of Calc. Consider this case. .ohn is ha(ing trouble -eeping trac- of his personal finances. /e has se(eral banaccounts and the information is scattered and disorganiFed. /e canIt get a good grasp on his finances until he can see e(erything at once. To resol(e this' .ohn decided to trac- his finances in #ibre;ffice Calc. .ohn -nows Calc can do simple mathematical computations to help him -eep a running tab of his accounts' and he wants to set up a summary sheet so that he can see all of his account balances at once. This can be accomplished easily.

?ote

2or users with e3perience using 1icrosoft D3cel% what D3cel calls a wor4boo4' Calc calls a spreadsheet $the whole document&. 4oth D3cel and Calc use the terms sheet and wor4sheet.

+etting up multiple sheets


Chapter 1 gi(es a detailed e3planation of how to set up multiple sheets in a spreadsheet. /ere is a ?uic- re(iew.

dentifying sheets
0hen you open a new spreadsheet it has' by default' one sheet named Sheet#' unless you ha(e specified a different number of sheets or a different "refi3 name for wor-sheets in ,ools < =ptions < 2ibre=ffice Calc < %efaults.

0or-sheets in Calc are managed using tabs at the bottom of the spreadsheet.

nserting new sheets


There are se(eral ways to insert a new sheet. The fastest method is to clic- on the )dd ,heet button . This inserts one new sheet at that point' without opening the Cnsert ,heet dialog. !se one of these other methods to insert more than one sheet' to rename the sheet at the same time' or to insert the sheet somewhere else in the se?uence. The first step for these methods is to select the sheet that the new sheet will be inserted ne3t to. Then do any one of the following%

,elect nsert < +heet from the menu bar.

9&9

LibreOffice ".# $alc Guide

Hight+clic- on the tab and select nsert +heet. Clic- in an empty space at the end of the line of sheet tabs.

'igure 93#: $reating a new sheet Dach method opens the Cnsert ,heet dialog. /ere you can choose to put the new sheet before or after the selected sheet' how many sheets to insert' and what to name a single sheet. $2or the 'rom file option' see the ne3t section.&

'igure 939. 0nsert Sheet dialog 0e need si3 sheets' one for each of the fi(e accounts and one as a summary sheet' so we will add three more. 0e also want to name each of these sheets for the account they represent% ,ummary' Chec-ing )ccount' ,a(ings )ccount' Credit Card 1' Credit Card 2' and Car #oan. 0e ha(e two choices% insert three new sheets and rename all si3 sheets afterwardsN or rename the e3isting sheets' then insert the three new sheets one at a time' renaming each new sheet during the insert step. To insert sheets and rename afterwards% 1& Cn the Cnsert ,heet dialog' choose the position for the new sheets $in this e3ample' we use After current sheet&. 2& Choose ?ew sheet and ' as the @o. of sheets. $Three sheets are already pro(ided by default.& 4ecause you are inserting more than one sheet' the @ame bo3 is not a(ailable. 3& Clic- =6 to insert the sheets. <& 2or the ne3t steps' go to KHenaming sheetsL below.

$hapter #8 Lin4ing $alc Data

9&3

To insert sheets and name them at the same time% 1& Hename the e3isting sheets ,ummary' Chec-ing )ccount' and ,a(ings )ccount' as described in KHenaming sheetsL below. 2& Cn the Cnsert ,heet dialog' choose the position for the first new sheet. 3& Choose ?ew sheet and 1 as the @o. of sheets. The @ame bo3 is now a(ailable. <& Cn the ?ame bo3' type a name for this new sheet' for e3ample Cr$di! Card 1. A& Clic- =6 to insert the sheet. @& Hepeat steps 1X< for each new sheet' gi(ing them the names Credit Card 2 and Car #oan.

nserting sheets from a different spreadsheet


;n the Cnsert ,heet dialog' you can also add a sheet from a different spreadsheet file $for e3ample' another Calc or D3cel spreadsheet&' by choosing the From file option. Clic- 7rowse and select the fileN a list of the a(ailable sheets appears in the bo3. ,elect the sheet to import. Cf' after you select the file' no sheets appear' you probably selected an in(alid file type $not a spreadsheet' for e3ample&.

,ip

2or a shortcut to inserting a sheet from another file' choose nsert < +heet from file from the menu bar. The Cnsert ,heet dialog opens with the From file option preselected' and then the Cnsert dialog opens on top of it.

Cf you prefer' select the 2ink option to insert the e3ternal sheet as a lin- instead as a copy. This is one of se(eral ways to include Kli(eL data from another spreadsheet. $,ee also K#in-ing to e3ternal dataL on page 2E1.& The lin-s can be updated manually to show the current contents of the e3ternal fileN or' depending on the options you ha(e selected in ,ools < =ptions < 2ibre=ffice Calc < (eneral < *pdating' whene(er the file is opened.

3enaming sheets
,heets can be renamed at any time. To gi(e a sheet a more meaningful name%

Dnter the name in the name bo3 when you create the sheet' or 5ouble clic- on the sheet tab' or Hight+clic- on a sheet tab' select 3ename +heet from the conte3t menu and replace the
e3isting name.
Cf you want to sa(e the spreadsheet to 1icrosoft D3cel format' the following characters are not allowed in sheet names% m / = Z V W % and > as the first or last character of the name.

?ote

Your sheet tab area should now loo- li-e this.

'igure 933: Si* renamed sheets ow we will set up the account ledgers. This is Gust a simple summary that includes the pre(ious balance plus the amount of the current transaction. 2or withdrawals' we enter the current transaction as a negati(e number so the balance gets smaller. ) basic ledger is shown in 2igure 23<.
9&" LibreOffice ".# $alc Guide

This ledger is set up in the sheet named $hec4ing ,ccount. The total balance is added up in cell 23. You can see the e?uation for it in the formula bar. Ct is the summary of the opening balance' cell C3' and all of the subse?uent transactions.

'igure 93": $hec4ing ledger

3eferencing other sheets


;n the Summar2 sheet we display the balance from each of the other sheets. Cf you copy the e3ample in 2igure 23< onto each account' the current balances will be in cell 23 of each sheet. There are two ways to reference cells in other sheets% by entering the formula directly using the -eyboard or by using the mouse. 0e will loo- at the mouse method first.

Creating the reference with the mouse


;n the Summar2 sheet' set up a place for all fi(e account balances' so we -now where to put the cell reference. 2igure 23A shows a summary sheet with a blan- 4alance column. 0e want to place the reference for the chec-ing account balance in cell 43.

'igure 93%: Blan4 summar2 To ma-e the cell reference in cell 43' select the cell and follow these steps% 1& Clic- on the S icon ne3t to the input line. The icons change and an e?uals sign appears in the input line as in 2igure 23@.

$hapter #8 Lin4ing $alc Data

9&%

'igure 93&: )Kual sign in input line 2& ow' clic- on the sheet tab for the sheet containing the cell to be referenced. Cn this case' that is the $hec4ing ,ccount sheet as shown in 2igure 23E.

'igure 93A: $lic4 on the chec4ing account tab 3& Clic- on cell 23 $where the balance is& in the $hec4ing ,ccount sheet. The phrase :4hecJin/ &ccount:.)% should appear in the input line as in 2igure 23* and the selected cell is bordered in red.

'igure 93-: $ell reference selected <& Clic- the green chec-mar- in the input line' or press the -eyboard )nter -ey to finish. A& The Summar2 sheet should now loo- li-e 2igure 23:.

'igure 93.: 'inished chec4ing account reference

9&&

LibreOffice ".# $alc Guide

Creating the reference with the keyboard


2rom 2igure 23:' you can deduce how the cell reference is constructed. The reference has two parts% the sheet name $T$hec4ing ,ccountU& and the cell reference $'3&. otice that they are separated by a period.

?ote

The sheet name is in single ?uotes because it contains a space' and the mandatory period $.& always falls outside any ?uotes.

,o' you can fill in the ,a(ings )ccount cell reference by Gust typing it in. )ssuming that the balance is in the same cell $'3& in the Savings ,ccount sheet' the cell reference should be =:Savin/s &ccount:.)% $see 2igure 2<0&.

'igure 9"8: Savings account reference

3eferencing other documents


.ohn decides to -eep his family account information in a different spreadsheet file from his own summary. 2ortunately Calc can lin- different files together. The process is the same as described for different sheets in a single spreadsheet' but we add one more step to indicate which file the sheet is in.

Creating the reference with the mouse


To create the reference with the mouse' both spreadsheets need to be open. ,elect the cell in which the formula is going to be entered. 1& Clic- the S icon ne3t to the input line. 2& ,witch to the other spreadsheet $the process to do this will (ary depending on which operating system you are using&. 3& ,elect the sheet $Savings ,ccount& and then the reference cell $'3&. ,ee 2igure 2<1. The -eyboard )nter -ey can be pressed at this point' or continue with steps < and A. <& ,witch bac- to the original spreadsheet. A& Clic- on the green chec- mar- on the input line. Your spreadsheet should now resemble 2igure 2<2.

$hapter #8 Lin4ing $alc Data

9&A

'igure 9"#: Selecting the savings account reference cell

'igure 9"9: Lin4ed files You will get a good feel for the format of the reference if you loo- closely at the input line. 4ased on this line you can create the reference using the -eyboard.

Creating the reference with the keyboard


Typing the reference is simple once you -now the format the reference ta-es. The reference has three parts to it%

"ath and file name ,heet name Cell


2rom 2igure 2<2' you can see the the general format for the reference is =:file:///-ath 3 )ile .ame:#KSheet.ame.4ell.ame

?ote

The reference for a file has three forward slashes hyperlin- has two forward slashes .

and the reference for a

;yperlinks and *32s


/yperlin-s can be used in Calc to Gump to a different location from within a spreadsheet and can lead to other parts of the current file' to different files or e(en to web sites.

3elative and absolute hyperlinks


/yperlin-s can be stored within your file as either relati(e or absolute. ) relati(e hyperlin- says' +ere is how to get there starting from where 2ou are now $meaning from the folder in which your current document is sa(ed& while an absolute hyperlin- says' +ere is how to get there no matter where 2ou start from.
9&LibreOffice ".# $alc Guide

)n absolute lin- will stop wor-ing only if the target is mo(ed. ) relati(e lin- will stop wor-ing only if the start and target locations change relati(e to each other. 2or instance' if you ha(e two spreadsheets in the same folder lin-ed to each other and you mo(e the entire folder to a new location' a relati(e hyperlin- will not brea-. To change the way that #ibre;ffice stores the hyperlin-s in your file' select ,ools < =ptions < 2oadH+ave < (eneral and choose if you want !H#s sa(ed relati(ely when referencing the 'ile S2stem' or the 0nternet' or both. Calc will always display an absolute hyperlin-. 5onIt be alarmed when it does this e(en when you ha(e sa(ed a relati(e hyperlin-cthis MabsoluteI target address will be updated if you mo(e the file.
1a-e sure that the folder structure on your computer is the same as the file structure on your web ser(er if you sa(e your lin-s as relati(e to the file system and you are going to upload pages to the Cnternet.

?ote

,ip

0hen you rest the mouse pointer on a hyperlin-' a help tip displays the absolute reference' since #ibre;ffice uses absolute path names internally. The complete path and address can only be seen when you (iew the result of the /T1# e3port $sa(ing the spreadsheet as an /T1# file&' by loading the /T1# file as Te3t' or by opening it with a te3t editor.

Creating hyperlinks
0hen you type te3t that can be used as a hyperlin- $such as a website address or !H#&' Calc formats it automatically' creating the hyperlin- and applying to the te3t a color and bac-ground shading. Cf this does not happen' you can enable this feature using ,ools < AutoCorrect =ptions < =ptions and selecting *32 3ecognition.
To change the color of hyperlin-s' go to ,ools < =ptions < 2ibre=ffice < Appearance' scroll to Unvisited lin4s and/or Hisited lin4s' pic- the new colors and clic- =6. Caution% this will change the color for all hyperlin-s in all components of #ibre;fficecthis may not be what you want.

,ips

You can also insert and modify lin-s using the /yperlin- dialog. To display the dialog' clic- the ;yperlink icon on the ,tandard toolbar or choose nsert < ;yperlink from the menu bar. To turn e3isting te3t into a lin-' highlight it before opening the dialog. ;n the left side' select one of the four categories of hyperlin-s%

nternet% the hyperlin- points to a web address' normally starting with http%// 4ail B ?ews% the hyperlin- opens an email message that is pre+addressed to a particular
recipient.

%ocument% the hyperlin- points to a place in either the current document or another
e3isting document.

?ew document% the hyperlin- creates a new document.


The top section of the dialog changes according to the choice made for the hyperlin- category from the left panel. ) full description of all the choices' and their interactions' is beyond the scope of this chapter. /ere is a summary of the most common choices used in spreadsheets.

$hapter #8 Lin4ing $alc Data

9&.

'igure 9"3. +2perlin4 dialog showing details for 0nternet lin4s 2or an nternet hyperlin-' choose the type of hyperlin- $0eb or 2T"'&' and enter the re?uired web address $!H#&. 2or a 4ail and ?ews hyperlin-' specify whether it is a mail or news lin-' the recei(er address and for email' also the subGect. 2or a %ocument hyperlin-' specify the document path $the =pen File button opens a file browser&N lea(e this blan- if you want to lin- to a target in the same spreadsheet. ;ptionally specify the target in the document $for e3ample a specific sheet&. Clic- on the ,arget in document icon to open the a(igator where you can select the target' or if you -now the name of the target' you can type it into the bo3. 2or a ?ew %ocument hyperlin-' specify whether to edit the newly created document immediately $#dit now& or Gust create it $#dit later&' and enter the file name and the type of document to create $te3t' spreadsheet' etc.&. The +elect path button opens a directory pic-er dialog. The 'urther settings section at the bottom of the dialog is common to all the hyperlin- categories' although some choices are more rele(ant to some types of lin-s.

,et the (alue of Frame to determine how the hyperlin- will open. This applies to documents
that open in a 0eb browser.

Form specifies if the lin- is to be presented as te3t or as a button. 2igure 2<< shows a linformatted as a button.

'igure 9"": +2perlin4 as button

,e.t specifies the te3t that will be (isible to the user. Cf you do not enter anything here' Calc
will use the full !H# or path as the lin- te3t. ote that if the lin- is relati(e and you mo(e the file' this te3t will not change' though the target will.
9A8 LibreOffice ".# $alc Guide

?ame is applicable to /T1# documents. Ct specifies te3t that will be added as a .&MB
attribute in the /T1# code behind the hyperlin-.

#vents button% this button will be acti(ated to allow Calc to react to e(ents for which the
user has written some code $macro&. This function is not co(ered in this chapter.
) hyperlin- button is a type of form control. )s with all form controls' it can be anchored or positioned by right+clic-ing on the button in design mode. 1ore information about forms can be found in Chapter 1A of the <riter Guide. 2or the button to wor- ' the spreadsheet must not be in design mode. To toggle design mode on and off' (iew the 2orm Controls toolbar $>iew < ,oolbars < Form Controls& and clic- the %esign 4ode =nH=ff button .

?ote

#diting hyperlinks
To edit an e3isting lin-' place the cursor anywhere in the lin- and clic- the ;yperlink icon on the ,tandard toolbar or select #dit < ;yperlink from the menu bar. The /yperlin- dialog $2igure 2<3& opens. Cf the /yperlin- is in button form' the spreadsheet must ha(e 5esign 1ode on in order to edit the /yperlin-. 1a-e your changes and clic- Apply. Cf you need to edit se(eral hyperlin-s' you can lea(e the /yperlin- dialog open until you ha(e edited all of them. 4e sure to clic- Apply after each one. 0hen you are finished' clic- Close.

3emoving hyperlinks
You can remo(e the clic-able lin- from hyperlin- te3tclea(ing Gust the te3tcby right+clic-ing on the lin- and selecting %efault Formatting. This option is also a(ailable from the Format menu. You may then need to re+apply some formatting in order for it to match the rest of your document. To erase the lin- te3t or button from the document completely' select it and press the Bac4space or Delete -ey.

2inking to e.ternal data


0ith the help of the 0eb "age Juery import filter' you can insert tables from /T1# documents into Calc. You can use the same method to insert data located within named ranges from a #ibre;ffice Calc or 1icrosoft D3cel spreadsheet' into a Calc spreadsheet. $To use other data sources' including database files in #ibre;ffice 4ase' see K#in-ing to registered data sourcesL on page 2E@.& You can do this in two ways% using the D3ternal 5ata dialog or using the a(igator. Cf your file has named ranges or named tables' and you -now the name of the range or table you want to lin- to' using the D3ternal 5ata dialog method is ?uic- and easy. /owe(er' if the file has se(eral tables' and you want to pic- only one of them' you may not be able to easily determine which is whichN in that case' the a(igator method may be easier.

*sing the #.ternal %ata dialog


1& ;pen the Calc document where the e3ternal data is to be inserted. This is the target document. 2& ,elect the cell where the upper left+hand cell of the e3ternal data is to be inserted. 3& Choose nsert < 2ink to #.ternal %ata.

$hapter #8 Lin4ing $alc Data

9A#

<& ;n the D3ternal 5ata dialog' type the !H# of the source document or select it from the drop+down list if it is listed.

2or entries typed in' press )nter on completion. 2ile selections from the drop+down list will load automatically.

A& You can also clic- the V...W button to open the Cnsert $file selection& dialog. ,electing a file and then clic-ing nsert loads the list of a(ailable tables. Cf the source document is a 0eb page' choose 8eb Page Muery KCalcL as the file type $see 2igure 2<A&. Dnter the !H# as the file name. Clic- nsert.

'igure 9"%: Using a <eb Cuer2 to lin4 data directl2 to a web page @& 2or !H#s to /T1# $web& documents' pressing )nter at step <' or nsert at step A' opens the Cmport ;ptions dialog where you can choose the import language of the site. ,elect Automatic to let Calc import the data directly' or select Custom and choose from the drop+ down list of languages a(ailable. You can also select the option to ha(e Calc recognise special numbers such as dates on import.

'igure 9"&: 0mport Options dialog E& Clic- =6 and Calc loads the list of a(ailable tables/ranges $2igure 2<E&. The filter can create names for cell ranges as they are imported. )s much formatting as possible is retained while the filter intentionally does not import any images. The filter additionally creates two entries to the list% /T1#Pall to permit selection of the entire document' and /T1#Ptables to permit selection of all the tables. *& Cn the ,vailable tables range list' select the named ranges or tables you want to insert $hold $trl to select multiple entries&. The =6 button then becomes a(ailable. You can also specify that the ranges or tables are updated e(ery $number of& seconds. :& Clic- =6 to close the dialog and insert the lin-ed data.

9A9

LibreOffice ".# $alc Guide

'igure 9"A: Selecting a table or range in a source document from the <eb

*sing the ?avigator


1& ;pen the Calc spreadsheet in which the e3ternal data is to be inserted $target document&. 2& ;pen the document from which the e3ternal data is to be ta-en $source document&. The source document can be a 0eb page' created by choosing 8eb Page Muery KCalcL as the file type' and entering the !H# into the 2ile name bo3' before clic-ing =6 $see 2igure 2<A&. 3& Cn the target document' press '% to open the a(igator.

'igure 9"-: Selecting a data range in a source document= to be inserted as a lin4

$hapter #8 Lin4ing $alc Data

9A3

<& )t the bottom of the a(igator' select the source document. $Cn Drror% Heference source not found' the source is named actives.& The a(igator now shows the range names or the tables contained in the source document $the e3ample contains range namesN other documents ha(e a list of tables&. Clic- on the R ne3t to 3ange names to display the list. A& Cn the a(igator' select the nsert as 2ink drag mode' as shown in Drror% Heference source not found. @& ,elect the re?uired range or table and drag it from the a(igator into the target document' to the cell where you want the upper left+hand cell of the data range to be. E& Heselect the target document in the bo3 at the bottom of the a(igator. Cnstead of a E symbol ne3t to 3ange names' it shows a E symbol ne3t to Lin4ed areas. Clic- the E symbol to see the range name $see 2igure 2<:& dragged across from the source document.

'igure 9".: Lin4ed areas in target spreadsheet

;ow to find the re@uired data range or table


The e3amples abo(e show that the import filter ga(e names to the data ranges $tables& in the sample web page starting from ;,42Q1. Ct also created two additional range names $not (isible in the illustration&%

;,42Qall X designates the entire document ;,42Qtables X designates all /T1# tables in the document
Cf the data tables in the source /T1# document ha(e been gi(en names $using the C5 attribute on the T)4#D tag&' or the e3ternal spreadsheet includes named ranges' those names appear in the list along with the ranges Calc has se?uentially numbered. Cf the data range or table you want is not named' how can you tell which one to select= Go to the source document' which you opened in Calc. Cn the a(igator' double+clic- on a range name% that range is highlighted on the sheet $see 2igure 2A0&. Cf the 2ormula 4ar is (isible' the range name is also displayed in the @ame bo3 at the left+hand end $see 2igure 2A1&. The range name can also be selected from this drop+down list to highlight it on the page.

9A"

LibreOffice ".# $alc Guide

'igure 9%8: Using the @avigator to find a data range name

'igure 9%#: Using the @ame bo* to find a data range name

$hapter #8 Lin4ing $alc Data

9A%

2inking to registered data sources


You can access a (ariety of databases and other data sources and lin- them into Calc documents. 2irst you need to register the data source with #ibre;ffice. $To register means to tell #ibre;ffice what type of data source it is and where the file is located.& The way to do this depends on whether or not the data source is a database in Z.odb format. To register a data source that is in Z.odb format% 1& Choose ,ools < =ptions < 2ibre=ffice 7ase < %atabases. 2& Clic- the ?ew button $below the list of registered databases& to open the Create 5atabase #in- dialog $2igure 2A2&.

'igure 9%9: 3egistering databases 3& Dnter the location of the database file' or clic- 7rowse to open a file browser and select the database file. <& Type a name to use as the registered name for the database and clic- =6. The database is added to the list of registered databases. The =6 button is enabled only when both fields are filled in. To register a data source that is not in Z.odb format% 1& Choose File < ?ew < %atabase to open the 5atabase 0iFard. 2& ,elect Connect to an e.isting database. The choices for database type depend on your operating system. 2or e3ample' 1icrosoft )ccess and other 1icrosoft products are not among the choices if you are using #inu3. Cn our e3ample' we chose d4),D. 3& Clic- ?e.t. Type the path to the database file or clic- 7rowse and use the ;pen dialog to na(igate to and select the database file before clic-ing =pen. <& Clic- ?e.t. ,elect Fes= register the database for me' but clear the chec-bo3 mar-ed Open the database for editing. A& Clic- Finish. ame and sa(e the database in the location of your choice. ote% changes made to the Z.odb do not affect the original d4),D file. ;nce a data source has been registered' it can be used by any #ibre;ffice component $for e3ample Calc&.

9A&

LibreOffice ".# $alc Guide

'igure 9%3: 3egistering a database using the Database <i1ard

>iewing data sources


;pen a document in Calc. To (iew the data sources a(ailable' press '" or select >iew < %ata +ources from the menu bar. The 5ata ,ource Biew pane opens abo(e the spreadsheet. ) list of registered databases is in the 5ata D3plorer area on the left. $The built+in 4ibliography database is included in the list.& To (iew each database' clic- on the E symbol to the left of the name of the database. $This has been done for the )utomobile database in 2igure 2A<.& Clic- on the E symbol ne3t to Tables to (iew the indi(idual tables.

'igure 9%": Databases ow clic- on a table to see all the records held in it. The data records are displayed on the right side of the 5ata ,ource Biew pane. To see more columns' you can clic- the #.plorer =nH=ff button to hide the 5ata D3plorer area.

$hapter #8 Lin4ing $alc Data

9AA

)t the top of the 5ata ,ource Biew pane' below the Calc toolbars' is the Table 5ata bar. This toolbar includes buttons for sa(ing records' editing data' finding records' sorting' filtering' and other functions. 2or more details about this toolbar' see the /elp for data source browser. 4elow the records is the 2orm a(igation bar' which shows which record is selected and the total number of records. To the right are fi(e small buttonsN the first four mo(e bac-wards or forwards through the records' or to the beginning or end. The last is for adding new records.

'igure 9%%: Data Source Hiew navigation buttons

#diting data sources


,ome data sources $such as spreadsheets& cannot be edited in the data source (iew. Cn editable data sources' records can be edited' added' or deleted. Cf you cannot sa(e your edits' you need to open the database in 4ase and edit it thereN see K#aunching 4ase to wor- on data sourcesL. You can also hide columns and ma-e other changes to the display.

2aunching 7ase to work on data sources


You can launch #ibre;ffice 4ase at any time from the 5ata ,ource Biew pane. Hight+clic- on a database or the ,ables or Mueries icons and select #dit %atabase File. ;nce in 4ase' you can edit' add' and delete tables' ?ueries' forms' and reports. 2or more about using 4ase' see Chapter *' Getting ,tarted with 4ase' in the Getting Started guide.

*sing data sources in Calc spreadsheets


5ata from the tables in the data source pane can be placed into Calc documents in a (ariety of ways. You can select a cell or an entire row in the data source pane and drag and drop the data into the spreadsheet. The data is inserted at the place where you release the mouse button. )n alternati(e method uses the %ata to ,e.t icon and will include the column headings abo(e the data you insert% 1& Clic- the cell of the spreadsheet which you want to be the top left of your data including the column names. 2& "ress '" to open the database source window and select the table containing the data you want to use. 3& ,elect the rows of data you want to add to the spreadsheet%

Clic- the gray bo3 to the left of the row you want to select if only selecting one row. That row is highlighted. To select multiple adGacent rows' hold down the Shift -ey while clic-ing the gray bo3 of the rows you need. To select multiple separate rows' hold down the $ontrol -ey while selecting the rows. The selected rows are highlighted. To select all the rows' clic- the gray bo3 in the upper left corner. )ll rows are highlighted. to insert the data into the spreadsheet cells.

<& Clic- the %ata to te.t icon

9A-

LibreOffice ".# $alc Guide

You can also drag the data source column headings $field names& onto your spreadsheet to create a form for (iewing and editing indi(idual records one at a time. 2ollow these steps% 1& Clic- the gray bo3 at the top of the column $containing the field name you wish to use& to highlight it. 2& 5rag and drop the gray bo3 to where you want the record to appear in the spreadsheet. 3& Hepeat until you ha(e mo(ed all of the fields you need to where you want them. <& Close the 5ata ,ource window by pressing '". A& ,a(e the spreadsheet and clic- the #dit File button on the ,tandard toolbar' to ma-e the spreadsheet read+only. )ll of the fields will show the (alue for the data of the first record you selected. @& )dd the 'orm @avigation toolbar% >iew < ,oolbars < Form ?avigation. 4y default' this toolbar opens at the bottom of the Calc window' Gust abo(e the status bar. E& Clic- the arrows on the 2orm a(igation toolbar to (iew the different records of the table. The number in the Hecord bo3 changes as you mo(e through the records. The data in the fields changes to correspond to the data for that particular record number. You can also search for a specific record' sort and filter records' and do other tas-s using this toolbar.

#mbedding spreadsheets
,preadsheets can be embedded in other #ibre;ffice files. This is often used in 0riter or Cmpress documents so that Calc data can be used in a te3t document. You can embed the spreadsheet as either an OL) or DD) obGect. The difference between a 55D obGect and a #in-ed ;#D obGect is that a #in-ed ;#D obGect can be edited from the document in which it is added as a lin-' but a 55D obGect cannot. 2or e3ample' if a Calc spreadsheet is pasted into a 0riter document as a 55D obGect' then the spreadsheet cannot be edited in the 0riter document. 4ut if the original Calc spreadsheet is updated' the changes are automatically made in the 0riter document. Cf the spreadsheet is inserted as a #in-ed ;#D obGect into the 0riter document' then the spreadsheet can be edited in the 0riter as well as in the Calc document and both documents are in sync with each other.

=bCect 2inking and #mbedding K=2#L


The maGor benefit of an ;#D $;bGect #in-ing and Dmbedding& obGect is that it is ?uic- and easy to edit its contents Gust by double+clic-ing on it. You can also insert a lin- to the obGect that will appear as an icon rather than an area showing the contents itself. ;#D obGects can be lin-ed to a target document or be embedded in the target document. #in-ing inserts information which will be updated with any subse?uent changes to the original file' while embedding inserts a static copy of the data. Cf you want to edit the embedded spreadsheet' double+ clic- on the obGect. To embed a spreadsheet as an ;#D obGect in a presentation% 1& "lace the cursor in the document and location you want the ;#D obGect to be. 2& ,elect nsert < =bCect < =2# =bCect. The dialog in 2igure 2A@ opens.

$hapter #8 Lin4ing $alc Data

9A.

'igure 9%&: 0nsert OL) obIect dialog You can either create a new ;#D obGect or create from a file. To create a new obGect% 1& ,elect Create new and select the obGect type among the a(ailable options. 2& Clic- =6. )n empty container is placed in the slide. 3& 5ouble+clic- on the ;#D obGect to enter the edit mode of the obGect. The application de(oted to handling that type of file will open the obGect.
Cf the obGect inserted is handled by #ibre;ffice' then the transition to the program to manipulate the obGect will be seamlessN in other cases the obGect opens in a new window and an option in the 2ile menu becomes a(ailable to update the obGect you inserted.

?ote

To insert an e3isting obGect% 1& To create from a file' select Create from file. The dialog changes to loo- li-e 2igure 2AE. 2& To insert the obGect as a lin-' select the 2ink to file option. ;therwise' the obGect will be embedded. 3& Clic- +earch' select the re?uired file in the ;pen dialog' then clic- =pen. ) section of the inserted file is shown in the document.

'igure 9%A: 0nserting an obIect as a lin4

9-8

LibreOffice ".# $alc Guide

Ot"er OLE obAects


!nder 0indows' the Cnsert ;#D ;bGect dialog has an e3tra entry' 'urther obIects. 1& 5ouble+clic- on the entry Further obCects to open the dialog shown below.

'igure 9%-: 0nserting an OL) obIect under <indows 2& ,elect Create ?ew to insert a new obGect of the type selected in the ;bGect Type list' or select Create from File to create a new obGect from a file. 3& Cf you choose Create from File$ the dialog shown in 2igure 2AA opens. Clic- 7rowse and choose the file to insert. The inserted file obGect is editable by the 0indows program that created it. Cf instead of inserting an obGect' you want to insert a lin4 to an obGect' select the %isplay As con option.

'igure 9%.: 0nsert obIect from a file

.on'lin0ed OLE obAect


Cf the ;#D obGect is not lin-ed' it can be edited in the new document. 2or instance' if you insert a spreadsheet into a 0riter document' you can essentially treat it as a 0riter table $with a little more power&. To edit it' double+clic- on it.

$hapter #8 Lin4ing $alc Data

9-#

Lin0ed OLE obAect


0hen the spreadsheet ;#D obGect is lin-ed' if you change it in 0riter it will change in CalcN if you change it in Calc' it will change in 0riter. This can be a (ery powerful tool if you create reports in 0riter using Calc data' and want to ma-e a ?uic- change without opening Calc.

?ote

You can only edit one copy of a spreadsheet at a time. Cf you ha(e a lin-ed ;#D spreadsheet obGect in an open 0riter document and then open the same spreadsheet in Calc' the Calc spreadsheet will be a read+only copy.

%ynamic %ata #.change K%%#L


DD) is an acronym for 5ynamic 5ata D3change' a mechanism whereby selected data in document , can be pasted into document B as a lin-ed' Mli(eI copy of the original. Ct would be used' for e3ample' in a report written in 0riter containing time+(arying data' such as sales results sourced from a Calc spreadsheet. The 55D lin- ensures that' as the source spreadsheet is updated so is the report' thus reducing the scope for error and reducing the wor- in(ol(ed in -eeping the 0riter document up to date. 55D is a predecessor of ;#D. 0ith 55D' obGects are lin-ed through file reference' but not embedded. You can create 55D lin-s either within Calc cells in a Calc sheet' or in Calc cells in another #ibre;ffice doc such as in 0riter.

**E lin0 in Calc


Creating a 55D lin- in Calc is similar to creating a cell reference. The process is a little different' but the result is the same. 1& Cn Calc' select the cells that you want to ma-e the 55D lin- to. 2& Copy them% #dit < Copy or $trl5$. 3& Go to the place in the spreadsheet where you want the lin- to be. <& ,elect #dit < Paste +pecial. A& 0hen the "aste ,pecial dialog opens' select the 2ink option on the bottom left of the dialog $2igure 2@0&. Clic- =6. The cells now reference the copied data' and the formula bar shows a reference beginning with L=55B. Cf you now edit the original cells' the lin-ed cells will update.

'igure 9&8: Location of Lin4 option on Paste Special dialog in $alc

**E lin0 in Writer


The process for creating a 55D lin- from Calc to 0riter is similar to creating a lin- within Calc. 1& Cn Calc' select the cells to ma-e the 55D lin- to. Copy them. 2& Go to the place in your 0riter document where you want the 55D lin-. ,elect #dit < Paste +pecial. 3& ,elect %%# 2ink $2igure 2@1&. Clic- =6.
9-9 LibreOffice ".# $alc Guide

ow the lin- has been created in 0riter. 0hen the Calc spreadsheet is updated' the table in 0riter is automatically updated.

'igure 9&#: Paste Special dialog in <riter= with DD) lin4 selected

$hapter #8 Lin4ing $alc Data

9-3

$hapter ## Sharing and 3eviewing Documents

ntroduction
This chapter co(ers methods for editing shared documents% sharing $collaboration&' recording changes' adding comments' re(iewing changes' merging and comparing documents' and sa(ing and using document (ersions. 4asic editing techni?ues are discussed in Chapter 2' Dntering' Dditing' and 2ormatting 5ata.

+haring documents KcollaborationL


Cn #ibre;ffice 0riter' Cmpress' and 5raw' only one user at a time can open any document for editing. Cn Calc' many users can open the same spreadsheet for writing at the same time. Dach user who wants to collaborate should be sure to enter a name on the ,ools < =ptions < 2ibre=ffice < *ser %ata page. ,ome menu commands are not a(ailable $grayed out& when change trac-ing or document sharing is acti(ated.

+etting up a spreadsheet for sharing


)t any time' you can set up a spreadsheet for sharing with others. 0ith the spreadsheet document open' choose ,ools < +hare %ocument to acti(ate the collaboration features for this document. ) dialog opens where you can enable or disable sharing.

'igure 9&9: $hoosing to share a spreadsheet To enable sharing' chec- the bo3 at the top of the dialog' and then clic- =6. Cf the spreadsheet has been sa(ed pre(iously' a message appears stating that you must sa(e it to acti(ate shared modeN clic- Ies to continue. Cf the spreadsheet has not been sa(ed pre(iously' the ,a(e dialog appears. )fter sa(ing' the word KsharedL is shown on the title bar after the documentIs title. The ,ools < +hare %ocument command can be used to switch the mode for a document from unshared to shared. /owe(er' if you want to use a shared document in unshared mode' you need to sa(e the shared document using another name or path. This creates a copy of the spreadsheet that is not shared.

9-&

LibreOffice ".# $alc Guide

=pening a shared spreadsheet


0hen you open a spreadsheet document that is in shared mode' a message appears stating that the document is in shared mode and that some features are not a(ailable in this mode. )fter clic-ing =6' the document is opened in shared mode. You can select the option to not show the warning again. The following features are disabled in a shared spreadsheet document%
#dit < Changes' e3cept for 4erge %ocument #dit < Compare %ocument #dit < +heet < 4oveHCopy S %elete nsert < Cells < +hift Cells %own S +hift Cells 3ight nsert < +heet from file nsert < ?ames nsert < Comment nsert < Picture < From File nsert < 4ovie and +ound nsert < =bCect nsert < Chart nsert < Floating Frame Format < +heet < 3ename' ,ab Color Format < 4erge Cells < 4erge and Center' 4erge Cells' +plit Cells Format < Print 3anges ,ools < Protect %ocument %ata < %efine 3ange %ata < +ort %ata < +ubtotals %ata < >alidity %ata < 4ultiple =perations %ata < Consolidate %ata < (roup and =utline $all& %ata < Pivot ,able

+aving a shared spreadsheet


0hen you sa(e a shared spreadsheet' one of se(eral situations may occur%

Cf the document was not modified and sa(ed by another user since you opened it' the
document is sa(ed.

Cf the document was modified and sa(ed by another user since you opened it' one of the
following e(ents will occur%

Cf the changes do not conflict' the document is sa(ed' the message below appears' and any cells modified by the other user are shown with a red border.

'igure 9&3: Update message after saving

Cf the changes conflict' the Hesol(e Conflicts dialog is shown. You must decide for each conflict which (ersion to -eep' yours or the other personIs. 0hen all conflicts are resol(ed' the document is sa(ed. 0hile you are resol(ing the conflicts' no other user can sa(e the shared document.

$hapter ## Sharing and 3eviewing Documents

9-A

'igure 9&": 3esolve $onflicts dialog

Cf another user is trying to sa(e the shared document and resol(e conflicts' you see a
message that the shared spreadsheet file is loc-ed due to a merge+in in progress. You can choose to cancel the ,a(e command for now' or retry sa(ing later. 0hen you successfully sa(e a shared spreadsheet' the document shows the latest (ersion of all changes sa(ed by all users.

3ecording changes
You can use se(eral methods to record changes that you or others ma-e to a document%

You can use change mar-s to show added material' deleted material' and changes to
formatting. #ater' you or another person can re(iew the document and accept or reGect each change. ot a(ailable in shared files.

Cf you are not using file sharing' you can ma-e changes to a copy of the document $stored
in a different folder' under a different name' or both&' then use Calc to compare the files and show the changes. ,ee page 2:A.

You can sa(e (ersions that are stored as part of the original file. ,ee page 2:@.
He(iewers can lea(e comments in the document' either attached to specific changes or standalone.

Preparing a document for review KoptionalL


This feature is not a(ailable in shared documents. 0hen you send a document to someone else to re(iew or edit' you may want to set it up so that the editor or re(iewer does not ha(e to remember to turn on the re(ision mar-s. )fter you ha(e turned on re(ision mar-s' you can optionally password protect the document so that any user must enter the correct password in order to turn off protection and accept or reGect changes. Ct is not necessary to password protect the document while preparing it for re(iew. 1& ;pen the document and ma-e sure that the #dit < Changes < 3ecord menu item has a chec- mar- ne3t to it' indicating that change recording is acti(e. You can also use File < Properties < +ecurity and select 3ecord changes.

9--

LibreOffice ".# $alc Guide

2& $;ptional& Clic- #dit < Changes < Protect 3ecords. ;n the Dnter "assword dialog' type a password $twice& and clic- =6. You can also use File < Properties < +ecurity and clicthe Protect button to open the Dnter "assword dialog.

dentifying copies of spreadsheets


0hen not using the document sharing feature' it is important to -eep trac- of the different copies of the document. This can be done either in the file name or in the file title. Cf you ha(e not pro(ided a file title in the spreadsheetIs properties' the spreadsheetIs file name is displayed in the title bar. To set the title of the spreadsheet' select File < Properties < %escription.

3ecording changes KtutorialL


2or this chapter we will wor- with a budget proposal for a baseball team. You are the sponsor of a youth baseball team. The coach has submitted a budget to you for the season and you need to edit the costs and return it to her. You are concerned that if you Gust ma-e the changes' then the coach will not see the changes you made. You decide to use Calc with the record changes feature turned on' so that the coach can easily see the change you ha(e made.

2igure 2@A shows the budget spreadsheet your coach submitted.

'igure 9&%: Baseball budget spreadsheet #oo-ing o(er the figures' you see a few places where money could be sa(ed%

"ost+game snac-s can be bought by parents. ew uniforms can waitN only buy 10 to replace damaged ones. 4uy cheaper baseballs. ;nly buy 2 spare glo(es.
To ma-e these changes' use the record changes feature in Calc. To start recording changes% 1& ;pen the 4udget ,preadsheet. 2& ,elect #dit < Changes < 3ecord from the menu bar. 3& 4egin editing the document.

$hapter ## Sharing and 3eviewing Documents

9-.

) colored border' with a dot in the upper left+hand corner' appears around a cell where changes were made $2igure 2@@&. ;ther re(iewers then ?uic-ly -now which cells were edited. ) deleted column or row is mar-ed by a hea(y colored bar.

'igure 9&&: )dited document with red border on changed cells

?ote

,ome changes' for e3ample cell formatting' are not recorded and mar-ed.

,ip

To change the color that indicates changes' select ,ools < =ptions < 2ibre=ffice Calc < Changes.

0hen you finish editing the document' you can send it to your coach. You may want to e3plain your rationale for the changes. You can share your insight in two ways% by adding comments to the changes you made' or by adding general comments to the spreadsheet.

Adding comments to changes


Calc automatically adds to any recorded change a comment that describes what was changed $for e3ample' $ell B" changed from T.U to T"U&. He(iewers and authors can add their own comments to e3plain their reasons for the changes. To add a comment to a change% 1& 1a-e the change to the spreadsheet. 2& ,elect the cell with the change. 3& Choose #dit < Changes < Comments. The dialog shown in 2igure 2@E appears.

'igure 9&A: 0nsert $omment dialog


9.8 LibreOffice ".# $alc Guide

<& Type your comment and clic- =6. The automatically+added comment pro(ided by Calc cannot be edited. )fter you ha(e added a comment to a changed cell' you can see it by ho(ering the mouse pointer o(er the cell' as shown in 2igure 2@*.

'igure 9&-: $omment added to cell B3 The comment also appears in the dialog when you are accepting and reGecting changes' as shown in the first line of 2igure 2E3 on page 2:<.

#diting change comments


1& ,elect the cell with the change comment that you want to edit. 2& ,elect #dit < Changes < Comments. 3& Ddit the comment and clic- =6.

Adding other comments


Calc pro(ides another type of comments $formerly called KnotesL&' which authors and re(iewers often use to e3change ideas' as- for suggestions' or brainstorm in the document. To add a comment% 1& ,elect the cell that the comment applies to. 2& ,elect nsert < Comment or right+clic- and select nsert Comment. $The latter method does not wor- if the automatic spelling chec-er is acti(e and the cell contains a misspelled word.& The bo3 shown in 2igure 2@: appears.

'igure 9&.: 0nserting a comment 3& Type the te3t of your comment in the bo3' then clic- outside the bo3 to close it. ow the cell to which you added the comment has a colored dot in the upper right+hand corner' as shown in 2igure 2E0. Ct does not ha(e a colored border' unless the cell was also changed.

$hapter ## Sharing and 3eviewing Documents

9.#

'igure 9A8: $olored dot in cell containing a comment

,ip

You can change the colors Calc uses for notes by selecting ,ools < =ptions < 2ibre=ffice < Appearance.

To (iew the comment you Gust added' ho(er the mouse pointer o(er the cell that has a commentN the comment appears' as shown below.

'igure 9A#: Hiewing a comment

#diting comments
You can edit and format the te3t of a comment' Gust as you do for any other te3t. 1& Hight+clic- on the cell containing the comment mar-er and choose +how comment from the conte3t menu. 2& ,elect the comment' then double+clic- on it. The cursor changes to the usual blin-ing te3t+ entry cursor' and the 2ormatting toolbar changes to show te3t attributes. 3& 0hen done' clic- outside the comment to deselect it. To hide the comment again' right+clicon the cell and deselect +how Comment on the conte3t menu.

Formatting comments
You can change the bac-ground color' border style' transparency' and other attributes of a comment. 1& Hight+clic- on the cell containing the comment mar-er' and choose +how comment from the conte3t menu. 2& Clic- on the comment itself. The 2ormatting toolbar changes to show many of the comment formatting options. These are the same as the options for formatting graphicsN see Chapter A' !sing Graphics in Calc' for more information. You can also right+clic- on the comment to see a menu of choices' some of which lead to dialogs in which you can fine+tune the formattingN these dialogs are also discussed in Chapter A. 3& 0hen done' clic- outside the comment to deselect it. To hide the comment again' right+clicon the cell and deselect +how Comment on the conte3t menu.

Finding comments using the ?avigator


The small comment mar-ers in the corners of cells can be difficult to see' so Calc pro(ides another way to find them' by using the a(igator. Cf any comments are in the spreadsheet' the a(igator shows a mar- $usually a R or an arrow& ne3t to the word Comments. Clic- on this mar- to display a
9.9 LibreOffice ".# $alc Guide

list of comments. 5ouble+clic- on the comment you want to Gump directly to the cell it is associated with.

3eviewing changes
)t this point' we are going to change our perspecti(e from the point of (iew of the team sponsor to that of the coach' so we can see how to re(iew and accept or reGect the changes to the document the coach originally wrote. You are the coach of a youth baseball team and you submitted a potential budget created in Calc to your team sponsor. Your sponsor has re(iewed the document using the record changes feature of Calc. ow' you want to re(iew those changes and accept or reGect the counter proposal. 4ecause the sponsor recorded changes in Calc' you can easily see what changes were made and decide how to act.

>iewing changes
You ha(e some control o(er what changes you see when re(iewing a document. ,elect #dit < Changes < +how from the 1enu bar. The ,how Changes dialog 2igure 2E2& opens.

'igure 9A9: Show changes dialog

Accepting or reCecting changes


0hen you recei(e a document bac- with changes' the beauty of the recording changes system becomes e(ident. ow' as the original author' you can step through each change and decide how to proceed. To begin this process% 1& ;pen the edited document. 2& ,elect #dit < Changes < Accept or 3eCect. The dialog shown in 2igure 2E3 appears. 3& You can step through the changes one at a time' choosing to accept or reGect each change as you go through. You can also accept or reGect all changes at one time.

$hapter ## Sharing and 3eviewing Documents

9.3

'igure 9A3: ,ccept or 3eIect changes dialog The $omment column by default contains an e3planation of the change that was made. Cf the re(iewer added a comment to the change' it is displayed' followed by the description of the change' as in the first line of 2igure 2E3. Cf a change has been superceded by later change $by either the same person or another person&' the changes are hierarchically arranged with a plus sign for opening up the hierarchy. 4elow the list of changes to be accepted or reGected are shown any changes that ha(e pre(iously been dealt with. ;n the 2ilter tab of this dialog $2igure 2E<&' you can choose how to filter the list of changes% by date' author' cell range' or comments containing specific terms. )fter selecting the filter criteria' switch bac- to the #ist tab to see the results.

'igure 9A": 'ilters set here affect the list of changes shown on the List tab

9."

LibreOffice ".# $alc Guide

4erging documents
You submitted your budget proposal to your sponsor' but you sent it to one of your assistant coaches as well. 4oth of them returned their re(ised budget to you at the same time. You could re(iew each document and the changes separately' but to sa(e time' you want to see both of their re(isions simultaneously. To do this' you can use CalcIs merge document feature. The processes discussed to this point are effecti(e when you ha(e one re(iewer at a time. ,ometimes' howe(er' multiple re(iewers all return edited (ersions of a document at the same time. Cn this case' it may be ?uic-er to re(iew all of these changes at once' rather than one re(iew at a time. 2or this purpose' you can merge documents in Calc. To merge documents' all of the edited documents need to ha(e recorded changes in them. 1& ;pen the original document. 2& ,elect #dit < Changes < 4erge %ocument. 3& ) file selection dialog opens. ,elect a file you want to merge and clic- =6. <& )fter the documents merge' the )ccept or HeGect Changes dialog opens' showing changes by more than one re(iewer. Cf you want to merge more documents' close the dialog and then repeat steps 2 and 3. ow all of the changes are combined into one document and you can accept or reGect the changes. Changes from different authors appear in cells outlined in different colors' as shown in 2igure 2EA. Cn this e3ample' all of the changes from Hobert are outlined in blue and the changes from 1ia are outlined in red.

'igure 9A%: :erged documents with different author colors

Comparing documents
,ometimes when sharing documents' re(iewers may forget to record the changes they ma-e. This is not a problem with Calc' because Calc can find the changes by comparing documents. Cn order to compare documents you need to ha(e the original document and the one that is edited. To compare them% 1& ;pen the edited document that you want to compare with the original document. 2& ,elect #dit < Compare %ocument.

$hapter ## Sharing and 3eviewing Documents

9.%

3& )n open document dialog appears. ,elect the original document and clic- nsert. Calc finds and mar-s the changes as follows%

)ll data that occurs in the edited document but not in the original is identified as inserted. )ll data that is in your original document but is not in the edited document is identified as
deleted.

)ll data that is changed' is mar-ed as changed.


2rom this point you can go through and accept or reGect changes as you could normally.

+aving versions
1ost documents go through many drafts. Ct is often useful to sa(e new (ersions of a document. You can do this by sa(ing a copy of the document $under a different name& after each re(ision' or by using CalcIs (ersion feature.

Caution

Cf you do a +ave As... of a document with different (ersions stored in it' the old (ersions are not sa(ed in the new file.

To use (ersion management in Calc% 1& Choose File < >ersions. The Bersions dialog opens.

'igure 9A&: Hersion management dialog 2& Clic- the +ave ?ew >ersion button to sa(e a new (ersion. 3& ) dialog opens where you can enter comments about this (ersion.

9.&

LibreOffice ".# $alc Guide

'igure 9AA: Hersion comment dialog <& )fter you enter your comment and clic- =6' the new (ersion is included in the (ersion list.

'igure 9A-: Updated version list ow when you sa(e the file' both (ersions are sa(ed in the same file. 2rom this point you can%

;pen an old (ersion X ,elect the (ersion and clic- the =pen button and a read+only copy
of a pre(ious (ersion opens.

Compare all (ersions X Clic-ing the Compare button performs an action similar to merging
documents together. )n )ccept or HeGect Changes dialog opens showing all of the changes through the different (ersions.

He(iew the comments X ,elect a (ersion and clic- the +how button to display the full
comments made by yourself or other re(iewers.

?ote

The new file is larger' as if two spreadsheets were sa(ed together.

$hapter ## Sharing and 3eviewing Documents

9.A

$hapter #9 $alc :acros


,utomating repetitive tas4s

ntroduction
) macro is a sa(ed se?uence of commands or -eystro-es that are stored for later use. )n e3ample of a simple macro is one that KtypesL your address. The #ibre;ffice macro language is (ery fle3ible' allowing automation of both simple and comple3 tas-s. 1acros are especially useful to repeat a tas- the same way o(er and o(er again. This chapter briefly discusses common problems related to macro programming using Calc.

*sing the macro recorder


Chapter 13 of the Getting Started guide' Getting ,tarted with 1acros' pro(ides a basis for understanding the general macro capabilities in #ibre;ffice using the macro recorder. )n e3ample is shown here without the e3planations in the Getting Started guide. The following steps create a macro that performs paste special with multiply.

,ip

!se ,ools < =ptions < 2ibre=ffice < Advanced and select the #nable macro recording option to enable the macro recorder.

1& ;pen a new spreadsheet. 2& Dnter numbers into a sheet.

'igure 9A.: )nter numbers 3& ,elect cell )3' which contains the number 3' and copy the (alue to the clipboard. <& ,elect the range )1%C3. A& !se ,ools < 4acros < 3ecord 4acro to start the macro recorder. The Hecord 1acro dialog is displayed with a stop recording button.

'igure 9-8: Stop recording button @& !se #dit < Paste +pecial to open the "aste ,pecial dialog $2igure 2*1&.

'igure 9-#: Paste Special dialog


388 LibreOffice ".# $alc Guide

E& ,et the operation to 4ultiply and clic- =6. The cells are now multiplied by 3 $2igure 2*2&.

'igure 9-9: $ells multiplied b2 3 *& Clic- +top 3ecording to stop the macro recorder. The #ibre;ffice 4asic 1acros dialog $2igure 2*3& opens.

1 1y 1acros " #ibre;ffice 1acros ' ;pen documents & Create new library

! Create new module in library - 1acros in selected library 7 Current document ) D3pand/collapse list

'igure 9-3: Parts of the LibreOffice Basic :acros dialog :& ,elect the current document. 2or this e3ample' it is Untitled #. D3isting documents show a library named ,tandard. This library is not created until the document is sa(ed or the library is needed' so at this point your new document does not contain a library. You can create a new library to contain the macro' but this is not necessary. 10& Clic- ?ew 4odule. Cf no libraries e3ist' then the ,tandard library is automatically created and used. Cn the ew 1odule dialog' type a name for the new module or lea(e the name as 1odule1.

$hapter #9 $alc :acros

38#

?ote

The libraries' modules and macro names must follow some strict rules. 2ollowing the main rules' the names must% 4egin with a letter

ot contain spaces ot contain special caracters' accents included' e3cept for P $underscore&

11& Clic- =6 to create a new module named 1odule1. ,elect the newly created 1odule1' type ,a%!$-u#!i(#. in the :acro name bo3 at the upper left' and clic- +ave. $,ee 2igure 2*<.&

'igure 9-": Select the module and name the macro The created macro is sa(ed in 1odule1 of the ,tandard library in the Untitled # document. #isting 1 shows the contents of the macro. Listing #. Paste special with multipl2.
su; -asteMultipl< rem EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE rem define varia;les dim document as o;Mect dim dispatcher as o;Mect rem EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE rem /et access to the document document = =his4omponent.4urrent4ontroller.)rame dispatcher = createUnoService ,com.sun.star.frame.5ispatchIelper,' rem EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE dim ar/s# @' as ne6 com.sun.star.;eans.-ropert<Aalue ar/s# *'..ame = ,)la/s, ar/s# *'.Aalue = ,&, ar/s# #'..ame = ,)ormula4ommand, ar/s# #'.Aalue = % ar/s# !'..ame = ,SJipBmpt<4ells,

389

LibreOffice ".# $alc Guide

ar/s# ar/s# ar/s# ar/s# ar/s# ar/s# ar/s#

!'.Aalue = false %'..ame = ,=ranspose, %'.Aalue = false 9'..ame = ,&sNinJ, 9'.Aalue = false @'..ame = ,MoveMode, @'.Aalue = 9

dispatcher.execute5ispatch document+ ,.uno:(nsert4ontents,+ ,,+ *+ ar/s# '' end su;

1ore detail on recording macros is pro(ided in Chapter 13' Getting ,tarted with 1acros' in the Getting Started guideN we recommend you read it if you ha(e not already done so. 1ore detail is also pro(ided in the following sections' but not as related to recording macros.

8rite your own functions


Calc can call macros as Calc functions. !se the following steps to create a simple macro% 1& Create a new Calc document named 4alc=estMacros.ods. 2& !se ,ools < 4acros < =rgani5e 4acros < 2ibre=ffice 7asic to open the #ibre;ffice 4asic 1acros dialog. The :acro from bo3 lists a(ailable macro library containers including currently open #ibre;ffice documents. :2 :acros contains macros that you write or add to #ibre;ffice. LibreOffice :acros contains macros included with #ibre;ffice and should not be changed.

'igure 9-%: LibreOffice Basic :acros dialog

$hapter #9 $alc :acros

383

3& Clic- 4anage to open the #ibre;ffice 4asic 1acro ;rganiFer dialog $2igure 2*@&. ;n the #ibraries tab' select the document to contain the macro.

'igure 9-&: LibreOffice Basic :acro Organi1er <& Clic- ?ew to open the ew #ibrary dialog.

'igure 9-A: @ew Librar2 dialog A& Dnter a descripti(e library name $such as )uthorsCalc1acros& and clic- =6 to create the library. The new library name is shown in the library list' but the dialog may show only a portion of the name.

'igure 9--: (he librar2 is shown in the organi1er

38"

LibreOffice ".# $alc Guide

@& ,elect )uthorsCalc1acros and clic- #dit to edit the library. Calc automatically creates a module named 1odule1 and a macro named 1ain.

'igure 9-.: Basic 0ntegrated Development )nvironment 60D)7 E& 1odify the code so that it is the same as that shown in #isting 2.The important addition is the creation of the .um;er)ive function' which returns the number fi(e. The >ption Bxplicit statement forces all (ariables to be declared before they are used. Cf ;ption D3plicit is omitted' (ariables are automatically defined at first use as type Bariant. *& ,a(e the modified 1odule1. Listing 9. 'unction that returns five.
?BM ***** "&S(4 >ption Bxplicit Su; Main Bnd Su; )unction .um;er)ive ' .um;er)ive = @ Bnd )unction *****

*sing a macro as a function


!sing the newly created Calc document 4alc=estMacros.ods' enter the formula =.um;er)ive ' $see 2igure 2:0&. Calc finds the macro and calls it.

$hapter #9 $alc :acros

38%

'igure 9.8: Use the @umber'ive67 :acro as a $alc function


2unction names are not case sensiti(e. Cn 2igure 2:0' you can enter =.um;er)ive ' and Calc clearly shows =.UM"B?)(AB '.

,ip

,a(e the Calc document' close it' and open it again. 5epending on your settings in ,ools < =ptions < 2ibre=ffice < +ecurity < 4acro +ecurity' Calc will display the warning shown in 2igure 2:1 or the one shown in 2igure 2:2. You will need to clic- #nable 4acros' or Calc will not allow any macros to be run inside the document. Cf you do not e3pect a document to contain a macro' it is safer to clic- %isable 4acros in case the macro is a (irus.

'igure 9.#: LibreOffice warns 2ou that a document contains macros

'igure 9.9: <arning if macros are disabled Cf you choose to disable macros' then when the document loads' Calc can no longer find the function.

38&

LibreOffice ".# $alc Guide

'igure 9.3: (he function is gone 0hen a document is created and sa(ed' it automatically contains a library named ,tandard. The ,tandard library is automatically loaded when the document is opened. o other library is automatically loaded. Calc does not contain a function named umber2i(e$&' so it chec-s all opened and (isible macro libraries for the function. #ibraries in LibreOffice :acros' :2 :acros' and the Calc document are chec-ed for an appropriately named function $see 2igure 2*A&. The umber2i(e$& function is stored in the )uthorsCalc1acros library' which is not automatically loaded when the document is opened. !se ,ools < 4acros < =rgani5e 4acros < 2ibre=ffice 7asic to open the #ibre;ffice 4asic 1acros dialog $see 2igure 2:<&. D3pand CalcTest1acros and find )uthorsCalc1acros. The icon for a loaded library is a different color from the icon for a library that is not loaded. Clic- the e3pansion symbol $usually a plus or a triangle& ne3t to )uthorsCalc1acros to load the library. The icon changes color to indicate that the library is now loaded. Clic- Close to close the dialog. !nfortunately' the cells containing Y umber2i(e$& are in error. Calc does not recalculate cells in error unless you edit them or somehow change them. The usual solution is to store macros used as functions in the ,tandard library. Cf the macro is large or if there are many macros' a stub with the desired name is stored in the ,tandard library. The stub macro loads the library containing the implementation and then calls the implementation. 1& !se ,ools < 4acros < =rgani5e 4acros < 2ibre=ffice 7asic to open the #ibre;ffice 4asic 1acros dialog. ,elect the umber2i(e macro and clic- #dit to open the macro for editing.

'igure 9.": Select a macro and clic4 )dit 2& Change the name of umber2i(e to umber2i(ePCmplementation $#isting 3&. Listing 3. $hange the name of @umber'ive to @umber'iveV0mplementation
)unction .um;er)ive_(mplementation ' .um;er)ive_(mplementation ' = @ Bnd )unction $hapter #9 $alc :acros 38A

3& Cn the 4asic C5D $see 2igure 2*:&' ho(er the mouse cursor o(er the toolbar buttons to display the tool tips. Clic- the +elect 4acro button to open the #ibre;ffice 4asic 1acros dialog $see 2igure 2:<&. <& ,elect the ,tandard library in the CalcTest1acros document and clic- ?ew to create a new module. Dnter a meaningful name such as Calc2unctions and clic- =6. #ibre;ffice automatically creates a macro named 1ain and opens the module for editing. A& Create a macro in the ,tandard library that calls the implementation function $see #isting <&. The new macro loads the )uthorsCalc1acros library if it is not already loaded' and then calls the implementation function. @& ,a(e' close' and reopen the Calc document. This time' the umber2i(e$& function wor-s. Listing ". $hange the name of @umber'ive to @umber'iveV0mplementation.
)unction .um;er)ive ' (f .>= "asicNi;raries.isNi;rar<Noaded ,&uthors4alcMacros,' =hen "asicNi;raries.NoadNi;rar< ,&uthors4alcMacros,' Bnd (f .um;er)ive = .um;er)ive_(mplementation ' Bnd )unction

Passing arguments to a macro


To illustrate a function that accepts arguments' we will write a macro that calculates the sum of its arguments that are positi(e it will ignore arguments that are less than Fero $see #isting A&. Listing %. PositiveSum calculates the sum of the positive arguments.
)unction -ositiveSum >ptional x' 5im =heSum &s 5ou;le 5im i?o6 &s (nte/er 5im i4ol &s (nte/er =heSum = *.* (f .>= (sMissin/ x' =hen (f .>= (s&rra< x' =hen (f x > * =hen =heSum = x Blse )or i?o6 = N"ound x+ #' =o U"ound x+ #' )or i4ol = N"ound x+ !' =o U"ound x+ !' (f x i?o6+ i4ol' > * =hen =heSum = =heSum $ x i?o6+ i4ol' .ext .ext Bnd (f Bnd (f -ositiveSum = =heSum Bnd )unction

The macro in #isting A demonstrates some important techni?ues% 1& The argument x is optional. 0hen an argument is not optional and the function is called without it' #ibre;ffice prints a warning message e(ery time the macro is called. Cf Calc calls the function many times' then the error is displayed many times. 2& (sMissin/ chec-s that an argument was passed before the argument is used. 3& (s&rra< chec-s to see if the argument is a single (alue' or an array. 2or e3ample' =-ositiveSum 2' or =-ositiveSum &9'. Cn the first case' the number E is passed as an argument' and in the second case' the (alue of cell )< is passed to the function. <& Cf a range is passed to the function' it is passed as a two+dimensional array of (aluesN for e3ample' =-ositiveSum &!:"@'. N"ound and U"ound are used to determine the

38-

LibreOffice ".# $alc Guide

array bounds that are used. )lthough the lower bound is one' it is considered safer to use N"ound in case it changes in the future.
The macro in #isting A is careful and chec-s to see if the argument is an array or a single argument. The macro does not (erify that each (alue is numeric. You may be as careful as you li-e. The more things you chec-' the more robust the macro is' and the slower it runs.

,ip

"assing one argument is as easy as passing two% add another argument to the function definition $see #isting @&. 0hen calling a function with two arguments' separate the arguments with a semicolonN for e3ample' ==estMax %R E9'. Listing &. (est:a* accepts two arguments and returns the larger of the two.
)unction =estMax x+ <' (f x >= < =hen =estMax = x Blse =estMax = < Bnd (f Bnd )unction

Arguments are passed as values


)rguments passed to a macro from Calc are always (alues. Ct is not possible to -now what cells' if any' are used. 2or e3ample' =-ositiveSum &%' passes the (alue of cell )3' and "ositi(e,um has no way of -nowing that cell )3 was used. Cf you must -now which cells are referenced rather than the (alues in the cells' pass the range as a string' parse the string' and obtain the (alues in the referenced cells.

8riting macros that act like built/in functions


)lthough Calc finds and calls macros as normal functions' they do not really beha(e as built+in functions. 2or e3ample' macros do not appear in the function lists. Ct is possible to write functions that beha(e as regular functions by writing an )dd+Cn. /owe(er' this is an ad(anced topic that is not co(ered here.

Accessing cells directly


You can access the #ibre;ffice internal obGects directly to manipulate a Calc document. 2or e3ample' the macro in #isting E adds the (alues in cell )2 from e(ery sheet in the current document. =his4omponent is set by ,tar4asic when the macro starts to reference the current document. ) Calc document contains sheets% =his4omponent./etSheets '. !se /et4ell"<-osition col+ ro6' to return a cell at a specific row and column. Listing A. ,dd cell ,9 in ever2 sheet.
)unction Sum4ells&llSheets ' 5im =heSum &s 5ou;le 5im i &s inte/er 5im oSheets 5im oSheet 5im o4ell

$hapter #9 $alc :acros

38.

oSheets = =his4omponent./etSheets ' )or i = * =o oSheets./et4ount ' E # oSheet = oSheets./et"<(ndex i' o4ell = oSheet./et4ell"<-osition *+ #' : 1et4ell &! =heSum = =heSum $ o4ell./etAalue ' .ext Sum4ells&llSheets = =heSum Bnd )unction

,ip

) cell obGect supports the methods /etAalue '' /etStrin/ '' and /et)ormula ' to get the numerical (alue' the string (alue' or the formula used in a cell. !se the corresponding set functions to set appropriate (alues.

!se oSheet./et4ell?an/e"<.ame ,&!,' to return a range of cells by name. Cf a single cell is referenced' then a cell obGect is returned. Cf a cell range is gi(en' then an entire range of cells is returned $see #isting *&. otice that a cell range returns data as an array of arrays' which is more cumbersome than treating it as an array with two dimensions as is done in #isting A. Listing -. ,dd cell ,9:$% in ever2 sheet
)unction Sum4ells&llSheets ' 5im =heSum &s 5ou;le 5im i?o6 &s (nte/er+ i4ol &s (nte/er+ i &s (nte/er 5im oSheets+ oSheet+ o4ells 5im o?o6 '+ o?o6s ' oSheets = =his4omponent./etSheets ' )or i = * =o oSheets./et4ount ' E # oSheet = oSheets./et"<(ndex i' o4ells = oSheet./et4ell?an/e"<.ame ,&!:4@,' ?BM /et5ata&rra< ' returns the data as variant so strin/s ?BM are also returned. ?BM /et5ata ' returns data data as t<pe 5ou;le+ so onl< ?BM num;ers are returned. o?o6s ' = o4ells./et5ata ' )or i?o6 = N"ound o?o6s '' =o U"ound o?o6s '' o?o6 ' = o?o6s i?o6' )or i4ol = N"ound o?o6 '' =o U"ound o?o6 '' =heSum = =heSum $ o?o6 i4ol' .ext .ext .ext Sum4ells&llSheets = =heSum Bnd )unction

,ip

0hen a macro is called as a Calc function' the macro cannot modify any (alue in the sheet from which the macro was called' e3cept the (alue of the cell that contains the function.

3#8

LibreOffice ".# $alc Guide

+orting
Consider sorting the data in 2igure 2:A. 2irst' sort on column 4 descending and then column ) ascending.

'igure 9.%: Sort column B descending and column , ascending The e3ample in #isting :' howe(er' demonstrates how to sort on two columns. Listing .. Sort cells ,#:$% on Sheet #.
Su; Sort?an/e 5im oSheet 5im o4ell?an/e ?BM ?BM ?BM ?BM 5im : 4alc sheet containin/ data to sort. : 5ata ran/e to sort.

&n arra< of sort fields determines the columns that are sorted. =his is an arra< 6ith t6o elements+ * and #. =o sort on onl< one column+ use: 5im oSort)ields *' &s .e6 com.sun.star.util.Sort)ield oSort)ields #' &s .e6 com.sun.star.util.Sort)ield

?BM =he sort descriptor is an arra< of properties. ?BM =he primar< propert< contains the sort fields. 5im oSort5esc *' &s .e6 com.sun.star.;eans.-ropert<Aalue ?BM 1et the sheet named ,Sheet#, oSheet = =his4omponent.Sheets./et"<.ame ,Sheet#,' ?BM 1et the cell ran/e to sort o4ell?an/e = oSheet./et4ell?an/e"<.ame ,&#:4@,' ?BM Select the ran/e to sort. ?BM =he onl< purpose 6ould ;e to emphasiOe the sorted data. :=his4omponent./et4urrent4ontroller.select o4ell?an/e' ?BM =he columns are num;ered startin/ 6ith *+ so ?BM column & is *+ column " is #+ etc. ?BM Sort column " column #' descendin/. oSort)ields *'.)ield = # oSort)ields *'.Sort&scendin/ = )&NSB ?BM (f column " has t6o cells 6ith the same value+ ?BM then use column & ascendin/ to decide the order. oSort)ields #'.)ield = * oSort)ields #'.Sort&scendin/ = =rue ?BM Setup the sort descriptor. oSort5esc *'..ame = ,Sort)ields, oSort5esc *'.Aalue = oSort)ields ' ?BM Sort the ran/e. o4ell?an/e.Sort oSort5esc '' Bnd Su; $hapter #9 $alc :acros 3##

Conclusion
This chapter pro(ides a brief o(er(iew on how to create libraries and modules' using the macro recorder' using macros as Calc functions' and writing your own macros without the macro recorder. Dach topic deser(es at least one chapter' and writing your own macros for Calc could easily fill an entire boo-. Cn other words' this is Gust the beginning of what you can learnl

3#9

LibreOffice ".# $alc Guide

$hapter #3 $alc as a Simple Database


, guide for users and macro programmers

ntroduction
) Calc document is a (ery capable database' pro(iding sufficient functionality to satisfy the needs of many users. This chapter presents the capabilities of a Calc document that ma-e it suitable as a database tool. 0here applicable' the functionality is e3plained using both the G!C $Graphical !ser Cnterface& and macros.
)lthough this document was initially created for macro programmers' the content should be accessible to all users. Cf you do not use macros' then s-ip those portions that deal with macros. ;n the other hand' if you want to learn more about macros' be sure to chec- out )ndrew "itonya-Is boo- OpenOffice.org :acros )*plained.

?ote

Cn a database' a record is a group of related data items treated as a single unit of information. Dach item in the record is called a field. ) table consists of records. Dach record in a table has the same structure. ) table can be (isualiFed as a series of rows and columns. Dach row in the table corresponds to a single record and each column corresponds to the fields. ) spreadsheet in a Calc document is similar in structure to a database table. Dach cell corresponds to a single field in a database record. 2or many people' Calc implements sufficient database functionality that no other database program or functionality is re?uired. 0hile teaching' a spreadsheet might be used as a grading program. Dach row represents a single student. The columns represent the grades recei(ed on homewor-' labs' and tests $see Table 13&. The strong calculation capability pro(ided in a spreadsheet ma-es this an e3cellent choice. (able #3. Simple grading spreadsheet

A
1 " ' & ! 7 ) 0 11 11 1" 1' 1& 1! 1ame )ndy 4etty 4ob 4randy 2ran2red Clsub .ames #isa 1ichelle Ha(i ,al Ted Tom 0hil

7
Test 1 :A *E :A <A :A *E E0 <A 100 100 *E <A 100 E0 E0

C
Test 2 :3 :2 :3 @A :3 :2 *A @A :E :E :2 @A :E *A *A

%
JuiF 1 :3 @A :3 :2 *A @A :E :E 100 100 *@ 100 100 :3 :3

#
JuiF 2 :2 E3 :2 *A :2 E3 E: *A :3 @A :3 :2 *A @A :E

F
)(erage :3.2A E:.2A :3.2A E1.EA :1.2A E:.2A *2.EA E3 :E.A :0.A *:.A EA.A :A.A E*.2A *@.2A

(
Grade

,ip

)lthough the choice to associate a row with a record rather than a column is arbitrary' it is almost uni(ersal. Cn other words' you are not li-ely to hear someone refer to a column of data as a single database record.

3#"

LibreOffice ".# $alc Guide

Associating a range with a name


Cn a Calc document' a range refers to a contiguous group of cells containing at least one cell. You can associate a meaningful name to a range' which allows you to refer to the range using the meaningful name. You can create either a database range' which has some database+li-e functionality' or a named range' which does not. ) name is usually associated with a range for one of three reasons% 1& )ssociating a range with a name enhances readability by using a meaningful name. 2& Cf a range is referenced by name in multiple locations' you can point the name to another location and all references point to the new location. 3& Hanges associated to a name are shown in the a(igator' which is a(ailable by pressing the '% -ey or clic-ing on the associated ranges. icon. The a(igator allows for ?uic- na(igation to the

?amed range
The most common usage of a named range is' as its name implies' to associate a range of cells with a meaningful name. 2or e3ample' create a range named Scores' and then use the following e?uation% =SUM Scores'. To create a named range' select the range to define. !se nsert < ?ames < %efine to open the 5efine ames dialog. !se the 5efine ames dialog to add and modify one named range at a time.

'igure 9.&. Define a named range Cn a macro' a named range is accessed' created' and deleted using the amedHanges property of a Calc document. !se the methods has4y ame$name& and get4y ame$name& to (erify and retrie(e a named range. The method getDlement ames$& returns an array containing the names of all named ranges. The amedHanges obGect supports the method add ew4yname' which accepts four argumentsN the name' content' position' and type. The macro in #isting 10 creates a named range' if it does not e3ist' that references a range of cells.
$hapter #3 $alc as a Simple Database 3#%

Listing #8. $reate a named range that references WSheet#.WBW3:WDW&.


Su; &dd.amed?an/e ' 5im o?an/e : =he created ran/e. 5im o?an/es : &ll named ran/es. 5im s.ameK : .ame of the named ran/e to create. 5im o4ell : 4ell o;Mect. 5im sK s.ameK = ,M<.?an/e, o?an/es = =his4omponent..amed?an/es (f .>= o?an/es.has"<.ame s.ameK' =hen ?BM >;tain the cell address ;< o;tainin/ the cell ?BM and then extractin/ the address from the cell. 5im o4ell&ddress &s ne6 com.sun.star.ta;le.4ell&ddress o4ell&ddress.Sheet = * :=he first sheet. o4ell&ddress.4olumn = # :4olumn ". o4ell&ddress.?o6 = ! :?o6 %. ?BM =he first ar/ument is the ran/e name. ?BM =he second ar/ument is the formula or expression to use. ?BM =he second ar/ument is usuall< a strin/ that ?BM defines a ran/e. ?BM =he third ar/ument specifies the ;ase address for ?BM relative cell references. ?BM =he fourth ar/ument is a set of fla/s that define ?BM ho6 the ran/e is used+ ;ut most ran/es use *. ?BM =he fourth ar/ument uses values from the ?BM .amed?an/e)la/ constants see =a;le #9'. sK = ,KSheet#.K"K%:K5K0, o?an/es.add.e6"<.ame s.ameK+ sK+ o4ell&ddress+ *' Bnd (f ?BM 1et a ran/e usin/ the created named ran/e. o?an/e = =his4omponent..amed?an/es./et"<.ame s.ameK' ?BM -rint the strin/ contained in cell KSheet#.K"K% o4ell = o?an/e./et?eferred4ells './et4ell"<-osition *+*' -rint o4ell./etStrin/ ' Bnd Su;

The method add ew4yname$& accepts four argumentsN the name' content' position' and type. The fourth argument to the method add ew4y ame$& is a combination of flags that specify how the named range will be used $see Table 1<&. The most common (alue is 0' which is not a defined constant (alue.

3#&

LibreOffice ".# $alc Guide

(able #". com.sun.star.sheet.@amed3ange'lag constants. ;alue


1 2 < *

.a(e
2C#TDHPCHCTDHC) "HC TP)HD) C;#!1 P/D)5DH H;0P/D)5DH

*escription
The range contains filter criteria. The range can be used as a print range. The range can be used as column headers for printing. The range can be used as row headers for printing.

The third argument' a cell address' acts as the base address for cells referenced in a relati(e way. Cf the cell range is not specified as an absolute address' the referenced range will be different based on where in the spreadsheet the range is used. The relati(e beha(ior is illustrated in #isting 11' which also illustrates another usage of a named rangecdefining an e?uation. The macro in #isting 11 creates the named range Add2eft' which refers to the e?uation &%$"% with C3 as the reference cell. The cells )3 and 43 are the two cells directly to the left of C3' so' the e?uation =&ddNeft ' calculates the sum of the two cells directly to the left of the cell that contains the e?uation. Changing the reference cell to C<' which is below )3 and 43' causes the )dd#eft e?uation to calculate the sum of the two cells that are to the left on the pre(ious row. Listing ##. $reate the ,ddLeft named range.
Su; &dd.amed)unction ' 5im oSheet :Sheet that contains the named ran/e. 5im o4ell&ddress :&ddress for relative references. 5im o?an/es :=he .amed?an/es propert<. 5im o?an/e :Sin/le cell ran/e. 5im s.ame &s Strin/ :.ame of the ePuation to create. s.ame = ,&ddNeft, o?an/es = =his4omponent..amed?an/es (f .>= o?an/es.has"<.ame s.ame' =hen oSheet = =his4omponent./etSheets './et"<(ndex *' o?an/e = oSheet./et4ell?an/e"<.ame ,4%,' o4ell&ddress = o?an/e./et4ell&ddress ' o?an/es.add.e6"<.ame s.ame+ ,&%$"%,+ o4ell&ddress+ *' Bnd (f Bnd Su;

,ip

#isting 11 illustrates two capabilities that are not widely -nown. ) named range can define a function. )lso' the third argument acts as the base address for cells referenced in a relati(e way.

,elect the range containing the headers and the data and then use nsert < ?ames < Create to open the Create ames dialog $see 2igure 2:E&' which allows you to simultaneously create multiple named ranges based on the top row' bottom row' right column or left column. Cf you choose to create ranges based on the top row' one named range is created for each column headercthe header is not included in the named range. )lthough the header is not included in the range' the te3t in the header is used to name the range.

$hapter #3 $alc as a Simple Database

3#A

igure 9.A. $reate a named range The macro in #isting 12 creates three named ranges based on the top row of a named range. Listing #9. $reate man2 named ranges.
Su; &ddMan<.amed?an/es ' 5im oSheet :Sheet that contains the named ran/e. 5im o&ddress :?an/e address. 5im o?an/es :=he .amed?an/es propert<. 5im o?an/e :Sin/le cell ran/e. o?an/es = =his4omponent..amed?an/es oSheet = =his4omponent./etSheets './et"<(ndex *' o?an/e = oSheet./et4ell?an/e"<.ame ,&#:4!*,' o&ddress = o?an/e./et?an/e&ddress ' o?an/es.add.e6)rom=itles o&ddress+ _ com.sun.star.sheet."order.=>-' Bnd Su;

The constants in Table 1A determine the location of the headers when multiple ranges are created using the method add ew2romTitles$&. (able #%. com.sun.star.sheet.Border constants. ;alue
0 1 2 3

.a(e
T;" 4;TT;1 HCG/T #D2T

*escription
,elect the top border. ,elect the bottom border. ,elect the right border. ,elect the left border.

Caution

Ct is possible to create multiple named ranges with the same name. Creating multiple ranges with a single command increases the li-elihood that multiple ranges will be created with the same nameca(oid this if possible.

%atabase range
)lthough a database range can be used as a regular named range' a database range also defines a range of cells in a spreadsheet to be used as a database. Dach row in a range corresponds to a record and each cell corresponds to a field. You can sort' group' search' and perform calculations on the range as if it were a database.
3#LibreOffice ".# $alc Guide

) database range pro(ides beha(ior that is useful when performing database related acti(ities. 2or e3ample' you can mar- the first row as headings. To create' modify' or delete a database range' use %ata < %efine 3ange to open the 5efine 5ata Hange dialog $see 2igure 2:*&. 0hen you first define a range' the 1odify button shown in the e3ample is labeled ew.

igure 9.-. Define a database range Cn a macro' a database range is accessed' created' and deleted from the 5atabaseHanges property. The macro in #isting 13 creates a database range named :2@ame and sets the range to be used as an auto filter. Listing #3. $reate a database range and an auto filter.
Su; &dd.e65ata;ase?an/e ' 5im o?an/e :5ata;ase?an/e o;Mect. 5im o&ddr :4ell address ran/e for the data;ase ran/e. 5im oSheet :)irst sheet+ 6hich 6ill contain the ran/e. 5im o5oc :?eference =his4omponent 6ith a shorter name. o5oc = =his4omponent (f .>= o5oc.5ata;ase?an/es.has"<.ame ,M<.ame,' =hen oSheet = =his4omponent./etSheets './et"<(ndex *' o?an/e = oSheet./et4ell?an/e"<.ame ,&#:)#*,' o&ddr = o?an/e./et?an/e&ddress ' o5oc.5ata;ase?an/es.add.e6"<.ame ,M<.ame,+ o&ddr'

$hapter #3 $alc as a Simple Database

3#.

Bnd (f o?an/e = o5oc.5ata;ase?an/es./et"<.ame ,M<.ame,' o?an/e.&uto)ilter = =rue Bnd Su;

+orting
The sorting mechanism in a Calc document rearranges the data in the sheet. The first step in sorting data is to select the data that you want to sort. To sort the data in Table 13' select the cells from )1 to G1@cif you include the column headers' indicate this in the sort dialog $see 2igure 300&. !se %ata < +ort to open the ,ort dialog $see 2igure 2::&. You can sort by up to three columns or rows at a time.

'igure 9... Sort b2 the @ame column Clic- on the ;ptions tab $see 2igure 300& to set the sort options. Chec- the 3ange contains column labels chec-bo3 to pre(ent column headers from being sorted with the rest of the data. The ,ort by list bo3 in 2igure 2:: displays the columns using the column headers if the 3ange contains column labels chec-bo3 in 2igure 300 is chec-ed. Cf the 3ange contains column labels chec-bo3 is not chec-ed' howe(er' then the columns are identified by their column nameN Column )' for e3ample. ormally' sorting the data causes the e3isting data to be replaced by the newly sorted data. The Copy sort results to chec-bo3' howe(er' causes the selected data to be left unchanged and a copy of the sorted data is copied to the specified location. You can either directly enter a target address $,heet3.)1' for e3ample& or select a predefined range. Chec- the Custom sort order chec-bo3 to sort based on a predefined list of (alues. To set your own predefined lists' use ,ools < =ptions < 2ibre=ffice Calc < +ort 2ists and then enter your own sort lists. "redefined sort lists are useful for sorting lists of data that should not be sorted alphabetically or numerically. 2or e3ample' sorting days based on their name.

398

LibreOffice ".# $alc Guide

Caution

0hen a cell is mo(ed during a sort operation' e3ternal references to that cell are not updated. Cf a cell that contains a relati(e reference to another cell is mo(ed' the reference is relati(e to the new position when sorting is finished. 6now the beha(ior of references during sorting and do not be alarmedN this is almost always what you wantcbecause the reference is to the right or left in the same row. )lso' we ha(e not found a spreadsheet program that e3hibits a different beha(ior for references while sorting.

igure 388. Set sort options

Filters
!se filters to limit the (isible rows in a spreadsheet. Generic filters' common to all sorts of data manipulations' are automatically pro(ided by the auto filter capability. You can also define your own filters.
)fter applying a filter' some rows are (isible and some rows are not. Cf you select multiple rows in one operation' you will also select the in(isible rows contained between the selected (isible rows. ;perations' such as delete' act on all of the selected rows. To a(oid this problem' you must indi(idually select each of the filtered rows using the control -ey.

Caution

$hapter #3 $alc as a Simple Database

39#

Auto filters
!se auto filters to ?uic-ly create easily accessible filters commonly used in many different types of applications. )fter creating an auto filter for a specific column' a combo bo3 is added to the column. The combo bo3 pro(ides ?uic- access to each of the auto filter types.

The )ll auto filter causes all rows to be (isible. The ,tandard auto filter opens the ,tandard 2ilter dialog and is the same as the standard
filter.

The Top 10 auto filter displays the ten rows with the largest (alue. Cf the (alue E0 is in the
top ten (alues' then all rows containing the (alue E0 in the filtered column are displayed. Cn other words' more than ten rows may be displayed.

)n auto filter entry is created for each uni?ue entry in the column.
To create an auto filter' first select the columns to filter. 2or e3ample' using the data in Table 13' select data in columns 4 and C. Cf you do not select the title rows' Calc as-s if the title row or the current row should be used. )lthough you can place the auto filter in any row' only the rows below the auto filter are filtered. !se %ata < Filter < AutoFilter to insert the auto filter combo bo3 in the appropriate cell. 2inally' use the drop+down arrow to choose an appropriate auto filter $2igure 301&.

'igure 38#: Use an auto filter with column $ Hemo(e an auto filter by repeating the steps to create the auto filtercin other words' the menu option acts as a toggle to turn the auto filter on and off. 0hen an auto filter is remo(ed' the combo bo3 is remo(ed from the cell. The macro in #isting 13 demonstrates creating an auto filter for a range.

+tandard filters
!se %ata < Filter < +tandard Filter to open ,tandard 2ilter dialog $see 2igure 302& and limit the (iew based on 1 to 3 filter conditions. !se %ata < Filter < 3emove Filter to turn off the filter.

399

LibreOffice ".# $alc Guide

'igure 389: Use the standard filter The macro in #isting 1< creates a simple filter for the first sheet. Listing #". $reate a simple sheet filter.
Su; SimpleSheet)ilter ' 5im oSheet : Sheet that 6ill contain the filter. 5im o)ilter5esc : )ilter descriptor. 5im o)ields *' &s .e6 com.sun.star.sheet.=a;le)ilter)ield oSheet = =his4omponent./etSheets './et"<(ndex *' ?BM (f ar/ument is =rue+ creates an empt< filter ?BM descriptor. (f ar/ument is )alse+ create a ?BM descriptor 6ith the previous settin/s. o)ilter5esc = oSheet.create)ilter5escriptor =rue' Qith o)ields *' ?BM Dou could use the 4onnection propert< to indicate ?BM ho6 to connect to the previous field. =his is ?BM the first field+ so this is not rePuired. :.4onnection = com.sun.star.sheet.)ilter4onnection.&.5 :.4onnection = com.sun.star.sheet.)ilter4onnection.>? ?BM =he )ield propert< is the Oero ;ased column ?BM num;er to filter. (f <ou have the cell+ <ou ?BM can use .)ield = o4ell.4ell&ddress.4olumn. .)ield = @ ?BM 4ompare usin/ a numeric or a strin/R .(s.umeric = =rue

$hapter #3 $alc as a Simple Database

393

?BM =he .umericAalue propert< is used ?BM ;ecause .(s.umeric = =rue from a;ove. ..umericAalue = C* ?BM (f (s.umeric 6as )alse+ then the ?BM Strin/Aalue propert< 6ould ;e used. ?BM .Strin/Aalue = ,6hat ever, ?BM Aalid operators include BM-=D+ .>=_BM-=D+ BSU&N+ ?BM .>=_BSU&N+ 1?B&=B?+ 1?B&=B?_BSU&N+ NBSS+ ?BM NBSS_BSU&N+ =>-_A&NUBS+ =>-_-B?4B.=+ ?BM ">==>M_A&NUBS+ and ">==>M_-B?4B.= .>perator = com.sun.star.sheet.)ilter>perator.1?B&=B?_BSU&N Bnd Qith ?BM =he filter descriptor supports the follo6in/ ?BM properties: (s4aseSensitive+ SJip5uplicates+ ?BM Use?e/ularBxpressions+ ?BM Save>utput-osition+ >rientation+ 4ontainsIeader+ ?BM 4op<>utput5ata+ >utput-osition+ and Max)ield4ount. o)ilter5esc.set)ilter)ields o)ields '' o)ilter5esc.4ontainsIeader = =rue oSheet.filter o)ilter5esc' Bnd Su;

0hen a filter is applied to a sheet' it replaces any e3isting filter for the sheet. ,etting an empty filter in a sheet will therefore remo(e all filters for that sheet $see #isting 1A&. Listing #%. 3emove the current sheet filter.
Su; ?emoveSheet)ilter ' 5im oSheet : Sheet to filter. 5im o)ilter5esc : )ilter descriptor. oSheet = =his4omponent./etSheets './et"<(ndex *' o)ilter5esc = oSheet.create)ilter5escriptor =rue' oSheet.filter o)ilter5esc' Bnd Su;

#isting 1@ demonstrates a more ad(anced filter that filters two columns and uses regular e3pressions. ,ome une3pected beha(ior occurred while wor-ing with #isting 1@. )lthough you can create a filter descriptor using any sheet cell range' the filter applies to the entire sheet. Listing #&. , simple sheet filter using two columns.
Su; SimpleSheet)ilter_! 5im oSheet : 5im o?an/e : 5im o)ilter5esc : 5im o)ields #' &s .e6 ' Sheet to filter. ?an/e to ;e filtered. )ilter descriptor. com.sun.star.sheet.=a;le)ilter)ield

oSheet = =his4omponent./etSheets './et"<(ndex *' o?an/e = oSheet./et4ell?an/e"<.ame ,B#!:1#T,' ?BM (f ar/ument is =rue+ creates an

39"

LibreOffice ".# $alc Guide

?BM empt< filter descriptor. o)ilter5esc = o?an/e.create)ilter5escriptor =rue' ?BM Setup a field to vie6 cells 6ith content that ?BM start 6ith the letter ;. Qith o)ields *' .)ield = * : )ilter column &. .(s.umeric = )alse : Use a strin/+ not a num;er. .Strin/Aalue = ,;.*, : Bver<thin/ startin/ 6ith ;. .>perator = com.sun.star.sheet.)ilter>perator.BSU&N Bnd Qith ?BM Setup a field that rePuires ;oth conditions and ?BM this ne6 condition rePuires a value /reater or ?BM ePual to 2*. Qith o)ields #' .4onnection = com.sun.star.sheet.)ilter4onnection.&.5 .)ield = @ : )ilter column ). .(s.umeric = =rue : Use a num;er ..umericAalue = 2* : Aalues /reater than 2* .>perator = com.sun.star.sheet.)ilter>perator.1?B&=B?_BSU&N Bnd Qith o)ilter5esc.set)ilter)ields o)ields '' o)ilter5esc.4ontainsIeader = )alse o)ilter5esc.Use?e/ularBxpressions = =rue oSheet.filter o)ilter5esc' Bnd Su;

Advanced filters
)n ad(anced filter supports up to eight filter conditions' as opposed to the three supported by the simple filter. The criteria for an ad(anced filter is stored in a sheet. The first step in creating an ad(anced filter is entering the filter criteria into the spreadsheet. 1& ,elect an empty space in the Calc document. The empty space may reside in any sheet in any location in the Calc document. 2& 5uplicate the column headings from the area to be filtered into the area that will contain the filter criteria. 3& Dnter the filter criteria underneath the column headings $see Table 1@&. The criterion in each column of a row is connected with ) 5. The criteria from each row are connected with ;H. (able #&. )*ample advanced filter criteria .a(e
YU)ndyU

/est 1

/est @
e*0

Bui- 1

Bui- @

)vera%e
f*0

Grade

,ip

5efine named ranges to reference your ad(anced filter criteria and any destination ranges for filtered data $see 2igure 2:@&. Dach appropriately configured named range is a(ailable in drop down list bo3es in the )d(anced 2ilter dialog $see 2igure 303&.

$hapter #3 $alc as a Simple Database

39%

)fter creating one or more sets of filter criteria' apply an ad(anced filter as follows% 1& ,elect the sheet ranges that contain the data to filter. 2& !se %ata < Filter < Advanced Filter to open the )d(anced 2ilter dialog $see 2igure 303&. 3& ,elect the range containing the filter criteria and any other rele(ant options. Clic- =6. )pplying an ad(anced filter using a macro is simple $see #isting 1E&. The cell range containing the filter criteria is used to create a filter descriptor' which is then used to filter the range containing the data.

'igure 383. ,ppl2 an advanced filter using a previousl2 defined named range Listing #A. Use an advanced filter.
Su; Use&n&dvanced)ilter ' 5im oSheet :& sheet from the 4alc document. 5im o?an/es :=he .amed?an/es propert<. 5im o4rit?an/e :?an/e that contains the filter criteria. 5im o5ata?an/e :?an/e that contains the data to filter. 5im o)ilt5esc :)ilter descriptor. ?BM ?an/e that contains the filter criteria oSheet = =his4omponent./etSheets './et"<(ndex #' o4rit?an/e = oSheet./et4ell?an/e"<.ame ,&#:1%,' ?BM ?BM ?BM ?BM ?BM Dou can also o;tain the ran/e containin/ the filter criteria from a named ran/e. o?an/es = =his4omponent..amed?an/es o?an/e = o?an/es./et"<.ame ,&vera/eNessC*,' o4rit?an/e = o?an/e./et?eferred4ells '

?BM =he data that <ou 6ant to filter oSheet = =his4omponent./etSheets './et"<(ndex *' o5ata?an/e = oSheet./et4ell?an/e"<.ame ,&#:1#0,' o)ilt5esc = o4rit?an/e.create)ilter5escriptor"<>;Mect o5ata?an/e' o5ata?an/e.filter o)ilt5esc' Bnd Su;

Change properties on the filter descriptor to change the beha(ior of the filter $see Table 1E&.

39&

LibreOffice ".# $alc Guide

The filter created in #isting 1E filters the data in place. 1odify the ;utput"osition property to specify a different output position $see #isting 1*&. The filter descriptor must be modified before the filter is applied. (able #A. ,dvanced filter properties. 1ropert$
Contains/eader Copy;utput5ata CsCase,ensiti(e ;rientation ;utput"osition ,a(e;utput"osition ,-ip5uplicates !seHegularD3pressions

Co((ent
4oolean $true or false& that specifies if the first row $or column& contains headers which should not be filtered. 4oolean that specifies if the filtered data should be copied to another position in the document. 4oolean that specifies if the case of letters is important when comparing entries. ,pecifies if columns $com.sun.star.table.Table;rientation.C;#!1 ,& or rows $com.sun.star.table.Table;rientation.H;0,& are filtered. Cf if Copy;utput5ata is True ' specifies the position where filtered data are to be copied. 4oolean that specifies if the ;utput"osition position is sa(ed for future calls. 4oolean that specifies if duplicate entries are left out of the result. 4oolean that specifies if the filter strings are interpreted as regular e3pressions.

Listing #-. $op2 filtered results to a different location.


?BM 4op< the output data rather than filter in place. o)ilt5esc.4op<>utput5ata = =rue ?BM 4reate a 4ell&ddress and set it for Sheet%+ ?BM 4olumn "+ ?o6 9 remem;er+ start countin/ 6ith *' 5im x &s .e6 com.sun.star.ta;le.4ell&ddress x.Sheet = ! x.4olumn = # x.?o6 = % o)ilt5esc.>utput-osition = x

$)d(anced material.& The ;utput"osition property returns a copy of a struct. 4ecause a copy is returned' it is not possible to set the indi(idual (alues directly. 2or e3ample' o2ilt5esc.;utput"osition.How Y 2 does not wor- $because you set the How on the copy to 2' but do not change the original&.

4anipulating filtered data


2iltered data copied to a new location may be selected' modified' and deleted at will. 5ata that is not copied' howe(er' re?uires special attention because rows that do not match the filter criteria are simply hidden. #ibre;ffice beha(es differently depending on how the cells became hidden and what operation is done. Cells may be hidden using an outline' data filter' or the hide command. 0hen data is mo(ed by dragging or using cut and paste' all of the cells are mo(edcincluding the hidden cells. 0hen

$hapter #3 $alc as a Simple Database

39A

copying data' howe(er' filtered data includes only the (isible cells and data hidden using an outline or the hide command copies all of the data.

Calc functions similar to database functions


)lthough e(ery Calc function can be used for database manipulation' the functions in Table 1* are more commonly used as such. ,ome functionsI names differ only by the letter appended at the endN )BDH)GD and )BDH)GD)' for e3ample. 2unctions that do not end with the letter ) operate only on numeric (alues and cells that contain te3t or are empty are ignored. The corresponding function whose name ends with the letter )' treats te3t (alues as a number with the (alue of FeroN blan- cells are still ignored. (able #-. 'unctions freKuentl2 used as database functions. Function
)BDH)GD )BDH)GD) C;! T C;! T) C;! T4#) 6 C;! TC2 /#;;6!" C 5DQ C 5CHDCT #;;6!" 1)TC/ 1)Q 1)Q) 1C 1C ) 1D5C) 1;5D

*escription
Heturn the a(erage. Cgnore empty cells and cells that contain te3t. Heturn the a(erage. The (alue of te3t is 0 and empty cells are ignored. Count the number of numeric entriesN te3t entries are ignored. Count the number of non+empty entries. Heturn the number of empty cells. Heturn the number of cells that meet the search criteria. ,earch for a specific (alue across the columns in the first row of an array. Heturn the (alue from a different row in the same column. Heturn the content of a cell' specified by row and column number or an optional range name. Heturn the reference specified by a te3t string. Heturn the contents of a cell either from a one+row or one+column range or from an array. ,earch an array and return the relati(e position of the found item. Heturn the ma3imum numeric (alue in a list of arguments. Heturn the ma3imum numeric (alue in a list of arguments. The (alue of te3t is 0. Heturn the minimum numeric (alue in a list of arguments. Heturn the minimum numeric (alue in a list of arguments. The (alue of te3t is 0. Heturn the median of a set of numbers. Heturn the most common (alue in a data set. Cf there are se(eral (alues with the same fre?uency' it returns the smallest (alue. )n error occurs when a (alue doesnIt appear twice. Heturn the (alue of a cell offset by a certain number of rows and columns from a gi(en reference point. Heturn the product of the cells. Dstimate the standard de(iation based on a sample.

;22,DT "H;5!CT ,T5DB

39-

LibreOffice ".# $alc Guide

Function
,T5DB) ,T5DB" ,T5DB") ,!4T;T)# ,!1 ,!1C2 B)H B)H) B)H" B)H") B#;;6!"

*escription
Dstimate the standard de(iation based on a sample. The (alue of te3t is 0. Calculate the standard de(iation based on the entire population. Calculate the standard de(iation based on the entire population. The (alue of te3t is 0. Calculate a specified function based on a subset created using )uto2ilters. Heturn the sum of the cells. Calculate the sum for the cells that meet the search criteria. Dstimate the (ariance based on a sample. Dstimate the (ariance based on a sample. The (alue of te3t is 0. Dstimate the (ariance based on the entire population. Dstimate the (ariance based on the entire population. The (alue of te3t is 0. ,earch for a specific (alue across the rows in the first column of an array. Heturns the (alue from a different column in the same row.

1ost of the functions in Table 1* re?uire no e3planation' either because they are well understood $,!1' for e3ample& or because if you need to use them then you -now what they are $,T5DB' for e3ample&. !nfortunately' some of the more useful functions are infre?uently used because they are not well understood.

Count and sum cells that match conditions: C=*?, F and +*4 F
The C;! TC2 and ,!1C2 functions calculate their (alues based on search criteria. The search criteria can be a number' e3pression' te3t string' or e(en a regular e3pression. The search criteria can be contained in a referenced cell or it can be included directly in the function call. The C;! TC2 function counts the number of cells in a range that match specified criteria. The first argument to C;! TC2 specifies the range to search and second argument is the search criteria. Table 1: illustrates different search criteria using the C;! TC2 function referencing the data shown in Table 13. The first two arguments for ,!1C2 ser(e the same purpose as the arguments for C;! TC2N the range that contains the cells to search and the search criteria. The third and final argument for ,!1C2 specifies the range to sum. 2or each cell in the search range that matches the search criteria' the corresponding cell in the sum range is added into the sum. (able #.. )*amples of search criteria for the $OU@(0' and SU:0' functions. Criteria /$pe
umber Te3t D3pression D3pression

Function
YC;! TC2$41%C1@N :A& YC;! TC2$41%C1@N U:AU& YC;! TC2$41%C1@N Ue:AU& YC;! TC2$41%C1@N 2Z<ARA&

&esult
3 3 @ 3

*escription
2inds numeric (alues of :A. 2inds numeric or te3t (alues of :A. 2inds numeric (alues greater than :A. 2inds only numeric (alues of :A.

$hapter #3 $alc as a Simple Database

39.

Criteria /$pe
Hegular e3pression Heference a cell

Function
YC;! TC2$41%C1@N U:.ZU& YC;! TC2$41%C1@N 43&

&esult
12 3

*escription
2inds numbers or te3t that start with :. 2inds a number or number and te3t depending on the data type in cell 43. ,um Column 4 for names in Col. ) starting with the letter 4.

Hegular e3pression

Y,!1C2$)1%)1@N U4.ZUN 41%41@&

22E

gnore filtered cells using +*7,=,A2


The ,!4T;T)# function applies a function $see Table 20& to a range of data' but it ignores cells hidden by a filter and cells that already contain a ,!4T;T)#. 2or e3ample' =SU"=>=&N !+ ,"!:"#0,' counts the number of cells in 42%41@ that are not hidden by a filter. (able 98. 'unction inde* for the SUB(O(,L function. Function index
1 2 3 < A @ E * : 10 11

Function
)BDH)GD C;! T C;! T) 1)Q 1C "H;5!CT ,T5DB ,T5DB" ,!1 B)H B)H"

,ip

5o not forget that the ,!4T;T)# function ignores cells that use the ,!4T;T)# function. ,ay you ha(e a spreadsheet that trac-s in(estments. The retirement in(estments are grouped together with a subtotal. The same is true of regular in(estments. You can use a single subtotal that includes the entire range without worrying about the subtotal cells.

*sing formulas to find data


Calc offers numerous methods to find data in a sheet. 2or e3ample' after setting up a simple or ad(anced search in #dit < Find B 3eplace' you can clic- on Find repeatedly to mo(e the display cursor to the ne3t instance. To limit what is displayed rather than simply mo(ing the cursor' use %ata < Filter. Calc also offers loo-up functions used in formulas' for e3ample a formula to loo- up a studentIs grade based on their test score.

338

LibreOffice ".# $alc Guide

!earc" a bloc0 of data usin% ;LOO#+1


!se B#;;6!" to search the first column $columns are (ertical& of a bloc- of data and return the (alue from another column in the same row. 2or e3ample' search the first column for the name K2redL and then return the (alue in the cell two columns to the right. B#;;6!" supports two forms% AN>>UU- search_valueV search_ran/eV return_column_index' AN>>UU- search_valueV search_ran/eV return_column_indexV sort_order' The first argument' search_value' identifies the (alue to find. The search (alue can be te3t' a number' or a regular e3pression. 2or e3ample' Fred searches for the te3t 2red' & searches for the number <' and F.W is the regular e3pression for finding something that starts with the letter 2. The second argument' search_ran/e' identifies the cells to searchN only the first column is searched. 2or e3ample' 7':(11 searches the same sheet containing the B#;;6!" formula and +heet".7':(11 searches the range 43%G10 on the sheet named ,heet2. The return_column_index identifies the column to returnN a (alue of 1 returns the first column in the range. The statement =AN>>UU- ,"o;,V &#:1TV #' finds the first row in )1%G: containing the te3t 7ob$ and returns the (alue in the first column. The first column is the searched column' so the te3t 7ob is returned. Cf the column inde3 is 2' then the (alue in the cell to the right of 4ob is returned% column 4. The final column' sort_order' is optional. The default (alue for sort_order is 1' which specifies that the first column is sorted in ascending orderN a (alue of 0 specifies that the data is not sorted. ) non+sorted list is searched by se?uentially chec-ing e(ery cell in the first column for an e3act match. Cf an e3act match is not found' the te3t X?HA is returned. ) more efficient search routine is used if the data is sorted in ascending order. Cf one e3act match e3ists' the returned (alue is the same as for a non+sorted listN but it is faster. Cf a match does not e3ist' the largest (alue in the column that is less than or e?ual to the search (alue is returned. 2or e3ample' searching for E in $3' A' 10& returns A because E is between A and 10. ,earching for 2E returns 10' and searching for 2 returns h /) because there is no match and no (alue less than 2. !se B#;;6!" when%

The data is arranged in rows and you want to return data from the same row. 2or e3ample'
student names with test and ?uiF scores to the right of the studentIs name.

,earching the first column of a range of data. !earc" a bloc0 of data usin% 3LOO#+1
!se /#;;6!" to search the first row $rows are horiFontal& of a bloc- of data and return the (alue from a row in the same column. /#;;6!" supports the same form and arguments as B#;;6!"% IN>>UU- search_valueV search_ran/eV return_ro6_index' IN>>UU- search_valueV search_ran/eV return_ro6_indexV sort_order' !se /#;;6!" when%

The data is arranged in columns and you want to return data from the same column. 2or
e3ample' student names with test and ?uiF scores underneath the studentIs name.

,earching the first row of a range of data. !earc" a row or colu(n usin% LOO#+1
#;;6!" is similar to /#;;6!" and B#;;6!". The search range for the #;;6!" function is a single sorted row or column. #;;6!" has two forms% N>>UU- search_valueV search_ran/e'
$hapter #3 $alc as a Simple Database 33#

N>>UU- search_valueV search_ran/eV return_ran/e' The search (alue is the same as /#;;6!" and B#;;6!". The search range' howe(er' must be a single row or a single columnN for e3ample' )E%)12 $(alues in column )& or CA%JA $(alues in row A&. Cf the returnPrange is omitted' the matched (alue is returned. !sing #;;6!" without a return range is the same as using /#;;6!" or B#;;6!" with a column inde3 of 1. The return range must be a single row or column containing the same number of elements as the search range. Cf the search (alue is found in the fourth cell in the search range' then the (alue in the fourth cell in the return range is returned. The return range can ha(e a different orientation than the search range. Cn other words' the search range can be a row and the return range may be a column. !se #;;6!" when%

The search data is sorted in ascending order. The search data is not stored in the same row' column' or orientation as the return data. +se M)/C3 to find t"e index of a value in a ran%e
!se 1)TC/ to search a single row or column and return the position that matches the search (alue. !se 1)TC/ to find the inde3 of a (alue in a range. The supported forms for 1)TC/ are as follows% =M&=4I search_valueV search_ran/e' =M&=4I search_valueV search_ran/eV search_t<pe' The search (alue and search range are the same as for #;;6!". The final argument' search type' controls how the search is performed. ) search type of 1' sorted in ascending order' is the default. ) search type of +1 indicates that the list is sorted in descending order. ) search type of 0 indicates that the list is not sorted. Hegular e3pressions can only be used on an unsorted list. !se 1)TC/ when%

You need an inde3 into the range rather than the (alue. The search data is in descending order and the data is large enough that the data must be
searched assuming that it is sortedN because it is faster to sort a sorted list.

Exa(ples
Consider the data in Table 13. Dach studentIs information is stored in a single row. 0rite a formula to return the a(erage grade for 2red. The problem can be restated as ,earch column ) in the range )1%G1@ for 2red and return the (alue in column 2 $column 2 is the si3th column&. The ob(ious solution is =AN>>UU- ,)red,V &!:1#0V 0'. D?ually ob(ious is =N>>UU- ,)red,V &!:&#0V )!:)#0'. Ct is common for the first row in a range to contain column headers. )ll of the search functions chec- the first row to see if there is a match and then ignore it if it does not contain a match' in case the first row is a header. 0hat if the column heading Average is -nown' but not the column containing the a(erage= 2ind the column containing )(erage rather than hard coding the (alue @. ) slight modification using 1)TC/ to find the column yields =AN>>UU- ,)red,V &!:1#0V M&=4I ,&vera/e,V &#:1#V *''N notice that the heading is not sorted. )s an e3ercise' use /#;;6!" to find )(erage and then 1)TC/ to find the row containing 2red. )s a final e3ample' write a formula to assign grades based on a studentIs a(erage score. )ssume that a score less than A1 is an 2' less than @1 is an D' less than E1 is a 5' less than *1 is a C' less than :1 is a 4' and :1 to 100 is an ). )ssume that the (alues in Table 21 are in ,heet2.

339

LibreOffice ".# $alc Guide

The formula =AN>>UU- C%V KSheet!.K&K!:K"K2V !' is an ob(ious solution. 5ollar signs are used so that the formula can be copied and pasted to a different location and it will still reference the same (alues in Table 21. (able 9#. ,ssociate scores to a grade. A
1 " ' & ! ,core 0 A1 @1 E1 *1 :1

7
Grade 2 D 5 C 4 )

A%%3#++ returns a string with a cellPs address


!se )55HD,, to return a te3t representation of a cell address based on the row' column' and sheetN )55HD,, is fre?uently used with 1)TC/. The supported forms for )55HD,, are as follows% &55?BSS ro6V column' &55?BSS ro6V columnV a;s' &55?BSS ro6V columnV a;sV sheet' The row and column are integer (alues where )55HD,,$1N 1& returns YAY1. The abs argument specifies which portion is considered absolute and which portion is considered relati(e $see Table 22&N an absolute address is specified using the g character. The sheet is included as part of the address only if the sheet argument is used. The sheet argument is treated as a string. !sing &55?BSS M&=4I ,"o;,V&#:&@ V *'V !' with the data in Table 21 returns Y7Y".
Calc supports numerous powerful functions that are not discussed here. 2or e3ample' the H;0' C;#!1 ' H;0,' and C;#!1 , statements are not discussedN a curious person would in(estigate these functions.

,ip

(able 99. Halues supported b2 the abs argument to ,DD3)SS. ;alue


1 2

*escription
!se absolute addressing. This is the default (alue if the argument is missing or an in(alid (alue is used. &55?BSS !V @V #' returns gDg2. !se an absolute row reference and a relati(e column reference. &55?BSS !V @V !V ,"lah,' returns 4lah.Dg2. !se a relati(e row reference and an absolute column reference. &55?BSS !V @V %' returns gD2. !se relati(e addressing. &55?BSS !V @V 9' returns D2.

3 <

$hapter #3 $alc as a Simple Database

333

?% 3#C, converts a string to a cell or range


!se C 5CHDCT to con(ert a string representation of a cell or range address to a reference to the cell or range. Table 23 contains e3amples accessing data as shown in Table 21. (able 93. )*amples using 0@D03)$(. Exa(ple
C 5CHDCT$U)2U& C 5CHDCT$G1& ,!1$C 5CHDCT$U41%4AU&& C 5CHDCT$)55HD,,$2N 1&&

Co((ent
Heturns cell )2' which contains 7ob. Cf Cell G1 contains the te3t )2' then this returns 7ob. Heturns the sum of the range 41%4A' which is 10&. Heturns the contents of cell g)g2' which is 7ob.

=FF+#, returns a cell or range offset from another


!se ;22,DT to return a cell or range offset by a specified number of rows and columns from a gi(en reference point. The first argument' specifies the reference point. The second and third arguments specify the number of rows and columns to mo(e from the reference pointN in other words' where the new range starts. The ;22,DT function has the following synta3% >))SB= referenceV ro6sV columns' >))SB= referenceV ro6sV columnsV hei/ht' >))SB= referenceV ro6sV columnsV hei/htV 6idth'

,ip

Cf the width or height is included' the ;22,DT function returns a range. Cf both the width and height are missing' a cell reference is returned.

Cf the height or width are missing' they default to 1. Cf the height is present' then a range reference is returned rather than a cell reference. !sing (alues from Table 13' #isting 1: uses ;22,DT to obtain the ?uiF scores for the student named 4ob. Listing #.. $omple* e*ample of O''S)(. =SUM >))SB= (.5(?B4= &55?BSS M&=4I ,"o;,V&#:&#0V *'V 9''V *V *V #V !'' Cn its entirety' #isting 1: is comple3 and difficult to understand. Table 2< isolates each function in #isting 1:' pro(iding an easy to understand e3planation of how the e3ample wor-s. (able 9". Brea4down of Listing #.. Function
1)TC/$U4obUN)1%)1@N 0& )55HD,,$<N <& C 5CHDCT$Ug5g<U& ;22,DT$g5g<N 0N 0N 1N 2& ,!1$5<%D<&

*escription
Heturn < because 4ob is the fourth entry in column ). Heturn g5g<. Con(ert g5g< into a reference to the cell 5<. Heturn the range 5<%D<. Heturn the sum of 4obIs ?uiF scores.

)lthough #isting 1: wor-s as intended' it brea-s easily and une3pectedly. Consider' for e3ample' what happens if the range is changed to )2%)1@. 1)TC/ returns an offset into the pro(ided range' so M&=4I ,"o;,V&!:&#0 V *' returns 3 rather than <. &55?BSS %V 9' returns g5g3 rather than g5g< and 4ettyIs ?uiF scores are returned instead of 4obIs. #isting 20 uses a slightly different method to obtain 4obIs ?uiF scores.
33" LibreOffice ".# $alc Guide

Listing 98. Better use of O''S)(.

=SUM >))SB= &#V M&=4I ,"o;,V &#:&#0V *'E#V %V #V !''


Table 2A contains a description of each function used in #isting 20. To help con(ince yourself that #isting 20 is better than #isting 1:' replace )1 with )2 in both #isting 20 and Table 2A and notice that you still obtain 4obIs ?uiF scores. (able 9%. Brea4down of Listing 98. Function
1)TC/$U4obUN)1%)1@N 0&+1 ;22,DT$)1N 3N 3N 1N 2& ,!1$5<%D<&

*escription
Heturn 3 because 4ob is the fourth entry in column ). Heturn the range 5<%D<. Heturn the sum of 4obIs ?uiF scores.

,ip

The first argument to ;22,DT can be a range so you can use a defined range name.

?%#O returns cells inside a specified range


C 5DQ returns the cells specified by a row and column number. The row and column number are relati(e to the upper left corner of the specified reference range. 2or e3ample' using =(.5BW "!:5%V #V #' returns the cell 42. Table 2@ lists shows the synta3 for using the C 5DQ function. (able 9&. S2nta* for 0@D);. !$ntax
C 5DQ$reference& C 5DQ$referenceN row& C 5DQ$referenceN rowN column&

*escription
Heturn the entire range. Heturn the specified row in the range. Heturn the cell specified by row and column. ) row and column of 1 returns the cell in the upper left corner of the range. ) reference range can contain multiple ranges. The range argument specifies which range to use.

C 5DQ$referenceN rowN columnN range&

The C 5DQ function can return an entire range' a row' or a single column $see Table 2@&. The ability to inde3 based on the start of the reference range pro(ides some interesting uses. !sing the (alues shown in Table 13' #isting 21 finds and returns 4obIs ?uiF scores. Table 2E contains a listing of each function used in #isting 21. Listing 9#. 3eturn BobUs Kui1 scores. =SUM >))SB= (.5BW &!:1#0V M&=4I ,"o;,V &!:&#0V *''V *V %V #V !'' (able 9A. Brea4down of Listing 9#. Function
1)TC/$U4obUN)2%)1@N 0& C 5DQ$)2%)1@N 3& ;22,DT$)<%G<N 0N 3N 1N 2&
$hapter #3 $alc as a Simple Database

*escription
Heturn 3 because 4ob is the third entry in column )2%)1@. Heturn )<%G<cthe row containing 4obIs ?uiF scores. Heturn the range 5<%D<.
33%

Function
,!1$5<%D<&

*escription
Heturn the sum of 4obIs ?uiF scores.

,ip

) simple range contains one contiguous rectangular region of cells. Ct is possible to define a multi+range that contains multiple simple ranges. Cf the reference consists of multiple ranges' you must enclose the reference or range name in parentheses.

Cf reference argument to the C 5DQ function is a multi+range' then the range argument specifies which simple range to use $see Table 2*&. (able 9-. Using 0@D); with a multi!range. Function
YC 5DQ$42%G2N 1N 2& YC 5DQ$4A%GAN 1N 2& YC 5DQ$$42%G2N4A%GA&N 1N 2& YC 5DQ$$42%G2N4A%GA&N 1N 2N 1& YC 5DQ$$42%G2N4A%GA&N 1N 2N 2&

&eturns
:3 @A :3 :3 @A

%atabase/specific functions
)lthough e(ery Calc function can be used for database manipulation' the functions in Table 2: are specifically designed for use as a database. The descriptions in Table 2: use the following terms interchangeably% row and record' cell and field' and database and all rows. (able 9.. Database functions in a $alc document. Function
5)BDH)GD 5C;! T 5C;! T) 5GDT 51)Q 51C 5"H;5!CT 5,T5DB 5,T5DB" 5,!1 5B)H

*escription
Heturn the a(erage of all fields that matches the search criteria. Count the number of records containing numeric data that match the search criteria. Count the number of records containing te3t data that match the search criteria. Heturn the contents of a field that matches the search criteria. Heturn the ma3imum content of a field that matches the search criteria. Heturn the minimum content of a field that matches the search criteria. Heturn the product of the fields that matches the search criteria. Calculate the standard de(iation using the fields that match the search criteria. The fields are treated as a sample. Calculate the standard de(iation using the fields that match the search criteria. The fields are treated as the entire population. Heturn the sum of all fields that matches the search criteria. Calculate the (ariance using the fields that match the search criteria. The fields are treated as a sample.

33&

LibreOffice ".# $alc Guide

Function
5B)H"

*escription
Calculatesthe (ariance using the fields that match the search criteria. The fields are treated as the entire population.

The synta3 for the database functions are identical. 54>U.= data;aseV data;ase fieldV search criteria' The database argument is the cell range that defines the database. The cell range should contain the column labels $see #isting 22&. The following e3amples' assume that the data from Table 13 is placed in ,heet 1 and the filter criteria in Table 1@ is placed in ,heet 2. Listing 99. (he database argument includes the headers. =54>U.= &#:1#0V ,=est !,V Sheet!.&#:1%' The database field specifies the column on which the function operates after the search criteria is applied and the data rows are selected. The database field can be specified using the column header name or as an integer. Cf the column is specified as an integer' 0 specifies the entire data range' 1 specifies the first column' 2 specifies the second column' and so on. #isting 23 calculates the a(erage test score for the rows that match the search criteria. Listing 93. Q(est 9R is column 3. =5&AB?&1B &#:1#0V ,=est !,V Sheet!.&#:1%' =5&AB?&1B &#:1#0V %V Sheet!.&#:1%' The search criteria is the cell range containing search criteria. The search criteria is identical to the ad(anced filtersN criteria in the same row is connected by ) 5 and criteria in different rows is connected by ;H.

Conclusion
) Calc document pro(ides sufficient database functionality to satisfy the needs of most people. The infre?uently used database functions' such as ;22,DT and C 5DQ' are worth the time to learn and they can sa(e yourself time in the long run.

$hapter #3 $alc as a Simple Database

33A

$hapter #" Setting up and $ustomi1ing $alc

ntroduction
This chapter describes some common customiFations that you may wish to do. Cn addition to selecting options from those pro(ided' you can customiFe menus' toolbars' and -eyboard shortcuts' add new menus and toolbars' and assign macros to e(ents. /owe(er' you cannot customiFe conte3t $right+clic-& menus. ;ther customiFations are made easy by e3tensions that you can install from the #ibre;ffice website or from other pro(iders.
Changes to menus and toolbars can be sa(ed in a template. 2irst' sa(e the document that was open when these changes were made. Then' sa(e that document as a template' as described in Chapter <' !sing ,tyles and Templates in Calc.

?ote

2ibre=ffice options
This section co(ers some of the settings that apply to all the components of #ibre;ffice and are of particular interest to users of Calc. ;ther general options are discussed in Chapter 2' ,etting !p #ibre;ffice' in the Getting Started guide. 1& Choose ,ools < =ptions $2ibre=ffice < Preferences on a 1ac& to open the ;ptions dialog. The list on the left+hand side of the ;ptions dialog (aries depending on which #ibre;ffice component is open. The illustrations in this chapter show the list as it appears when Calc is open. 2& Clic- the e3pansion symbol $R or triangle& by LibreOffice on the left+hand side. ) list of subsections drops down.

'igure 38": Options E LibreOffice E User Data page

?ote

The 3evert button has the same effect on all pages of the ;ptions dialog. Ct resets the options to the (alues that were in place when you opened #ibre;ffice.

3"8

LibreOffice ".# $alc Guide

*ser %ata options


!ser data is used by templates and 0iFards in #ibre;ffice. 2or e3ample' Calc uses the first and last name stored here to fill in the $reated and :odified fields in the document properties' the optional ,uthor field often used in the footer of a printed spreadsheet' and the name associated with comments. Cf you want your name to appear' then fill in the form on the LibreOffice E User Data page $2igure 30<&. Cf you are using a (ersion of #ibre;ffice other than !, Dnglish' some field labels may be different from those shown in the illustration. ,ome of the user data is included automatically in an internal dictionary so that it is recogniFed by the spelling chec-er. Cf typing errors are made' the program can use this data to suggest replacements. ote that changes to data ta-e effect only after #ibre;ffice is restarted.

Print options
;n the LibreOffice E $olors page' you can set the print options to suit your default printer and your most common printing method. You can change these settings at any time' either through this dialog or during the printing process $by clic-ing the =ptions button on the "rint dialog&. ,ee Chapter @' "rinting' D3porting' and D+mailing' in this guide for more about these options.

Color options
;n the LibreOffice E $olors page' you can specify colors to use in #ibre;ffice documents. You can select a color from a color table' edit an e3isting color' and define new colors. These colors are stored in your color selection palette and are then a(ailable in all components of #ibre;ffice.

'igure 38%: Defining colors to use in color palettes in LibreOffice To modify a color% 1& ,elect the color to modify from the list or the color table. 2& Dnter the new (alues that define the color. Cf necessary' change the settings from HG4 $Hed' Green' 4lue& to C1Y6 $Cyan' 1agenta' Yellow' 4lac-& or (ice (ersa. The changed color appears in the lower of the two color pre(iew bo3es at the top. 3& 1odify the @ame as re?uired. <& Clic- the 4odify button. The newly defined color is now listed in the Color table.
$hapter #" Setting up and $ustomi1ing $alc 3"#

)lternati(ely' clic- the #dit button to open the Color "ic-er dialog' shown in 2igure 30@. /ere you can select a color from the window on the left' or you can enter (alues on the right using your choice of HG4' C1Y6' or /,4 $/ue' ,aturation and 4rightness& (alues. The color window on the left is lin-ed directly with the color input fields on the rightN as you choose a color in the window' the numbers change accordingly. The color field at the lower left shows the (alue of the selected color on the left and the currently set (alue from the color (alue fields on the right.

'igure 38&: )diting colors 1odify the color components as re?uired and clic- =6 to e3it the dialog. The newly defined color now appears in the lower of the color pre(iew bo3es shown in 2igure 313. Type a name for this color in the @ame bo3' then clic- the Add button. ) small bo3 showing the new color is added to the Color table. )nother way to define or alter colors is through the Colors page of the )rea dialog' where you can also sa(e and load palettes' a feature that is not possible here. Cn Calc' draw a temporary draw obGect and use the conte3t menu of this obGect to open the )rea dialog. Cf you load a palette in one component of #ibre;ffice' it is only acti(e in that componentN the other components -eep their own palettes.

+ecurity options
!se the LibreOffice E Securit2 page to choose security options for sa(ing documents and for opening documents that contain macros. +ecurity options and warnings Cf you record changes' sa(e multiple (ersions' or include hidden information or notes in your documents' and you do not want some of the recipients to see that information' you can set warnings to remind you to remo(e this information' or you can ha(e #ibre;ffice remo(e some information automatically. ote that $unless remo(ed& much of this information is retained in a file whether the file is in #ibre;fficeIs default ;pen5ocument format' or has been sa(ed to other formats' including "52. Clic- the =ptions button to open a separate dialog with specific choices $2igure 30*&.
3"9 LibreOffice ".# $alc Guide

'igure 38A: $hoosing securit2 options for opening and saving documents Passwords for web connections #ibre;ffice can sa(e any passwords associated with websites opened by clic-ing on a hyperlin-. Cf you choose Persistently save passwords for web connections' #ibre;ffice will securely store all passwords that you use to access files from web ser(ers. Cf you also set a master password' indi(idual passwords can be accessed only after the master password has been entered. To set a master password' select the Protected by a master password option and clic- the 4aster Password button. 4acro security Clic- the 4acro +ecurity button to open the 1acro ,ecurity dialog $not shown here&' where you can adGust the security le(el for e3ecuting macros and specify trusted sources. Certificate Path

?ote

This option appears only on #inu3 and 1ac systems. ;n 0indows' #ibre;ffice uses the default 0indows location for storing and retrie(ing certificates.

!sers can digitally sign documents using #ibre;ffice. ) digital signature re?uires a personal signing certificate. 1ost operating systems can generate a self+signed certificate. /owe(er' a personal certificate issued by an outside agency $after (erfiying an indi(idual>s identity& has a higher degree of trust associated with it than does a self+signed certificate. #ibre;ffice does not pro(ide a secure method of storing these certificates' but it can access certificates that ha(e been sa(ed using other programs. Clic- Certificate and select which certificate store to use.

!ecurit$ options and warnin%s


The following options are on the ,ecurity options and warnings dialog $2igure 321&. 3emove personal information on saving ,elect this option to always remo(e user data from the file properties when sa(ing the file. To manually remo(e personal information from specific documents' deselect this option and then use the %elete button under File < Properties < (eneral.

$hapter #" Setting up and $ustomi1ing $alc

3"3

Ctrl/click re@uired to follow hyperlinks The default beha(ior in most components of #ibre;ffice is to $trl5clic4 on a hyperlin- to open the lin-ed document' but you can choose to open hyperlin-s using a single clic-. /owe(er' Calc opens hyperlin-s using a single clic-' regardless of the selection for this option. The other options on this dialog should be self+e3planatory.

'igure 38-: Securit2 options and warnings dialog

Appearance options
;n the LibreOffice E ,ppearance page' you can specify which items are (isible and the colors used to display (arious elements of the user interface. These colors are not printed when you print a spreadsheet.

'igure 38.: $hanging the color of grid points in $alc

3""

LibreOffice ".# $alc Guide

,croll down the list until you find the section headed +preadsheet. To change the default color for grid lines or other on+screen indicators' clic- the down+arrow by the color and select a new color from the drop+down list. Cf you wish to sa(e your color changes as a color scheme' clic- +ave$ type a name in the @ame of color scheme bo3 in the pop+up dialog' and then clic- =6.

2oading and saving documents


You can set the #oad/,a(e options to suit the way you wor-. This chapter describes only a few of the options' those most rele(ant to wor-ing with Calc. ,ee Chapter 2' ,etting !p #ibre;ffice' in the Getting Started guide for a description of the other options. Cf the ;ptions dialog is not already open' clic- ,ools < =ptions. Clic- the e3pansion symbol $R or triangle& by 2oadH+ave on the left+hand side to display the list of load/sa(e options pages.

'igure 3#8: Load Save options

(eneral
1any of the choices on the Load Save E General page $2igure 311& are familiar to users of other office suites. Those of most interest to Calc users are in the Default file format and OD' settings section. ,ee Chapter 2' ,etting !p #ibre;ffice' in the Getting Started guide for information about other options. =%F format version #ibre;ffice by default sa(es documents in ;pen5ocument 2ormat $;52& (ersion 1.2 D3tended. 0hile this allows for impro(ed functionality' there may be bac-wards compatibility issues. 0hen a file sa(ed in ;52 1.2 D3tended is opened in an editor that uses an earlier (ersion of ;52 $1.0/1.1&' some of the ad(anced features may be lost. Two notable e3amples are cross+references to headings and the formatting of numbered lists. Cf you plan to share documents with people who are use editors that use older (ersions of ;52' you may wish to sa(e the document using ;52 (ersion 1.0/1.1. +i5e optimi5ation for =%F format #ibre;ffice documents are Q1# files. 0hen you select this option' #ibre;ffice writes the Q1# data without indents and line brea-s. Cf you want to be able to read the Q1# files in a te3t editor in a structured form' deselect this option. %ocument type Cf you routinely share documents with users of 1icrosoft D3cel' you might want to change the Always save as attribute for spreadsheets to one of the D3cel formats. /owe(er' we recommend that you always sa(e a wor-ing copy in ;5, format and only create an D3cel (ersion if necessary for sharing. )lso' note that recent and current (ersions of 1icrosoft D3cel can open ;5, files' so this may no longer be needed.

$hapter #" Setting up and $ustomi1ing $alc

3"%

'igure 3##: $hoosing Load and Save options

?ote

#ibre;ffice can open and sa(e files in the .3ls3 format produced by 1icrosoft ;ffice 200E' 2010' and later.

>7A Properties
;n the Load Save E HB, Properties page' you can choose whether to -eep any B4) $Bisual 4asic for )pplications& macros in 1icrosoft ;ffice documents that are opened in #ibre;ffice.

'igure 3#9: $hoosing Load Save HB, Properties

3"&

LibreOffice ".# $alc Guide

2oad 7asic code The original B4) code will be loaded as a disabled #ibre;ffice 4asic module. You can edit the code. 0hen sa(ing the document in #ibre;ffice format' the 4asic code is sa(ed as well. 0hen the document is sa(ed in another format' the #ibre;ffice 4asic code is not sa(ed. #.ecutable code The B4) code will be loaded ready to be e3ecuted. Cf this option is not selected' the B4) code will be commented out so it can be inspected' but will not run. )s a safety precaution against (iruses and other malicious code' you may wish to disable the e3ecutable code option. +ave original 7asic code ) bac-up copy of the original code' written in 4asic' is sa(ed with the document. Save original Basic code ta-es precedence o(er Load Basic code. Cf both options are selected and you edit the disabled code in #ibre;ffice' the original 1icrosoft 4asic code will be sa(ed when sa(ing in a 1icrosoft ;ffice format. To remo(e any possible macro (iruses from the 1icrosoft ;ffice document' deselect ,a(e original 4asic code. The document will be sa(ed without the 1icrosoft 4asic code.

4icrosoft =ffice
;n the Load Save E :icrosoft Office page' you can choose what to do when importing and e3porting 1icrosoft ;ffice ;#D obGects $lin-ed or embedded obGects or documents such as spreadsheets or e?uations&.

'igure 3#3: $hoosing Load Save :icrosoft Office options ,elect the V#W options to con(ert 1icrosoft ;#D obGects into the corresponding #ibre;ffice ;#D obGects when a 1icrosoft document is loaded into #ibre;ffice $mnemonic% K#L for KloadL&. ,elect the V,W options to con(ert #ibre;ffice ;#D obGects into the corresponding 1icrosoft ;#D obGects when a document is sa(ed in a 1icrosoft format $mnemonic% K,L for Ksa(eL&.

;,42 compatibility
Choices made on the Load Save E +(:L $ompatibilit2 page $2igure 31<& affect /T1# pages imported into #ibre;ffice and those e3ported from #ibre;ffice. ,ee Chapter 2' ,etting up #ibre;ffice' in the Getting Started guide' and +(:L documentsM importing e*porting in the /elp' for more information. The main items of interest for Calc users are in the )*port section% LibreOffice Basic and Displa2 warning.

$hapter #" Setting up and $ustomi1ing $alc

3"A

'igure 3#": $hoosing +(:L compatibilit2 options #.port / 2ibre=ffice 7asic ,elect this option to include #ibre;ffice 4asic macros $scripts& when e3porting to /T1# format. You must acti(ate this option before you create the #ibre;ffice 4asic macroN otherwise the script will not be inserted. #ibre;ffice 4asic macros must be located in the header of the /T1# document. ;nce you ha(e created the macro in the #ibre;ffice 4asic C5D' it appears in the source te3t of the /T1# document in the header. Cf you want the macro to run automatically when the /T1# document is opened' choose ,ools < Customi5e < #vents. ,ee Chapter 12' Calc 1acros' for more information. #.port / %isplay warning 0hen the 2ibre=ffice 7asic option $see abo(e& is not selected' the %isplay warning option becomes a(ailable. Cf the %isplay warning option is selected' then when e3porting to /T1# a warning is shown that #ibre;ffice 4asic macros will be lost.

Calc options
Calc must be open in order for the #ibre;ffice Calc options to be displayed in the ;ptions dialog. Clic- the e3pansion symbol $R or triangle& by LibreOffice $alc on the left+hand side. ) list of subsections drops down.

'igure 3#%: $alc options


3"LibreOffice ".# $alc Guide

(eneral options
Cn the ;ptions dialog' choose 2ibre=ffice Calc < (eneral.

'igure 3#&: Selecting general options for $alc

Metrics
Choose the unit of measurement used in spreadsheets and the default tab stops distance.

+pdatin%
Choose whether to update lin-s when opening a document always' only on re?uest' or ne(er. Hegardless of this setting' you can manually update lin-s at any time by selecting ,ools < *pdate < 2inks or pressing '.. ,preadsheets that include many or large charts or graphics may load slowly if this option is set to alwa2s.

nput settin%s section


Press #nter to move selection ,pecifies that pressing )nter mo(es the cursor to another cell. Cf this option is selected' you can also choose the direction the cursor mo(es% up' down' left' or right. Cf this option is not selected' pressing )nter places the data into the cell but does not mo(e the cursor. Press #nter to switch to edit mode ,pecifies that pressing )nter puts the selected cell into edit mode. To end Ddit mode and mo(e the cursor in the desired direction' press )nter again. #.pand formatting ,pecifies whether to automatically apply the formatting attributes of an inserted cell to empty adGacent cells. Cf' for e3ample' an inserted cell has the bold attribute' this attribute will also apply to empty adGacent cells. /owe(er' cells that already ha(e a special format will not be modified by this function. To see the affected range' press $trl5S $multiplication sign on the number pad&. The format will also apply to all new (alues inserted within this range.

$hapter #" Setting up and $ustomi1ing $alc

3".

#.pand references when new columnsHrows are inserted ,pecifies whether to e3pand references when inserting columns or rows adGacent to the reference range. This is only possible if the reference range' where the column or row is inserted' originally spanned at least two cells in the desired direction. D3ample% Cf the range )1%41 is referenced in a formula and you insert a new column after column 4' the reference is e3panded to )1%C1. Cf the range )1%41 is referenced and a new row is inserted under row 1' the reference is not e3panded' since there is only a single cell in the (ertical direction. Cf you insert rows or columns in the middle of a reference area' the reference is always e3panded. ;ighlight selection in columnHrow headings ,pecifies whether to highlight column and row headers in the selected columns or rows. *se printer metrics for te.t formatting ,elect this option to use the properties of the default printer to format the display of a spreadsheet. Those properties can be found by choosing File < Printer +ettings and then select the Properties button for the default printer. Cf the printer has options for page setup' those settings will be applied to Calc documents. Cf this option is not selected' pages will be configured for a generic printer. +how overwrite warning when pasting data "asting contents of the clipboard into a cell will replace the contents of that cell with what is in the clipboard. ,elect this option to be alerted to a possible loss of data when pasting.

%efaults
Dnter the number of wor-sheets to be opened by default when you start a new spreadsheet and either accept the default sheet prefi3 or type a new one. )fter a spreadsheet has been created' you can add new sheets and change the label of any tabN see Chapter 1' Cntroducing Calc' for more information.

>iew options
The options on the LibreOffice $alc E Hiew page $2igure 31E& affect the way the document window loo-s and beha(es when (iewed onscreen.

;isual aids section


(rid lines Grid lines are the borders around the cells of a spreadsheet when (iewed onscreen. The options are% +how' +how on colored cells' or ;ide. Cf grid lines are hidden' tables will be displayed on a solid bac-ground with no grid around cells. The color choice o(errides the selection made in ,ools < =ptions < 2ibre=ffice < Appearance < +preadsheet < (rid lines.

?ote

To print grid lines' choose Format < Page < +heet < Print < (rid.

3%8

LibreOffice ".# $alc Guide

'igure 3#A: Selecting view options for $alc Page breaks ,pecifies whether to (iew the page brea-s within a defined print area. ;elplines 8hile 4oving ,pecifies whether to (iew helplines when mo(ing drawings' frames' graphics' and other obGects. These lines help you align obGects.

'igure 3#-: +elplines visible when moving a graphic


$hapter #" Setting up and $ustomi1ing $alc 3%#

Cn 2igure 31*' the graph with the dar- bac-ground represents the image in its original location. The lighter area represents the position of the image as it is being mo(ed. /elplines are the horiFontal and (ertical dotted lines at the corners of the lighter obGect.

ObAects section
Choose whether to show or hide graphics' charts' and drawing obGects.

Coo( section
,elect the +ynchroni5e sheets option to apply any selected Foom $magnification& factor to all sheets in the spreadsheet. Cf this option is not selected' separate Foom factors can be applied to indi(idual sheets.

*ispla$ section
,elect (arious options for the onscreen display. Formulas 5isplay the content of a cell as a formula or as the results of that formula. Dero values 5isplay a Fero in a cell when the cell has a (alue of Fero' or display an empty cell. Comment indicator ,elect this option to show a small triangle in the top right corner of a cell that contains a comment. Cf tips are enabled in ,ools < =ptions < 2ibre=ffice < (eneral' the comment will become (isible when the mouse pointer ho(ers o(er the cell. Tips will appear regardless of the setting of this option. To always display a comment' right+clic- on the cell and select +how comment from the conte3t menu. >alue highlighting ,elect this option to highlight all (alues' or results of formulas' in the sheet. Te3t is highlighted in blac-N numbers in blueN and formulas' logical (alues' dates' and so on' in green. 0hen this command is acti(e' any colors assigned in the document are not displayed. Anchor Cf an inserted obGect' such as a picture' is anchored to a cell' an image of an anchor will appear in the cell to which the obGect is anchored. ,e.t overflow Cf a cell contains te3t that is wider than the width of the cell' the te3t is displayed o(er empty neighboring cells in the same row. Cf there is no empty neighboring cell' a small triangle at the cell border indicates that the te3t continues. Cf this option is selected' te3t will wrap inside the cell and the height of the row will e3pand to accommodate the hight of the e3panded cell. +how references in color ,elect this option to pro(ide a (isual aid to assist the editing of a formula. Dach reference is then highlighted in color in the formula' and the referenced cell range is enclosed by a colored border as soon as the cell containing the reference is selected for editing.

'igure 3#.: 'ormula references E visual aids


3%9 LibreOffice ".# $alc Guide

Window section
The following elements of the spreadsheet window can be made (isible or in(isible% column and row headers' horiFontal and (ertical scroll bars' sheet tabs' and' if an outline has been defined' outline symbols. Cf the +heet tabs option is not selected' you can only switch between the sheets by using the a(igator. ote that there is a slider between the horiFontal scrollbar and the sheet tabs that may be set to one end.

'igure 398: <indow options

Calculate options
!se the LibreOffice $alc E $alculate page to define the calculation settings for spreadsheets.

'igure 39#: $alc calculation options

$hapter #" Setting up and $ustomi1ing $alc

3%3

terative references section


Cterati(e references are formulas that are continuously repeated until the problem is sol(ed. Cn this section you can choose the number of appro3imation steps carried out during iterati(e calculations and the degree of precision of the answer. terations ,elect this option to enable iterations. Cf this options is not selected' an iterati(e reference causes an error message. +teps ,ets the ma3imum number of iteration steps. 4inimum Change ,pecifies the difference between two consecuti(e iteration step results. Cf the result of the iteration is lower than the minimum change (alue' then the iteration will stop.

*ate section
,elect the start date for the internal con(ersion from days to numbers. 1"H'1H1)00 $default& X ,ets 5ecember 30' 1*:: as day Fero. Cn calculations' .anuary 1' 1:00 is used as day one. 11H11H1011 $,tarCalc 1.0& X ,ets .anuary 1' 1:00 as day Fero. !se this setting for ,tarCalc 1.0 spreadsheets containing date entries. 11H11H101& X ,ets .anuary 1' 1:0< as day Fero. !se this setting for spreadsheets that are imported from foreign formats.

Ot"er options
,pecify a (ariety of options rele(ant to spreadsheet calculation. Case sensitive ,pecifies whether to distinguish between upper and lower case in te3ts when comparing cell contents. 2or e3ample: type >Test> in cell )1N and >test> in 41. Then type the formula UY)1Y41U in cell C1. Cf the Case sensitive option is chec-ed' ',LS) will appear in the cellN if the analysis was case insensiti(e' (3U) will appear in the cell. This option is not applied to the DQ)CT te3t function' which is always case+sensiti(e. %ecimal places #imits the number of decimals to be displayed for numbers with the general number format. This o(errides the setting applied in Format < Cells < ?umbers < ?umber < (eneral. This setting refers to how numbers are displa2ed. 0hen decimal places are limited' calculations are not affected because of rounding. Precision as shown The (alue entered into this field defines the precision used to perform calculations. )ll numbers will be rounded to the desired decimal places. umbers will be displayed according to the pre(ious setting but calculations will be less precise because rounded numbers are used in the calculations. +earch criteria S and T< must apply to whole cells The default search method in Calc is to search for any instance of the target regardless of the position of the target within a word. 2or e3ample' when searching for day' Calc will match 2riday' ,unday' and days. ,elect this option to search an e3act occurence of the target. 0ild card symbols can be used to e3pand the search to match the default condition. That is' searching for ZdayZ will match 2riday' ,unday' and days.

3%"

LibreOffice ".# $alc Guide

#nable regular e.pressions in formulas ,pecifies that regular e3pressions $an e3tended set of wild cards& are enabled when searching and also for character string comparisons. This relates to the database functions' and to B#;;6!"' /#;;6!" and ,D)HC/. Automatically find column and row labels Calc will name the range of data' under a column heading or to the right of a row heading' using the te3t in those headings. D3ample% Cell DA contains the te3t )urope. 4elow' in cell D@' is the (alue 100 and in cell DE the (alue 200. Cf the Automatically find column and row labels option is selected' you can write the following formula in cell )1% Y,!1$Durope&.
0hen calculations in(ol(e a range that includes an empty cell' ta-e note of the setting for %isplay Dero values in the 2ibre=ffice Calc < >iew options. Cf this option is not selected' a (alue of Fero will display as an empty cell. Dmpty cells and the (alue Fero are treated differently by many functions. 2or e3ample' C"un! would not include an empty cell as an item to be counted. The a(erage of eight cells' one of which contains the (alue /$r"' is not the same as the a(erage of se(en cells $an empty cell is not included in determining the a(erage&.

Caution

Formula options
!se the LibreOffice $alc E 'ormula options page to specify whether to use Calc or D3cel synta3' as well as choosing which separators you prefer to use in formulas. The separators choices o(erride the defaults in Calc and D3cel synta3.

'igure 399: 'ormula options

$hapter #" Setting up and $ustomi1ing $alc

3%%

For(ula options
Formula synta. ,ynta3 is the format in which formulas are written. Choose the synta3 most appropriate for your wor-. Cf you regularly open or sa(e to 1icrosoft D3cel formats' you may wish to use one of the D3cel synta3es. To illustrate the differences between synta3es' assume a spreadsheet contains two sheets. The cell C< can be referenced in three ways%

Calc A1 Yg,heet2.C< X the default synta3 for Calc. #.cel A1 Y,heet2lC< X the default of 1icrosoft D3cel. #.cel 31C1 Y,heet2lHV3WCV2W X tthe relati(e row and column addressing used in D3cel.
*se #nglish function names The default names for functions in Calc are those for the user>s locale. 2or Dnglish users' the localiFed names are the same as the Dnglish names. 0hen the language set by locale is not Dnglish' you may wish to e3press functions in DnglishN if so' select this option to change formula input and display' function wiFard' and formula tips.

*etailed calculation settin%s


1ost users will not need to change the default setting. 2or custom settings' select Custom and clic- %etails to choose reference synta3 and whether to treat empty strings as Fero.

!eparators
,eparators are used in functions to distinguish points in the range used in the function% the symbols used between elements. Dnter the separator character to be used for functions' row arrays' and column arrays. 2or e3ample' a comma can be used as a separator in functions and instead of writing Y,!1$)1N41NC1& the function would be e3pressed as Y,!1$)1'41'C1&.

+ort 2ists
,ort lists are used for more than sorting' for e3ample filling a series of cells during data entry. They are lists that are sorted in a particular order but not alphabetically or numericallyN for e3ample' days of the wee-. Cn addition to the supplied lists' you can define and edit your own lists' as described in K5efining a fill seriesL in Chapter 2' Dntering' Dditing' and 2ormatting 5ata.

'igure 393: Defining sorting lists in $alc

3%&

LibreOffice ".# $alc Guide

Change options
Cn the ;ptions dialog' choose 2ibre=ffice Calc < Changes.

'igure 39": $alc options for highlighting changes ;n this page you can specify options for highlighting recorded changes in spreadsheets. You can assign specific colors for insertions' deletions' and other changes' or you can let Calc assign colors based on the author of the changeN in the latter case' one color will apply to all changes made by that author. The selections made here are applied when change recording is enabled under File < Changes < 3ecord.

Compatibility options
Cn the ;ptions dialog' choose 2ibre=ffice Calc < Compatibility. This page pro(ides a ?uic- way to switch between #ibre;fficeIs default -ey bindings and ;pen;ffice.orgIs legacy default -ey bindings for Calc. 1ost of the defaults are identical' but there are some differences.

'igure 39%: $ompatibilit2 options for $alc 4e2 bindings The actions associated with the two -ey binding choices are shown in Table .

$hapter #" Setting up and $ustomi1ing $alc

3%A

(able 38: De2 bindings 6ey 7inding 4ac-space 5elete ControlR5 $CommandR5 on 1ac& )ltR5own)rrow $;ptionR5own)rrow on 1ac& %efault ;pens 5elete Contents dialog Cmmediately deletes contents 2ills cell content down within selection select header of range no action in empty cell =pen=ffice.org legacy Cmmediately deletes contents ;pens 5elete Contents dialog ;pens the ,election #ist dialog Cncreases row height

(rid options
The Grid page defines the grid settings for spreadsheets. !sing a grid helps you determine the e3act position of any charts or other obGects you may add to a spreadsheet. You can also set this grid in line with the snap grid. Cf you ha(e acti(ated the snap grid but wish to mo(e or create indi(idual obGects without snap positions' you can press the $trl -ey to deacti(ate the snap grid for as long as needed. Cn the ;ptions dialog' choose 2ibre=ffice Calc < (rid.

Grid section
Snap to grid acti(ates the snap function. Hisible grid displays grid points on the screen. These points are not printed.

&esolution section
/ere you can set the unit of distance for the spacing between horiFontal and (ertical grid points and subdi(isions $intermediate points& of the grid. S2nchroni1e a*es changes the current grid settings symmetrically.

'igure 39&: $alc grid options

Print options
Cn the ;ptions dialog' choose 2ibre=ffice Calc < Print. ,ee Chapter @' "rinting' D3porting' and D+ mailing' for more about the options on this page.

3%-

LibreOffice ".# $alc Guide

%efault colors for charts


!se ,ools < =ptions < Charts < %efault Colors to change the default colors used for charts or to add new data series to the list pro(ided.

'igure 39A: Defining chart colors To change the default color for a data series' select it in the left+hand column and then clic- on the re?uired color in the color table. To add another data series' clic- Add' then select the new series and clic- on the re?uired color. To add new colors to the color table' see KColor optionsL on page 3<1.

AutoCorrect functions
,ome people find some or all of the items in #ibre;fficeIs )utoCorrect function annoying because they change what you type when you do not want it changed. 1any people find some of the )utoCorrect functions ?uite helpfulN if you do' then select the rele(ant options. 4ut if you find une3plained changes appearing in your document' this is a good place to loo- to find the cause. To open the )utoCorrect dialog' clic- ,ools < AutoCorrect =ptions. You need to ha(e a document open for this menu item to appear. Cn Calc' this dialog has four tabs' as shown in 2igure 32*. ;ptions are described in the /elpN many will be familiar to users of other office suites.

$hapter #" Setting up and $ustomi1ing $alc

3%.

'igure 39-: (he ,uto$orrect dialog in $alc

Customi5ing the user interface


4enu font
Cf you want to change the menu font from that supplied by #ibre;ffice to the system font for your operating system' do this% 1& Choose ,ools < =ptions < 2ibre=ffice < >iew. 2& Chec- *se system font for user interface and clic- =6.

4enu content
Cn addition to changing the menu font' you can add and rearrange items on the menu bar' add items to menus' and ma-e other changes. To customiFe menus% 1& Choose ,ools < Customi5e. ;n the CustomiFe dialog' go to the 4enus page $2igure 32:&.

'igure 39.: $ustomi1e menus


3&8 LibreOffice ".# $alc Guide

2& Cn the +ave n drop+down list $h&' choose whether to sa(e this changed menu for Calc or for a selected document. 3& Cn the section 2ibre=ffice Calc 4enus' select from the 4enu drop+down list $b& the menu that you want to customiFe. The list includes all the main menus as well as sub+menus' which are menus that are contained under another menu. 2or e3ample' in addition to 'ile' )dit' Hiew' and so on' there is 'ile n Send and 'ile n(emplates. The commands a(ailable for the selected menu are shown in the central part of the dialog. <& To customiFe the selected menu' clic- on the 4enu $c& or 4odify $f& buttons. You can also add commands to a menu by clic-ing on the Add button $e&. These actions are described in the following sections. A& !se the up and down arrows $g& ne3t to the Dntries list $d& to mo(e the selected menu item to a different position. @& 0hen you ha(e finished ma-ing all your changes' clic- =6 $not shown in picture& to sa(e them.

Creatin% a new (enu


Cn the :enus page of the CustomiFe dialog' clic- ?ew $b& to display the dialog shown in 2igure 330. 1& Type a name for your new menu in the 4enu name bo3. 2& !se the up and down arrow buttons to mo(e the new menu into the re?uired position in the list of menu items. Clic- =6 to sa(e and return to the CustomiFe dialog. The new menu now appears on the list of menus in the CustomiFe dialog. $Ct will appear on the menu bar itself after you sa(e your customiFations.& )fter creating a new menu' you need to add some commands to it' as described in K)dding a command to a menuL on page 3@2.

'igure 338: ,dding a new menu

Modif$in% existin% (enus


To modify an e3isting menu' select it in the 1enu list and clic- the 4enu button $c& to drop down a list of modifications% 4ove' 3ename' %elete. ot all of these modifications can be applied to all the entries in the 1enu list. 2or e3ample' 3ename and %elete are not a(ailable for the supplied menus.

$hapter #" Setting up and $ustomi1ing $alc

3&#

To mo(e a menu $such as 'ile&' choose 4enu < 4ove. ) dialog similar to the one shown in 2igure 330 $but without the 4enu name bo3& opens. !se the up and down arrow buttons to mo(e the menu into the re?uired position. To mo(e submenus $such as 'ile X Send&' select the main menu $2ile& in the 1enu list and then' in the 1enu Content section of the dialog' select the submenu $,end& in the Dntries list and use the arrow -eys to mo(e it up or down in the se?uence. ,ubmenus are easily identified in the Dntries list by a small blac- triangle on the right hand side of the name.

)ddin% a co((and to a (enu


You can add commands to the supplied menus and to menus you ha(e created. ;n the CustomiFe dialog' select the menu in the 1enu list and clic- the Add button in the 1enu Content section of the dialog.

'igure 33#: ,dding a command to a menu ;n the )dd Commands dialog' select a category and then the command' and clic- Add. The dialog remains open' so you can select se(eral commands. 0hen you ha(e finished adding commands' clic- Close. 4ac- on the CustomiFe dialog' you can use the up and down arrow buttons to arrange the commands in your preferred se?uence.

Modif$in% (enu entries


Cn addition to changing the se?uence of entries on a menu or submenu' you can add submenus' rename or delete the entries' and add group separators. To begin' select the menu or submenu in the 1enu list near the top of the CustomiFe page' then select the entry in the Dntries list under 1enu Content. Clic- the 4odify button and choose the re?uired action from the drop+down list of actions. 1ost of the actions should be self+e3planatory. 7egin a group adds a separator line after the highlighted entry.

3&9

LibreOffice ".# $alc Guide

Creatin% an accelerator
You can allocate a letter in a custom menuIs name to be used as a -eyboard shortcut. $That letter will become underlined.& 0hen you press ,ltR that letter' that menu or command will be in(o-ed. D3isting submenus can also be edited to change the letter which is used to select them using the -eyboard when the menu is open. To create an accelerator% 1& ,elect a menu item from 4enu or #ntry from the 4enu Content. 2& Clic- the 4enu button if 4enu was selected or the 4odify button if an Dntry was selected. 3& ,elect 3ename. <& )dd a tilde $k& in front of the letter to use as an accelerator. 2or e3ample' if you had created a new menu named Art' you would do this% a& ,elect Art from 4enu. b& ,elect 4enu and then 3ename. c& Cnsert a tilde before the letter , in ,rt. d& Clic- =6 to close the Hename and CustomiFe dialogs. The , in the menu item ,rt is now underlined. "ress ,lt5, and the Art menu will open.

Caution

0hen assigning an accelerator' be careful not to use a letter that is already assigned to a menu or command associated with a menu item. The same letter+-ey combinations can be used for commands associated with different menu items but not for those associated with the same menu or menu item.

,oolbars
You can customiFe toolbars in se(eral ways' including choosing which icons are (isible and loc-ing the position of a doc-ed toolbar' as described in Chapter 1' Cntroducing #ibre;ffice' of the Getting Started guide. This section describes how to create new toolbars and add other icons $commands& to the list of those a(ailable on a toolbar. To get to the toolbar customiFation dialog' do any of the following%

;n the toolbar' clic- the arrow at the end of the toolbar and choose Customi5e ,oolbar. Choose >iew < ,oolbars < Customi5e from the menu bar. Choose ,ools < Customi5e from the menu bar and pic- the ,oolbars page $2igure 332&.
To customiFe a toolbar% 1& Cn the +ave n drop+down list' choose whether to sa(e this changed toolbar for Calc or for a selected document. 2& Cn the section 2ibre=ffice Calc ,oolbars' select from the ,oolbar drop+down list the toolbar that you want to customiFe. 3& You can create a new toolbar by clic-ing on the ?ew button' or customiFe e3isting toolbars by clic-ing on the ,oolbar or 4odify buttons' and add commands to a toolbar by clic-ing on the Add button. These actions are described below. <& 0hen you ha(e finished ma-ing all your changes' clic- =6 to sa(e them.

$hapter #" Setting up and $ustomi1ing $alc

3&3

'igure 339: (he (oolbars page of the $ustomi1e dialog

Creatin% a new toolbar


To create a new toolbar% 1& Choose ,ools < Customi5e < ,oolbars from the menu bar. 2& Clic- ?ew. ;n the ame dialog' type the new toolbar>s name and choose from the +ave n drop+down list where to sa(e this new toolbar% for Calc or for a selected document. The new toolbar now appears on the list of toolbars in the CustomiFe dialog. )fter creating a new toolbar' you need to add some commands to it' as described below.

)ddin% a co((and to a toolbar


Cf the list of a(ailable buttons for a toolbar does not include all the commands you want on that toolbar' you can add commands. 0hen you create a new toolbar' you need to add commands to it. 1& ;n the Toolbars page of the CustomiFe dialog' select the toolbar in the Toolbar list and clicthe Add button in the Toolbar Content section of the dialog.
3&" LibreOffice ".# $alc Guide

2& The )dd Commands dialog is the same as for adding commands to menus $2igure 331&. ,elect a category and then the command' and clic- Add. The dialog remains open' so you can select se(eral commands. 0hen you ha(e finished adding commands' clic- Close. Cf you insert an item which does not ha(e an associated icon' the toolbar will display the full name of the item% the ne3t section describes how to choose an icon for a toolbar command. 3& 4ac- on the CustomiFe dialog' you can use the up and down arrow buttons to arrange the commands in your preferred se?uence. <& 0hen you are done ma-ing changes' clic- =6 to sa(e.

C"oosin% icons for toolbar co((ands


Toolbar buttons usually ha(e icons' not words' on them' but not all of the commands ha(e associated icons. To choose an icon for a command' select the command and clic- 4odify < Change icon. ;n the Change Ccon dialog $2igure 333&' scroll through the a(ailable icons' select one' and clic- =6 to assign it to the command.

'igure 333: $hange 0con dialog To use a custom icon' create it in a graphics program and import it into #ibre;ffice by clic-ing the mport button on the Change Ccon dialog. Custom icons must be 1@ 3 1@ or 2@ 3 2@ pi3els in siFe and cannot contain more than 2A@ colors.

6eyboard shortcuts
Cn addition to using the built+in -eyboard shortcuts $listed in )ppendi3 )&' you can define your own. You can assign shortcuts to standard #ibre;ffice functions or your own macros and sa(e them for use with the entire #ibre;ffice suite or only for Calc.
4e careful when reassigning your operating systemIs or #ibre;fficeIs predefined shortcut -eys. 1any -ey assignments are uni(ersally understood shortcuts' such as '# for /elp' and are always e3pected to pro(ide certain results. )lthough you can easily reset the shortcut -ey assignments to the #ibre;ffice defaults' changing some common shortcut -eys can cause confusion' frustration and possible data loss or corruption' especially if other users share your computer.

Caution

$hapter #" Setting up and $ustomi1ing $alc

3&%

?ote

,hortcut -eys that are grayed out in the listing on the CustomiFe dialog' such as '# and '#8= are not a(ailable for reassignment.

To adapt shortcut -eys to your needs' use the CustomiFe dialog' as described below. 1& ,elect ,ools < Customi5e < 6eyboard. The De2board page of the CustomiFe dialog opens. 2& To ha(e the shortcut -ey assignment a(ailable only with Calc' select Calc in the upper right corner of the pageN otherwise select 2ibre=ffice to ma-e it a(ailable to e(ery component. 3& e3t select the re?uired function from the $ategor2 and 'unction lists. <& ow select the desired shortcut -eys in the Shortcut 4e2s list and clic- the 4odify button at the upper right. A& Clic- =6 to accept the change. ow the chosen shortcut -eys will e3ecute the function chosen in step 3 abo(e whene(er they are pressed.
)ll e3isting shortcut -eys for the currently selected 'unction are listed in the De2s selection bo3. Cf the De2s list is empty' it indicates that the chosen -ey combination is free for use. Cf it were not' and you wanted to reassign a shortcut -ey combination that is already in use' you must first delete the e3isting -ey.

?ote

Exa(pleD )ssi%nin% st$les to s"ortcut 0e$s


You can configure shortcut -eys to ?uic-ly assign styles in your document. 1& ;n the De2board page of the CustomiFe dialog' choose the shortcut -eys you want to assign a style to. Cn this e3ample' we ha(e chosen $trl53. 2& Cn the 'unctions section at the bottom of the dialog' scroll down in the Category list to St2les. Clic- the R sign to e3pand the list of styles. 3& Choose the category of style. $This e3ample uses a cell style' but you can also choose page styles.& The 'unction list now displays the names of the a(ailable styles for the selected category. The e3ample shows #ibre;fficeIs predefined cell styles. <& To assign $trl53 to be the shortcut -ey combination for the /eading style' select +eading in the 'unction list' and then clic- 4odify. $trl53 now appears in the De2s list on the right' and +eading appears ne3t to $trl53 in the ,hortcut -eys bo3 at the top. A& 1a-e any other re?uired changes' and then clic- =6 to sa(e these settings and close the dialog.

!avin% c"an%es to a file


Changes to the shortcut -ey assignments can be sa(ed in a -eyboard configuration file for use at a later time' thus permitting you to create and apply different configurations as the need arises. To sa(e -eyboard shortcuts to a file% 1& )fter ma-ing your -eyboard shortcut assignments' clic- the +ave button on the CustomiFe dialog. 2& Cn the ,a(e 6eyboard Configuration dialog' select ,ll files from the +ave as ,ype list. 3& e3t enter a name for the -eyboard configuration file in the File name bo3' or select an e3isting file from the list. Cf you need to' browse to find a file from another location. <& Clic- +ave. ) confirmation dialog appears if you are about to o(erwrite an e3isting file' otherwise there will be no feedbac- and the file will be sa(ed.

3&&

LibreOffice ".# $alc Guide

'igure 33": ,ssigning a cell st2le to a 4e2 combination

Loadin% a saved 0e$board confi%uration


To load a sa(ed -eyboard configuration file and replace your e3isting configuration' clic- the 2oad button near the bottom right of the CustomiFe dialog' and then select the configuration file from the #oad 6eyboard Configuration dialog.

&esettin% t"e s"ortcut 0e$s


To reset all of the -eyboard shortcuts to their default (alues' clic- the 3eset button near the bottom right of the CustomiFe dialog. !se this feature with care as no confirmation dialog will be displayedN the defaults will be set without any further notice or user input.

&unnin% (acros fro( 0e$ co(binations


You can also define shortcut -ey combinations that will run macros. These shortcut -eys are strictly user+definedN none are built in. 2or more information on macros' see Chapter 12' Calc 1acros.

Adding functionality with e.tensions


)n e3tension is a pac-age that can be installed into #ibre;ffice to add new functionality. )lthough indi(idual e3tensions can be found in different places' the official #ibre;ffice e3tension repository is at http%//e3tensions.libreoffice.org/. ,ome e3tensions are free of chargeN others are a(ailable for a fee. Chec- the descriptions to see what licenses and fees apply to the ones that interest you.

$hapter #" Setting up and $ustomi1ing $alc

3&A

nstalling e.tensions
To install an e3tension that is listed in the repository' follow these steps% 1& Cn #ibre;ffice' select ,ools < #.tension 4anager from the menu bar. Cn the D3tension 1anager dialog' clic- the (et more e.tensions online lin-. 2& ) browser window will open. 2ind the e3tension you want and clic- the (et Fe.tension nameG lin-. 3& 5epending on your operating system and browser settings' you may be able to select =pen with 2ibre=ffice from the download options and install the e3tenstion automatically. <& Cf the e3tension is downloaded and sa(ed' return to the D3tension 1anager dialog and clicAdd. 2ind and select the e3tension you want to install and clic- =pen. The e3tension begins installing. You may be as-ed to accept a license agreement. A& 0hen the installation is complete' the e3tension is listed in the D3tension 1anager dialog. To install an e3tension that is not listed in the repository' download the e3tension' then continue with step 3 abo(e.

?ote

To install a shared e3tension' you need write access to the #ibre;ffice installation directory.

'igure 33%: (he )*tension :anager dialog

3&-

LibreOffice ".# $alc Guide

,ppendi* , De2board Shortcuts

ntroduction
You can use Calc without a pointing de(ice such as a mouse or trac-ball' by using its built+in -eyboard shortcuts. #ibre;ffice has a general set of -eyboard shortcuts' a(ailable in all components' and a component+ specific set directly related to the wor- of that component. 2or help with #ibre;fficeIs -eyboard shortcuts or using #ibre;ffice with a -eyboard only' search the /elp supplied with #ibre;ffice $also a(ailable online at http%//help.libreoffice.org& using the KshortcutL or KaccessibilityL -eywords. Cn addition to using the built+in -eyboard shortcuts listed in this )ppendi3' you can define your own. ,ee Chapter 1<' ,etting !p and CustomiFing Calc' for instructions. 2ormatting and editing shortcuts are described in Chapter 2' Dntering' Dditing' and 2ormatting 5ata.

?ote for 4ac users


,ome -eystro-es and menu items are different on a 1ac from those used in 0indows and #inu3. The table below gi(es some common substitutions for the instructions in this chapter. 2or a more detailed list' see the application /elp. Windows or Linux
,ools < =ptions menu selection 3ight!clic4 $trl 6$ontrol7 '% '##

Mac equivalent
2ibre=ffice < Preferences $ontrol5clic4 $$ommand& ShiftRR'% R(

Effect
)ccess setup options ;pens a conte3t menu !sed with other -eys ;pens the a(igator ;pens the ,tyles and 2ormatting window

?avigation and selection shortcuts


(able 3#: Spreadsheet navigation shortcuts !"ortcut #e$s
$trl5+ome $trl5)nd +ome )nd $trl5Left ,rrow

Effect
1o(es the cursor to the first cell in the sheet $cell )1&. 1o(es the cursor to the last cell on the sheet that contains data. 1o(es the cursor to the first cell of the current row. 1o(es the cursor to the last cell of the current row in a column containing data. 1o(es the cursor to the left edge of the current data range. Cf the column to the left of the cell that contains the cursor is empty' the cursor mo(es to the ne3t column to the left that contains data. 1o(es the cursor to the right edge of the current data range. Cf the column to the right of the cell that contains the cursor is empty' the cursor mo(es to the ne3t column to the right that contains data.

$trl53ight ,rrow

3A8

LibreOffice ".# $alc Guide

!"ortcut #e$s
$trl5Up ,rrow

Effect
1o(es the cursor to the top edge of the current data range. Cf the row abo(e the cell that contains the cursor is empty' the cursor mo(es up to the ne3t row that contains data. 1o(es the cursor to the bottom edge of the current data range. Cf the row below the cell that contains the cursor is empty' the cursor mo(es down to the ne3t row that contains data. ,elects all cells containing data from the current cell to the end of the continuous range of data cells' in the direction of the arrow pressed. Cf used to select rows and columns together' a rectangular cell range is selected. 1o(es one sheet to the left. Cn the page pre(iew it mo(es to the pre(ious print page. 1o(es one sheet to the right. Cn the page pre(iew it mo(es to the ne3t print page. 1o(es the (iewable rows up one screen. 1o(es the (iewable rows down one screen. 1o(es the (iewable columns one screen to the left. 1o(es the (iewable columns one screen to the right. )dds the pre(ious sheet to the current selection of sheets. Cf all the sheets in a spreadsheet are selected' this combination only selects the pre(ious sheet. 1a-es the pre(ious sheet the current sheet. )dds the ne3t sheet to the current selection of sheets. Cf all the sheets in a spreadsheet are selected' this combination only selects the ne3t sheet. 1a-es the ne3t sheet the current sheet. ,elects the data range that contains the cursor. ) range is a contiguous cell range that contains data and is bounded by empty rows and columns. The KWL -ey is the multiplication sign on the numeric -ey pad. ,elects the matri3 formula range that contains the cursor. The UHV -ey is the di(ision sign on the numeric -ey pad. 4y default' mo(es the cursor down one cell in a selected range. To specify the direction that the cursor mo(es' choose ,ools < =ptions < 2ibre=ffice Calc < (eneral.

$trl5Down ,rrow

$trl5Shift5,rrow

$trl5Page Up $trl5Page Down Page Up Page Down ,lt5Page Up ,lt5Page Down Shift5$trl5Page Up

Shift5$trl5Page Down

$trl5S

$trl5 )nter Y in a selected range

,ppendi* , De2board Shortcuts

3A#

Function key shortcuts


(able 39: 'unction 4e2 shortcuts !"ortcut #e$s
'# Shift5'# $trl5'# '9

Effect
5isplays the #ibre;ffice help browser. 0hen the help browser is already open '# Gumps to the main help page. 5isplays conte3t help. 5isplays the comment that is attached to the current cell. ,witches to Ddit mode and places the cursor at the end of the contents of the current cell. Cf the cursor is in an input bo3 in a dialog that has a minimiFe button' the dialog is hidden and the input bo3 remains (isible. "ress '9 again to show the whole dialog. ;pens the 2unction 0iFard. 1o(es the cursor to the input line where you can enter a formula for the current cell. ;pens the :anage @ames dialog. ,witches between !pper Cnitials' !""DH and lower cases modes. ,hows or hides the Database Sources pane. Hearranges the relati(e or absolute references $for e3ample' )1' g)g1' g)1' )g1& in the input field. ,hows or hides the @avigator. Traces dependents. 1o(es the cursor to the ame bo3. Chec-s spelling in the current sheet. ;pens the (hesaurus if the current cell contains te3t. Traces precedents. ,witches between the standard and e*tended selection modes. Cn this mode' you can use the arrow -eys to e3tend the selection. You can also clic- in another cell to e3tend the selection. ,witches between the standard and add selection modes. Cn this mode' you can easily add indi(idual cells to a range. /ighlights cells containing numeric (alues $not te3t& blue' and formulas $te3t or number& green' or stop this highlight. Hecalculates all of the formulas in the sheet. !pdates the selected chart. ;pens the ,tyles and 2ormatting window where you can apply a formatting style to the contents of the cell or to the current sheet. Groups the selected data range. !ngroups the selected data range.

$trl5'9 Shift5$trl5'9 $trl5'3 Shift5'3 '" Shift5'" '% Shift5'% Shift5$trl5'% 'A $trl5'A Shift5'A '-

Shift5'$trl5''. $trl5'. '## $$ommand5( on 1ac& '#9 $trl5'#9

3A9

LibreOffice ".# $alc Guide

Arrow key shortcuts


(able 33. ,rrow 4e2 shortcuts !"ortcut #e$s
,lt5Down ,rrow ,lt5Up ,rrow ,lt5Shift5,rrow De2 ,lt5,rrow De2 E on a selected obGect

Effect
Cncreases the height of current row. 5ecreases the height of current row. ;ptimiFes the column width or row height based on the current cell. 1o(es with one pi3el a selected obGect $chart' image' drawing' form control& towards the pressed arrow $a pressed arrow without ,lt will mo(e it less accurately&.

Cell formatting shortcuts


$trl5# opens the 2ormat Cells dialog.
The shortcuts listed in Table Table 3< do not wor- under any #inu3 des-top tested. Cf you would li-e to ha(e the functionality described in this table' you must create custom -ey se?uences as e3plained in Chapter 1<' ,etting !p and CustomiFing Calc.

?ote

?ote

The shortcut -eys shown in Table Table 3< do not use the number -eys on the number pad. They use the number -eys abo(e the letter -eys on the main -eyboard.

(able 3": $ell formatting shortcut 4e2s !"ortcut #e$s


$trl5Shift5# $trl5Shift59 $trl5Shift53 $trl5Shift5" $trl5Shift5% $trl5Shift5&

Effect
Two decimal places' thousands separator ,tandard e3ponential format ,tandard date format ,tandard currency format ,tandard percentage format $two decimal places& ,tandard format

,ppendi* , De2board Shortcuts

3A3

Pivot table shortcuts


(able 3%: Pivot table shortcut 4e2s !"ortcut #e$s
(ab Shift5(ab Up arrow Down arrow Left arrow 3ight arrow +ome )nd ,lt53 ,lt5$ ,lt5D $trl5Up ,rrow $trl5Down ,rrow $trl5Left ,rrow $trl53ight ,rrow $trl5+ome $trl5)nd ,lt5O Delete

Effect
Changes the focus by mo(ing forward through the areas and buttons of the dialog. Changes the focus by mo(ing bac-ward through the areas and buttons of the dialog. 1o(es the focus up one item in the current dialog area. 1o(es the focus down one item in the current dialog area. 1o(es the focus one item to the left in the current dialog area. 1o(es the focus one item to the right in the current dialog area. ,elects the first field in the current layout area. ,elects the last field in the current layout area. Copies or mo(es the current field into the KHowL area. Copies or mo(es the current field into the KColumnL area. Copies or mo(es the current field into the K5ataL area. 1o(es the current field up one place. 1o(es the current field down one place. 1o(es the current field one place to the left. 1o(es the current field one place to the right. 1o(es the current field to the first place. 1o(e the current field to the last place. 5isplays the options for the current field. Hemo(es the current field from the area.

3A"

LibreOffice ".# $alc Guide

Chart shortcuts
(able 3&: $hart shortcut 4e2s
!"ortcut #e$s
(ab Shift5(ab /ome Dnd Dsc )rrow -eys )rrow -eys in pie charts 22 in titles 23 CtrlR23 R/X R/X in pie charts

Effect
,elects ne3t obGect. ,elects pre(ious obGect. ,elects first obGect. ,elects last obGect. Cancels selection. 1o(es the obGect in the direction of the arrow. 1o(es the selected pie segment in the direction of the arrow. Dnters te3t input mode. ;pens group so you can edit the indi(idual components $in legend and data series&. D3its group $in legend and data series&. Dnlarges or reduces the chart. 1o(es the selected pie segment off or into the pie chart.

,ppendi* , De2board Shortcuts

3A%

,ppendi* B Description of 'unctions

Functions available in Calc


Calc pro(ides all of the commonly used functions found in modern spreadsheet applications. ,ince many of CalcIs functions re?uire (ery specific and carefully calculated input arguments' the descriptions in this appendi3 should not be considered complete references for each function. Hefer to the application /elp or the #ibre;ffice wi-i for details and e3amples of all functions. ;n the wi-i' start with http%//help.libreoffice.org/Calc/2unctionsPbyPCategory ;(er 300 standard functions are a(ailable in Calc. 1ore can be added through e3tensions to Calc $see Chapter 1<&. The following tables list CalcIs functions organiFed into ele(en categories.
2unctions whose names end with QA%% are pro(ided for compatibility with 1icrosoft D3cel functions. They return the same results as the corresponding functions in D3cel $without the suffi3&' which though they may be correct' are not based on international standards. Calc automatically changes the function to P)55 for rele(ant functions in imported D3cel spreadsheets.

?ote

,erminology: numbers and arguments


,ome of the descriptions in this appendi3 define limitations on the number of (alues or arguments that can be passed to the function. ,pecifically' functions that refer to the following arguments may lead to confusion%

?umberQ1$ numberQ"$ ... numberQ'1 umber 1 to 30 a list of up to 30 numbers


There is a significant difference between a list of numbers $or integers& and the number of arguments a function will accept. 2or' e3ample the SU: function will only accept a ma3imum of 30 arguments. This limit does ;T mean that you can only sum 30 numbers' but that you can only pass 30 separate arguments to the function. )rguments are (alues separated by commas' and can include ranges which often refer to multiple (alues. Therefore one argument can refer to se(eral (alues' and a function that limits input to 30 arguments may in fact accept more then 30 separate numerical (alues. This appendi3 attempts to clarify this situation by using the term arguments' rather than any of the other phrases. Cn the #ibre;ffice Calc functions' parameters mar-ed as UoptionalU can be left out only when no parameter follows. 2or e3ample' in a function with four parameters' where the last two parameters are mar-ed as UoptionalU' you can lea(e out parameter < or parameters 3 and <' but you cannot lea(e out parameter 3 alone.
Cn the tables of functions in this )ppendi3' se(eral bugs are listedN if you wish to checon the progress of fi3ing those bugs' you can (isit http%//bugs.libreoffice.org/ and enter the bug number.

?ote

3A-

LibreOffice ".# $alc Guide

4athematical functions
(able 3A: :athematical functions !$ntax
)4,$ umber& )C;,$ umber& )C;,/$ umber& )C;T$ umber& )C;T/$ umber& ),C $ umber& ),C /$ umber& )T) $ umber& )T) 2$numberP3' numberPy&

*escription
Heturns the absolute (alue of the gi(en ?umber. Heturns the in(erse cosine of the gi(en ?umber in radians. Heturns the in(erse hyperbolic cosine of the gi(en ?umber in radians. Heturns the in(erse cotangent of the gi(en ?umber in radians. Heturns the in(erse hyperbolic cotangent of the gi(en ?umber in radians. Heturns the in(erse sine of the gi(en ?umber in radians. Heturns the in(erse hyperbolic sine of the gi(en ?umber in radians. Heturns the in(erse tangent of the gi(en ?umber in radians. Heturns the in(erse tangent of the specified 3 and y coordinates in radians. numberQ. is the (alue for the 3 coordinate. numberQy is the (alue for the y coordinate. Heturns the in(erse hyperbolic tangent of the gi(en ?umber. $)ngle is returned in radians.& This is the bitwise K) 5L of two positi(e integers whose (alues are less than 2o<*. 4oth parameters are re?uired. 4ug E1*10' concerning parameter names in 4CT) 5' 4CT;H' and 4CTQ;H.

)T) /$ umber& 4CT) 5$ umber' umber&

4CT#,/C2T$ umber' ,hift&

The bitwise left shift of an integer (alue. 4oth parameters are re?uired. ?umber is an integer less than 2o<*. +hift is the number of bits to mo(e by. This is the bitwise K;HL of two positi(e integers whose (alues are less than 2o<*. 4oth parameters are re?uired. The bitwise right shift of an integer (alue. 4oth parameters are re?uired. ?umber is an integer less than 2o<*. +hift is the number of bits to mo(e by. This is the bitwise Ke3clusi(e ;HL of two positi(e integers whose (alues are less than 2o<*. 4oth parameters are re?uired. Hounds up the gi(en ?umber to the nearest multiple of the (alue of +ignificance. 4ode is an optional (alue. Cf the mode (alue is gi(en and not e?ual to Fero' and if number and significance are negati(e' then rounding is done based on the absolute (alue of number. ;mit this (alue for D3cel compatibility. Heturns the number of combinations for elements without repetition. countQ1 is the total number of elements. countQ" is the number to be combined from the elements. This is the same as the nCr function on a calculator.

4CT;H$ umber' umber& 4CTH,/C2T$ umber' ,hift&

4CTQ;H$number' number& CDC#C G$ umber' ,ignificance' 1ode&

C;14C $countP1' countP2&

,ppendi* B Description of 'unctions

3A.

!$ntax
C;14C )$countP1' countP2&

*escription
Heturns the number of combinations for a gi(en number of obGects $repetition included&. countQ1 is the total number of elements. countQ" is the number to choose from the elements. Con(erts a (alue from one unit of measurement to another. value is the ?uantity to be con(erted. The first te.t is the official abbre(iation for the measurement in ?uestion $for e3ample' UmiU for miles&. The second te.t parameter gi(es the unit to which it is to be con(erted. 4oth te3t arguments must be within ?uotes and are case sensiti(e. The con(ersion is done according to a table in the configuration $main.3cd&. 4ug @:A3:% This function does not wor-. Heturns the cosine of the ?umber $the angle in radians&. Heturns the hyperbolic cosine of the ?umber $the angle in radians&. Heturns the cotangent of the ?umber $the angle in radians&. Heturns the hyperbolic cotangent of the ?umber $the angle in radians&. Heturns the number of empty cells. range is the cell range in which the empty cells are counted. Heturns the number of cells that meet the criteria within a cell range. range is the range to which the criteria are to be applied. criteria indicates the criteria in the form of a number' a regular e3pression' or a character string by which the cells are counted. Heturns the number of cells that meet multiple criteria in multiple cell ranges. range 1 $re?uired&' range "$ J$ are the ranges to which the criteria are to be applied. criteria 1 $re?uired&' criteria "$ J$ indicate the criteria in the form of a number' a regular e3pression' or a character string by which the cells are e(aluated. )ll ranges must ha(e the same dimension and siFe. Heturns the cosecant of an angle gi(en in radians $1/,C $Q&&. Heturns the hyperbolic cosecant of a hyperbolic angle $1/,C /$Q&&. Con(erts the gi(en ?umber in radians to degrees. Con(erts from one pre+Duro currency to another. value is the (alue to be con(erted. The fromQcurrency is the C,; <21E code of the currency from which value is to be con(erted. The toQcurrency is the C,; <21E code of the currency to which value is to be con(erted. The entries are not case sensiti(e. The abo(e parameters are re?uired. The optional fullQprecision parameter' if omitted' is 0 or 2)#,D rounds the result to the decimals of the toQcurrency. Cf fullPprecision is TH!D' the result is not rounded. triangulationQprecision is optional. Cf triangulationQprecision is gi(en and eY3' the intermediate result of a triangular con(ersion $currency1' D!H;' currency2& is rounded to that precision. Cf triangulationQprecision is omitted' the intermediate result is not rounded. )lso if toQcurrency is UD!HU' triangulationQprecision is used as if triangulation was needed
LibreOffice ".# $alc Guide

C; BDHT$(alue' te3t' te3t&

C;,$ umber& C;,/$ umber& C;T$ umber& C;T/$ umber& C;! T4#) 6$range& C;! TC2$range' criteria&

C;! TC2,$range 1' criteria 1' range 2' criteria 2' p'&

C,C$)ngle& C,C/$)ngle& 5DGHDD,$ umber& D!H;C; BDHT$(alue' fromPcurrency' toPcurrency' fullPprecision' triangulationPprecision&

3-8

!$ntax

*escription
and con(ersion from Duro to Duro was applied. Con(ersion rates and currency codes can be found here% http%//ec.europa.eu/economyPfinance/euro/adoption/con(ersion/ inde3Pen.htm The Cyprus pound has been omitted from this list but is KCY"L. 4ug E1*A0% These are ;T case sensiti(e as stated in the 2unction 0iFard.

DBD $ umber& DQ"$ umber& 2)CT$ umber& 2#;;H$ umber' ,ignificance' 1ode&

Hounds the gi(en ?umber up to the nearest e(en integer' and a negati(e number down to the ne3t e(en number. Heturns e raised to the power of the gi(en ?umber. Heturns the factorial of the gi(en ?umber. Hounds the gi(en ?umber down to the nearest multiple of +ignificance. +ignificance is the (alue to whose multiple the number is to be rounded down. 4ode is an optional (alue. Cf it is indicated and non+Fero and if the number and significance are negati(e' rounding is done based on the absolute (alue of the number. ote% 1any application user interfaces ha(e a 2#;;H function with only two parameters' and somewhat different semantics than gi(en here $e.g.' they operate as if there was a non+Fero mode (alue&. These 2#;;H functions are inconsistent with the standard mathematical definition of 2#;;H. Heturns the greatest common di(isor of one or more positi(e integers. ntegers . is a list of up to 30 integers' at least one of which must be greater than Fero' whose greatest common di(isor is to be calculated. This gi(es a result based on international standards. Heturns the greatest common di(isor of a list of numbers. ?umberKsL O is a list of up to 30 numbers' additional to ?umberKsL separated by commas. This gi(es the same results as 1, D3cel. Hounds the gi(en ?umber down to the nearest integer. Heturns the least common multiple of one or more integers. nteger 1$ nteger "$ J$ nteger '1 are integers whose lowest common multiple is to be calculated. ?umberKsL O is a list of up to 30 numbers' additional to ?umberKsL' separated by commas. The result is the lowest common multiple of a list of numbers. Heturns the natural logarithm' based on the constant e= of the gi(en ?umber. Heturns the logarithm of the gi(en ?umber $(alue e0& to the specified base. 7ase is the base for the logarithm calculation. Cf omitted' 10 is assumed. Heturns the base+10 logarithm of a ?umber e0. Heturns the remainder after a number is di(ided by a di(isor. %ividend is the number to be di(ided. %ivisor is the number by which the di(idend is di(ided.

GC5$Cnteger 1' Cnteger 2' p' Cnteger 30&&

GC5P)55$ umber$s&' umber$s&1' p' umber$s&30&

C T$ umber& #C1$Cnteger 1' Cnteger 2' p' Cnteger 30& #C1P)55$ umber$s&' umber$s&1' p' umber$s&30& # $ umber& #;G$ umber' 4ase&

#;G10$ umber& 1;5$5i(idend' 5i(isor&

,ppendi* B Description of 'unctions

3-#

!$ntax
1H;! 5$ umber' 1ultiple& 1!#TC ;1C)# $ umber$s&' umber$s&1' p' umber$s&30&

*escription
Heturns ?umber rounded to the nearest multiple of 4ultiple. Heturns the factorial of the sum of the arguments di(ided by the product of the factorials of the arguments. ?umberKsL O is a list of up to 30 numbers' additional to ?umberKsL' separated by commas. Hounds ?umber up if positi(e and down if negati(e' to the nearest odd integer. Heturns the (alue of "C to fourteen decimal places. Heturns the result of a number raised to a power. 7ase is the number that is to be raised to the gi(en power. #.ponent is the e3ponent by which the base is to be raised. 1ultiplies all the numbers gi(en as arguments and returns the product. ?umber 1 to ?umber '1 are up to 38 arguments whose product is to be calculated' separated by commas. Heturns the integer result of a di(ision operation. ?umerator is the number that will be di(ided. %enominator is the number the numerator will be di(ided by. Con(erts the gi(en ?umber in degrees to radians. Heturns a random number between 0 and 1. This number will recalculate e(ery time data is entered' $trl5Shift5'. or '. is pressed. Heturns an integer random number between 7ottom and ,op $inclusi(e&. This number will recalculate when the $trl5Shift5'. -ey combination is pressed $not 2: alone&. Hounds the gi(en number to count $optional& decimal places. Cf the count parameter is omitted or Fero' number rounds to the nearest integer. Cf count is negati(e' the function rounds to the nearest 10' 100' 1000 and so on. Hounds the gi(en number down' to count $optional& decimal places. Cf the count parameter is omitted or Fero' number rounds down to the nearest integer. Cf count is negati(e' the function rounds down to the nearest 10' 100' 1000 and so on. umber rounds toward Fero. Hounds the gi(en number up to count $optional& decimal places. Cf the count parameter is omitted or Fero' number rounds up to the nearest integer. Cf count is negati(e' the function rounds up to the nearest 10' 100' 1000 and so on. umber rounds away from Fero. Heturns the secant of an Angle gi(en in radians. ,DC$3&Y1/C;,$3&. Heturns the hyperbolic secant of an Angle gi(en in radians. ,DC/$3&Y1/C;,/$3&.

;55$ umber& "C$& ";0DH$4ase' D3ponent&

"H;5!CT$ umber 1' umber 2' p' umber 30& J!;TCD T$ umerator' 5enominator& H)5C) ,$ umber& H) 5$&

H) 54DT0DD $4ottom' Top&

H;! 5$number' count&

H;! 55;0 $number' count&

H;! 5!"$number' count&

,DC$)ngle& ,DC/$)ngle&

3-9

LibreOffice ".# $alc Guide

!$ntax
,DHCD,,!1$Q' ' 1' Coefficients&

*escription
Heturns the sum of a powers series. ,DHCD,,!1$Q' ' 1' Coefficients& Y coefficientP1Z3in R coefficientP2Z3i$nRm& R coefficientP3Z3i$nR2m& R...R coefficientPiZ3i$nR$i+1&m&. O is the number as an independent (ariable. ? is the starting power. 4 is the increment. Coefficients is a series of coefficients. 2or each coefficient the series sum is e3tended by one section. You can only enter coefficients using a cell range.

,CG $ umber& ,C $number& ,C /$number& ,JHT$number& ,JHT"C$ umber& ,!4T;T)#$2unction' range&

Heturns the sign of the gi(en ?umber. The function returns the result 1 for a positi(e sign' X1 for a negati(e sign' and 0 for Fero. Heturns the sine of the gi(en number $angle in radians&. Heturns the hyperbolic sine of the gi(en number $angle in radians&. Heturns the positi(e s?uare root of the gi(en number. The (alue of the number must be positi(e. Heturns the s?uare root of the product of the gi(en ?umber and "C. Calculates subtotals. Cf a range already contains subtotals' these are not used for further calculations. Function is a (alue that stands for another function such as )(erage' Count' 1in' ,um' Bar. range is the range whose cells are included. )dds all the numbers in a range of cells. ?umber 1$ number "$ J$ number '1 are up to 30 arguments whose sum is to be calculated. You can also enter a range using cell references. )dds the cells specified by the gi(en criteria. The search supports regular e3pressions. range is the range to which the criteria are to be applied. criteria is the cell in which the search criterion is shown' or the search criterion itself. sumQrange $optional& is the range from which (alues are summedN if it has not been entered' the (alues found in the range are summed. Cf supplied' sumQrange must be the same siFe and shape as range. Totals the (alues of cells in a range that meet multiple criteria in multiple ranges. sumQrange $re?uired& is the cell range from which the (alues are to be totaled. range 1 $re?uired& is the cell range to be e(aluated by criteria 1 $re?uired&' range " by criteria " and so on. )ll ranges must ha(e the same siFe and shape. Calculates the sum of the s?uares of numbers $totaling up of the s?uares of the arguments& number 1$ number "$ J$ number '1 are up to 30 arguments' the sum of whose s?uares is to be calculated. Heturns the tangent of the gi(en number $angle in radians&. Heturns the hyperbolic tangent of the gi(en number $angle in radians&.

,!1$number 1' number 2' p' number 30& ,!1C2$range' criteria' sumPrange&

,!1C2,$sumPrange' range 1' criteria 1' range 2' criteria 2' p'&

,!1,J$number 1' number 2' p' number 30&

T) $number& T) /$number&

,ppendi* B Description of 'unctions

3-3

!$ntax
TH! C$number' count&

*escription
Truncates a number by remo(ing decimal places. number is the number whose decimal places are to be trimmed. count $optional& is the number of decimal places which are retained. Cf count is missing or Fero' it effecti(ely truncates to a decimal integer. Cf count is negati(e' it truncates to the left of the decimal point.

Financial analysis functions


A note about dates
5ate (alues used as parameters for CalcIs financial functions must comply with C,;*@01 and be entered surrounded by double ?uotes. 2or e3ample' a date representing )ugust @' 200<' must be entered K200<+0*+0@L' single digits are padded with leading Feroes. Cf you do not enter the date (alues as re?uired by the function' you will not get the correct results. 5ate formats are locale specific and will allow other formats to be used. )mong others' the enP!, locale allows K200</0*/0@L and K0*/0@/200<L for e3ample. Chec- the /elp for the acceptable formatting.

A note about interest rates


You can enter interest rates in either of two ways%

)s a decimal. To enter an interest rate as a decimal' di(ide it by 100 before entering it into a
function. 2or e3ample' to compute a loan with a 3.2Ad interest rate' enter .839% into the function.

)s a percentage. To enter an interest rate as a percentage' type in the interest rate


followed by the Z -ey. 2or e3ample' to compute a loan with a 3.2Ad interest rate' enter 3.9%Z into the function. Cf you enter it as 3.9%' the function will treat it as a 32Ad interest rate. )ccounting systems (ary in the number of days in a month or a year used in calculations. The following table gi(es the integers used for the basis parameter used in some of the financial analysis functions. (able 3-: Basis calculation t2pes :asis
0 or missing 1 2 3 <

Calculation
!, method $ ),5&' 12 months of 30 days each. D3act number of days in months' e3act number of days in year. D3act number of days in month' year has 3@0 days. D3act number of days in month' year has 3@A days. Duropean method' 12 months of 30 days each.

3-"

LibreOffice ".# $alc Guide

(able 3.: 'inancial anal2sis functions !$ntax


)CCHC T$Cssue' 2irst interest' ,ettlement' Hate' "ar' 2re?uency' 4asis&

*escription
Calculates the accrued interest of a security in the case of periodic payments. ssue is the issue date of the security. First interest is the first interest date of the security. +ettlement is the maturity date. 3ate is the annual nominal rate of interest $coupon interest rate&. Par is the par (alue of the security. Fre@uency is the number of interest payments per year $1' 2 or <&. 7asis indicates how the year is to be calculated. Calculates the accrued interest of a security in the case of one+off payment at the settlement date. ssue is the issue date of the security. +ettlement is the maturity date. 3ate is the annual nominal rate of interest $coupon interest rate&. Par is the par (alue of the security. 7asis indicates how the year is to be calculated. Calculates the amount of depreciation for a settlement period as degressi(e amortiFation. !nli-e )1;H#C C' a depreciation coefficient that is independent of the depreciable life is used here. Cost is the ac?uisition cost. %ate purchased is the date of ac?uisition. First period is the end date of the first settlement period. +alvage is the sal(age (alue of the capital asset at the end of the depreciable life. Period is the settlement period to be considered. 3ate is the rate of depreciation. 7asis indicates how the year is to be calculated. Calculates the amount of depreciation for a settlement period as linear amortiFation. Cf the capital asset is purchased during the settlement period' the proportional amount of depreciation is considered. Cost is the ac?uisition cost. %ate purchased is the date of ac?uisition. First period is the end date of the first settlement period. +alvage is the sal(age (alue of the capital asset at the end of the depreciable life. Period is the settlement period to be considered. 3ate is the rate of depreciation. 7asis indicates how the year is to be calculated. Heturns the number of days from the first day of interest payment on a security until the settlement date. +ettlement is the date of purchase of the security. 4aturity is the date on which the security matures $e3pires&. Fre@uency is the number of interest payments per year $1' 2 or <&. 7asis indicates how the year is to be calculated. Heturns the number of days in the current interest period in which the settlement date falls. +ettlement is the date of purchase of the security. 4aturity is the date on which the security matures $e3pires&. Fre@uency is the number of interest payments per year $1' 2 or <&. 7asis indicates how the year is to be calculated.

)CCHC T1$Cssue' ,ettlement' Hate' "ar' 4asis&

)1;H5DGHC$Cost' 5ate purchased' 2irst period' ,al(age' "eriod' Hate' 4asis&

)1;H#C C$Cost' 5ate purchased' 2irst period' ,al(age' "eriod' Hate' 4asis&

C;!"5)Y4,$,ettlement' 1aturity' 2re?uency' 4asis&

C;!"5)Y,$,ettlement' 1aturity' 2re?uency' 4asis&

,ppendi* B Description of 'unctions

3-%

!$ntax
C;!"5)Y, C$,ettlement' 1aturity' 2re?uency' 4asis&

*escription
Heturns the number of days from the settlement date until the ne3t interest date. +ettlement is the date of purchase of the security. 4aturity is the date on which the security matures $e3pires&. Fre@uency is the number of interest payments per year $1' 2 or <&. 7asis indicates how the year is to be calculated. Heturns the date of the first interest date after the settlement date' and formats the result as a date. +ettlement is the date of purchase of the security. 4aturity is the date on which the security matures $e3pires&. Fre@uency is the number of interest payments per year $1' 2 or <&. 7asis indicates how the year is to be calculated. Heturns the number of coupons $interest payments& between the settlement date and the maturity date. +ettlement is the date of purchase of the security. 4aturity is the date on which the security matures $e3pires&. Fre@uency is the number of interest payments per year $1' 2 or <&. 7asis indicates how the year is to be calculated. Heturns the date of the interest date prior to the settlement date' and formats the result as a date. +ettlement is the date of purchase of the security. 4aturity is the date on which the security matures $e3pires&. Fre@uency is the number of interest payments per year $1' 2 or <&. 7asis indicates how the year is to be calculated. Calculates the cumulati(e interest payments $the total interest& for an in(estment based on a constant interest rate. 3ate is the periodic interest rate. ?P#3 is the payment period with the total number of periods. "DH can also be a non+integer (alue. The Hate and ?P#3 must refer to the same unit' and thus both must be calculated annually or monthly. pv is the current (alue in the se?uence of payments. + is the first period. # is the last period. ,ype is the due date of the payment at the beginning $1& or end $0& of each period. Calculates the accumulated interest for a period. 3ate is the interest rate for each period. ?per is the total number of payment periods. The 3ate and ?per must refer to the same unit' and thus both must be calculated annually or monthly. Pv is the current (alue. +tart period the first payment period for the calculation. #nd period the last payment period for the calculation. ,ype is the due date of the payment at the beginning $1& or end $0& of each period. Heturns the cumulati(e interest paid for an in(estment period with a constant interest rate. 3ate is the periodic interest rate. ?P#3 is the payment period with the total number of periods. ?P#3 can also be a non+integer (alue. The 3ate and ?P#3 must refer to the same unit' and thus both must be calculated annually or monthly. P> is the current (alue in the se?uence of payments. + is the first period. # is the last period. ,ype is the due date of the payment at the beginning $1& or end $0& of each period.

C;!" C5$,ettlement' 1aturity' 2re?uency' 4asis&

C;!" !1$,ettlement' 1aturity' 2re?uency' 4asis&

C;!""C5$,ettlement' 1aturity' 2re?uency' 4asis&

C!1C"1T$Hate' "DH' p(' ,' D' Type&

C!1C"1TP)55$Hate' per' "(' ,tart period' Dnd period' Type&

C!1"HC C$Hate' "DH' "B' ,' D' Type&

3-&

LibreOffice ".# $alc Guide

!$ntax
C!1"HC CP)55$Hate' per' "(' ,tart period' Dnd period' Type&

*escription
Calculates the cumulati(e redemption of a loan in a period. 3ate is the interest rate for each period. ?per is the total number of payment periods. The 3ate and ?per must refer to the same unit' and thus both must be calculated annually or monthly. Pv is the current (alue. +tart period is the first payment period for the calculation. #nd period is the last payment period for the calculation. ,ype is the due date of the payment at the beginning $1& or end $0& of each period. Heturns the depreciation of an asset for a specified period using the fi3ed+declining balance method. Cost is the initial cost of an asset. +alvage is the (alue of an asset at the end of the depreciation. 2ife defines the period o(er which an asset is depreciated. Period is the length of each period. The life must be entered in the same date unit as the depreciation period. month $optional& denotes the number of months for the first year of depreciation. Heturns the depreciation of an asset for a specified period using the arithmetic+declining method. ote that the boo(alue will ne(er reach Fero under this calculation type. Cost fi3es the initial cost of an asset. +alvage fi3es the (alue of an asset at the end of its life. 2ife is the number of periods defining how long the asset is to be used. Period defines the length of the period. The period must be entered in the same time unit as the life. Factor $optional& is the factor by which depreciation decreases. Cf no (alue is entered' a (alue of 2 is assumed' ma-ing this double declining. Calculates the allowance $discount& of a security as a percentage. +ettlement is the date of purchase of the security. 4aturity is the date on which the security matures $e3pires&. Price is the price of the security per 100 currency units of par (alue. 3edemption is the redemption (alue of the security per 100 currency units of par (alue. 7asis indicates how the year is to be calculated. Con(erts a ?uotation that has been gi(en as a decimal fraction into a decimal number. Fractional dollar is a number gi(en as a decimal fraction. $Cn this number' the decimal (alue is the numerator of the fraction.& Fraction is a whole number that is used as the denominator of the decimal fraction. Con(erts a ?uotation that has been gi(en as a decimal number into a mi3ed decimal fraction. The decimal of the result is the numerator of the fraction that would ha(e Fraction as the denominator. %ecimal dollar is a decimal number. Fraction is a whole number that is used as the denominator of the decimal fraction. Calculates the number of periods re?uired by an in(estment to attain the desired (alue. 3A,# $a constant& is the interest rate to be calculated for the entire duration. Dntering the interest rate di(ided by the periods per year' can calculate the interest after each period. pv is the present (alue. F> is the desired future (alue of the in(estment.

54$Cost' ,al(age' #ife' "eriod' month&

554$Cost' ,al(age' #ife' "eriod' 2actor&

5C,C$,ettlement' 1aturity' "rice' Hedemption' 4asis&

5;##)H5D$2ractional dollar' 2raction&

5;##)H2H$5ecimal dollar' 2raction&

5!H)TC; $H)TD' p(' 2B&

,ppendi* B Description of 'unctions

3-A

!$ntax
5!H)TC; P)55 $,ettlement' 1aturity' Coupon' Yield' 2re?uency' 4asis&

*escription
Calculates the duration of a fi3ed interest security in years. +ettlement is the date of purchase of the security. 4aturity is the date on which the security matures $e3pires&. Coupon is the annual coupon interest rate $nominal rate of interest&. Iield is the annual yield of the security. Fre@uency is the number of interest payments per year $1' 2 or <&. 7asis indicates how the year is to be calculated. Calculates the effecti(e annual rate of interest on the basis of the nominal interest rate and the number of interest payments per annum. ominal interest refers to the amount of interest due at the end of a calculation period. ?ominal rate is the annual nominal rate of interest. ?pery is the number of interest payments per year. Calculates the effecti(e annual rate of interest on the basis of the nominal interest rate and the number of interest payments per annum. ominal interest refers to the amount of interest due at the end of a calculation period. ?=4 is the nominal interest. P is the number of interest payment periods per year. Heturns the future (alue of an in(estment based on periodic' constant payments and a constant interest rate. 3ate is the periodic interest rate. ?P#3 is the total number of periods. P4, is the annuity paid regularly per period. P> $optional& is the present cash (alue of an in(estment. ,ype $optional& defines whether the payment is due at the beginning $1& or the end $0& of a period. Calculates the accumulated (alue of the starting capital for a series of periodically (arying interest rates. Principal is the starting capital. +chedule is a series of interest rates. +chedule has to be entered with cell references' or with a list. Calculates the annual interest rate that results when a security $or other item& is purchased at an in(estment (alue and sold at a redemption (alue with no interest being paid. +ettlement is the date of purchase of the security. 4aturity is the date on which the security is sold. nvestment is the purchase price. 3edemption is the selling price. 7asis indicates how the year is to be calculated. Calculates the periodic amortiFation for an in(estment with regular payments and a constant interest rate. 3ate is the periodic interest rate. Period is the period for which the compound interest is calculated. ?P#3 is the total number of periods during which annuity is paid. PeriodY?P#3' if compound interest for the last period is calculated. pv is the present cash (alue in se?uence of payments. F> $optional& is the desired (alue $future (alue& at the end of the periods. ,ype $optional& defines whether the payment is due at the beginning $1& or the end $0& of a period.

D22DCTP)55$ ominal rate' pery&

D22DCTCBD$ ;1' "&

2B$Hate' "DH' "1T' "B' Type&

2B,C/D5!#D$"rincipal' ,chedule&

C TH)TD$,ettlement' 1aturity' Cn(estment' Hedemption' 4asis&

C"1T$Hate' "eriod' "DH' p(' 2B' Type&

3--

LibreOffice ".# $alc Guide

!$ntax
CHH$Balues' Guess&

*escription
Calculates the internal rate of return for an in(estment. The (alues represent cash flow (alues at regular inter(alsN at least one (alue must be negati(e $payments&' and at least one (alue must be positi(e $income&. >alues is an array or cell range containing the (alues. (uess $optional& is the estimated (alue. Cf you can pro(ide only a few (alues' you should pro(ide an initial guess to enable the iteration. Calculates the le(el of interest for unchanged amortiFation installments. rate sets the periodic interest rate. Period is the number of installments for calculation of interest. totalQperiods is the total number of installment periods. invest is the amount of the in(estment. Calculates the modified 1acauley duration for a security with an assumed par (alue of 100 currency units. +ettlement is the date of purchase of the security. 4aturity is the date on which the security matures $e3pires&. Coupon is the annual nominal rate of interest $coupon interest rate& Iield is the annual yield of the security. Fre@uency is the number of interest payments per year $1' 2 or <&. 7asis indicates how the year is to be calculated. Calculates the modified internal rate of return of a series of in(estments. >alues corresponds to the array or the cell reference for cells whose content corresponds to the payments. investment is the rate of interest of the in(estments $the negati(e (alues of the array& reinvestQrate is the rate of interest of the rein(estment $the positi(e (alues of the array&. Calculates the yearly nominal interest rate' gi(en the effecti(e rate and the number of compounding periods per year. effectQrate is the effecti(e interest rate. npery is the number of periodic interest payments per year. Heturns a percentage. Calculates the yearly nominal rate of interest' gi(en the effecti(e rate and the number of compounding periods per year. #ffectiveQrate is the effecti(e annual rate of interest. ?pery is the number of interest payments per year. Heturns a number. Heturns the number of periods for an in(estment based on periodic' constant payments and a constant interest rate. 3ate is the periodic interest rate. P4, is the constant annuity paid in each period. P> is the present (alue $cash (alue& in a se?uence of payments. F> $optional& is the future (alue' which is reached at the end of the last period. Cf 2B is omitted it is assumed to be Fero. ,ype $optional& defines whether the payment is due at the beginning $1& or the end $0& of a period. Heturns the net present (alue of an in(estment based on a series of periodic cash flows and a discount rate. 3ate is the discount rate for a period. value 1$ value "$ ...$ value '1 are (alues representing deposits or withdrawals.

C,"1T$rate' "eriod' totalPperiods' in(est&

15!H)TC; $,ettlement' 1aturity' Coupon' Yield' 2re?uency' 4asis&

1CHH$Balues' in(estment' rein(estPrate&

;1C )#$effectPrate' npery&

;1C )#P)55$Dffecti(ePrate' pery&

"DH$Hate' "1T' "B' 2B' Type&

"B$Hate' (alue 1' (alue 2' p' (alue 30&

,ppendi* B Description of 'unctions

3-.

!$ntax
;552"HCCD$,ettlement' 1aturity' Cssue' 2irst coupon' Hate' Yield' Hedemption' 2re?uency' 4asis&

*escription
Calculates the price per 100 currency units par (alue of a security' ha(ing an odd $short or long& first period. +ettlement is the date of purchase of the security. 4aturity is the date on which the security matures $e3pires&. ssue is the date of issue of the security. First coupon is the first interest date of the security. 3ate is the annual rate of interest. Iield is the annual yield of the security. 3edemption is the redemption (alue per 100 currency units of par (alue. Fre@uency is the number of interest payments per year $1' 2 or <&. 7asis indicates how the year is to be calculated. Calculates the yield of a security that has an odd $short or long& first period. +ettlement is the date of purchase of the security. 4aturity is the date on which the security matures $e3pires&. ssue is the date of issue of the security. First coupon is the first interest date of the security. 3ate is the annual rate of interest. Price is the price of the security. 3edemption is the redemption (alue per 100 currency units of par (alue. Fre@uency is the number of interest payments per year $1' 2 or <&. 7asis is chosen from a list of options and indicates how the year is to be calculated. Calculates the price per 100 currency units par (alue of a security' that has an odd $short or long& last period. +ettlement is the date of purchase of the security. 4aturity is the date on which the security matures $e3pires&. 2ast interest is the last interest date of the security. 3ate is the annual rate of interest. Iield is the annual yield of the security. 3edemption is the redemption (alue per 100 currency units of par (alue. Fre@uency is the number of interest payments per year $1' 2 or <&. 7asis indicates how the year is to be calculated. Calculates the yield of a security that has an odd $short or long& last period. +ettlement is the date of purchase of the security. 4aturity is the date on which the security matures $e3pires&. 2ast interest is the last interest date of the security. 3ate is the annual rate of interest. Price is the price of the security. 3edemption is the redemption (alue per 100 currency units of par (alue. Fre@uency is the number of interest payments per year $1' 2 or <&. 7asis indicates how the year is to be calculated. ) function following the 4lac- ,choles formula. Ct calculates the pricing of a barrier option. spot $re?uired& is the price/(alue of the asset. vol $re?uired& is the annual (olatility of the asset. rebate $re?uired& is the amount of money paid at maturity if the barrier was hit. putHcall $re?uired& is a string to define if the option is a $p&ut/ or a $c&all. knock $re?uired& $i&n/$o&ut is a string to define if the option is of type -noc-+$i&n or -noc-+$o&ut. barrierQtype $re?uired& is a string to define whether the barrier is obser(ed $c&ontinuosly or only at the $e&nd/maturity. greek is an optional parameter' which if left out causes the function to return the option price. Cf included' the function returns price sensiti(ities $Gree-s& to one of the input parameters' such as K(egaL for sensiti(ity to (olatility.
LibreOffice ".# $alc Guide

;552YCD#5$,ettlement' 1aturity' Cssue' 2irst coupon' Hate' "rice' Hedemption' 2re?uency' 4asis&

;55#"HCCD$,ettlement' 1aturity' #ast interest' Hate' Yield' Hedemption' 2re?uency' 4asis&

;55#YCD#5$,ettlement' 1aturity' #ast interest' Hate' "rice' Hedemption' 2re?uency' 4asis&

;"TP4)HHCDH$spot' (ol' r' rf' T' stri-e' barrierPlow' barrierPup' rebate' put/call' -noc- in/out' barrierPtype' gree-&

3.8

!$ntax
;"TP"H;4P/CT$spot' (ol' drift' T' barrierPlow' barrierPup&

*escription
Heturns the probability that an asset hits a barrier assuming it follows

dS = dt + vol dW S

spot is the price/(alue + of the underlying asset. vol is the annual (olatility of the underlying asset. drift is the Z (alue of the formula. , is the time to maturity. barrierQlow is the lower barrier and set to Fero if there is no lower barrier. barrierQup is the upper barrier and is set to Fero if there is no upper barrier. )ll parameters are re?uired. ;"TP"H;4PC 1; DY$spot' (ol' drift' T' barrierPlow' barrierPup' put/call' stri-e& Heturns the probability that an asset will at maturity end up between two barrier le(els' assuming it follows

dS = dt + vol dW . $Cf the last two optional parameters' S


put/call and stri-e' are specified' the probability of ,PT in Vstri-e' upper barrierW for a call' and ,PT in Vlower barrier' stri-eW for a put will be returned&. ,PT is the spot at maturity and ignores the possibility of -noc-+out before maturity. spot $re?uired& is the price/(alue of the asset. vol $re?uired& is the annual (olatility of the asset. drift $re?uired& is the parameter q from the formula abo(e. , is the time to maturity in years. barrierQlow $re?uired& is the lower barrier and set to Fero if there is no lower barrier. barrierQup $re?uired& is the upper barrier and is set to Fero if there is no upper barrier. putHcall $optional& is the $p&ut/$c&all indicator. strike $optional& is the stri-e le(el.

;"TPT;!C/$spot' (ol' r' rf' T' barrierPlow' barrierPup' foreign/domestic' -noc- in/out' barrierPtype' gree-&

Heturns the pricing of a touch/no+touch option. spot $re?uired& is the price/(alue of the asset. vol $re?uired& is the annual (olatility of the asset. r $re?uired& is the interest rate continuously compounded. rf $re?uired& is the foreign interest rate continuously compounded. , $re?uired& is the time to maturity entered in years. strike $re?uired& is the stri-e le(el of the option. barrierQlow $re?uired& is the lower barrier and set to Fero if there is no lower barrier. barrierQup $re?uired& is the upper barrier and is set to Fero if there is no upper barrier. foreignHdomestic $re?uired& is a string to define if the option pays one unit of $d&omestic currency $cash or nothing& or $f&oreign currency $asset or nothing&. knock $re?uired& $i&n/$o&ut is a string to define if the option is of type -noc-+$i&n $touch& or -noc-+$o&ut $no touch&. barrierQtype $re?uired& is a string to define whether the barrier is obser(ed $c&ontinuously or only at the $e&nd/maturity. greek is an optional parameter' which if left out causes the function to return the option price. Cf included' the function returns price sensiti(ities $Gree-s& to one of the input parameters' such as KthetaL for time sensiti(ity.

,ppendi* B Description of 'unctions

3.#

!$ntax
"1T$Hate' "DH' "B' 2B' Type&

*escription
Heturns the periodic payment for an annuity with constant interest rates. 3ate is the periodic interest rate. ?P#3 is the number of periods in which annuity is paid. P> is the present (alue $cash (alue& in a se?uence of payments. F> $optional& is the desired (alue $future (alue& to be reached at the end of the periodic payments. ,ype $optional& defines whether the payment is due at the beginning $1& or the end $0& of a period. Heturns for a gi(en period the payment on the principal for an in(estment that is based on periodic and constant payments and a constant interest rate. 3ate is the periodic interest rate. Period is the amortiFation period. ?P#3 is the total number of periods during which annuity is paid. P> is the present (alue in the se?uence of payments. F> $optional& is the desired $future& (alue. ,ype $optional& defines whether the payment is due at the beginning $1& or the end $0& of a period. Calculates the price per 100 currency units of par (alue of an interest+bearing security. +ettlement is the date of purchase of the security. 4aturity is the date on which the security matures $e3pires&. 3ate is the annual nominal rate of interest $coupon interest rate&. Iield is the annual yield of the security. 3edemption is the redemption (alue per 100 currency units of par (alue. Fre@uency is the number of interest payments per year $1' 2 or <&. 7asis indicates how the year is to be calculated. Calculates the price per 100 currency units of par (alue of a discounted security. +ettlement is the date of purchase of the security. 4aturity is the date on which the security matures $e3pires&. %iscount is the discount of a security as a percentage. 3edemption is the redemption (alue per 100 currency units of par (alue. 7asis indicates how the year is to be calculated. Calculates the price per 100 currency units of par (alue of a security' that pays interest on the maturity date. +ettlement is the date of purchase of the security. 4aturity is the date on which the security matures $e3pires&. ssue is the date of issue of the security. 3ate is the interest rate of the security on the issue date. Iield is the annual yield of the security. 7asis indicates how the year is to be calculated. Heturns the present (alue of an in(estment resulting from a series of regular payments. 3ate defines the interest rate per period. ?P#3 is the total number of payment periods. P4, is the regular payment made per period. F> $optional& defines the future (alue remaining after the final installment has been made. ,ype $optional& defines whether the payment is due at the beginning $1& or the end $0& of a period.

""1T$Hate' "eriod' "DH' "B' 2B' Type&

"HCCD$,ettlement' 1aturity' Hate' Yield' Hedemption' 2re?uency' 4asis&

"HCCD5C,C$,ettlement' 1aturity' 5iscount' Hedemption' 4asis&

"HCCD1)T$,ettlement' 1aturity' Cssue' Hate' Yield' 4asis&

"B$Hate' "DH' "1T' 2B' Type&

3.9

LibreOffice ".# $alc Guide

!$ntax
H)TD$ "DH' "1T' "B' 2B' Type' Guess&

*escription
Heturns the constant interest rate per period of an annuity. ?P#3 is the total number of periods' during which payments are made $payment period&. P4, is the constant payment $annuity& paid during each period. P> is the cash (alue in the se?uence of payments. F> $optional& is the future (alue' which is reached at the end of the periodic payments. ,ype $optional& defines whether the payment is due at the beginning $1& or the end $0& of a period. (uess $optional& determines the estimated (alue of the interest with iterati(e calculation. Calculates the amount paid out at maturity for a fully in(ested security. +ettlement is the date of purchase of the security. 4aturity is the date on which the security matures. nvestment is the purchase sum. %iscount is the percentage discount on ac?uisition of the security. 7asis indicates how the year is to be calculated. Calculates the interest rate resulting from the profit $return& of an in(estment. P is the number of periods used for calculating the interest rate. pv is the present (alue $must be e0&. F> is the final (alue of the security. Heturns the straight+line depreciation of an asset for one period. The amount of the depreciation is constant during the depreciation period. Cost is the initial cost of an asset. +alvage is the (alue of an asset at the end of the depreciation. 2ife is the number of periods in the useful life of the asset. Heturns the arithmetically declining (alue of an asset $depreciation& for a specified period. Ct uses the ,um+of+ Years>+5igits method. Cost is the initial cost of an asset. +alvage is the (alue of an asset after depreciation. 2ife is the period fi3ing the time span o(er which an asset is depreciated. Period defines the period for which the depreciation is to be calculated. 1ust use the same units as life. Calculates the bond e?ui(alent yield for a treasury bill. +ettlement is the date of purchase of the security. 4aturity is the date on which the security matures $e3pires&. The settlement and maturity date must be within a year of each other. %iscount is the percentage discount on ac?uisition of the security. Calculated using the 3@0 days in a year basis $basis 2&. Calculates the price per 100 currency units face (alue of a treasury bill. +ettlement is the date of purchase of the security. 4aturity is the date on which the security matures $e3pires&. The settlement and maturity date must be within a year of each other. %iscount is the percentage discount upon ac?uisition of the security.

HDCDCBD5$,ettlement' 1aturity' Cn(estment' 5iscount' 4asis&

HHC$"' p(' 2B&

,# $Cost' ,al(age' #ife&

,Y5$Cost' ,al(age' #ife' "eriod&

T4C##DJ$,ettlement' 1aturity' 5iscount&

T4C##"HCCD$,ettlement' 1aturity' 5iscount&

,ppendi* B Description of 'unctions

3.3

!$ntax
T4C##YCD#5$,ettlement' 1aturity' "rice&

*escription
Calculates the yield of a treasury bill. +ettlement is the date of purchase of the security. 4aturity is the date on which the security matures $e3pires&. The settlement and maturity date must be within a year of each other. Price is the price $purchase price& of the treasury bill per 100 currency units of par (alue. Heturns the depreciation of an asset for a specified or partial period using a (ariable declining balance method. Cost is the initial (alue of an asset. +alvage is the (alue of an asset at the end of the depreciation. 2ife is the depreciation duration of the asset. + is the start period of the depreciation' entered in the same date unit as 2ife. end is the last period of the depreciation' entered in the same date unit as 2ife. Factor $optional& is the depreciation factor. Cf factor is omitted' a factor of two is assumed $the double+declining balance method&. ,ype is an optional parameter. Type Y 1 means a switch to linear depreciation. Cn Type Y 0' no switch is made. Calculates the internal rate of return for a list of payments which ta-e place on different dates. The calculation is based on a 3@A days per year basis' ignoring leap years. Cf the payments ta-e place at regular inter(als' use the CHH function. >alues and %ates are a series of payments and the series of associated date (alues entered as cell references. Balues shall include at least one negati(e (alue and one positi(e (alue. (uess $optional& is a guess for the internal rate of return. Cf omitted' the (alue 10d is assumed. Calculates the capital (alue $net present (alue& for a list of payments which ta-e place on different dates. The calculation is based on a 3@A days per year basis' ignoring leap years. Cf the payments ta-e place at regular inter(als' use the "B function. 3ate is the internal rate of return for the payments. >alues and %ates are a series of payments and the series of associated date (alues entered as cell references. The first (alue+date pair indicates the start of the payments' other dates can be in any order. Balues shall include at least one negati(e (alue and one positi(e (alue. Calculates the yield of a security that pays periodic interest. +ettlement is the date of purchase of the security. 4aturity is the date on which the security matures $e3pires&. 3ate is the annual rate of interest. Price is the price $purchase price& of the security per 100 currency units of par (alue. 3edemption is the redemption (alue per 100 currency units of par (alue. Fre@uency is the number of interest payments per year $1' 2 or <&. 7asis indicates how the year is to be calculated. Calculates the annual yield of a non+interest+bearing security. +ettlement is the date of purchase of the security. 4aturity is the date on which the security matures $e3pires&. Price is the price $purchase price& of the security per 100 currency units of par (alue. 3edemption is the redemption (alue per 100 currency units of par (alue. 7asis indicates how the year is to be calculated.

B54$Cost' ,al(age' #ife' ,' end' 2actor' Type&

QCHH$Balues' d5ates' Guess&

Q "B$Hate' Balues' 5ates&

YCD#5$,ettlement' 1aturity' Hate' "rice' Hedemption' 2re?uency' 4asis&

YCD#55C,C$,ettlement' 1aturity' "rice' Hedemption' 4asis&

3."

LibreOffice ".# $alc Guide

!$ntax
YCD#51)T$,ettlement' 1aturity' Cssue' Hate' "rice' 4asis&

*escription
Calculates the annual yield of a security' the interest of which is paid on the date of maturity. +ettlement is the date of purchase of the security. 4aturity is the date on which the security matures $e3pires&. ssue is the date of issue of the security. 3ate is the interest rate of the security on the issue date. Price is the price $purchase price& of the security per 100 currency units of par (alue. 7asis indicates how the year is to be calculated.

+tatistical analysis functions


Calc includes o(er E0 statistical functions which enable the e(aluation of data from simple arithmetic calculations' such as a(eraging' to ad(anced distribution and probability computations. ,e(eral other statistics+based functions are a(ailable through the )dd+ins which are noted at the end of this appendi3. (able "8: Statistical anal2sis functions !$ntax
)BD5DB$number 1' number 2' p' number 30&

*escription
Heturns the a(erage of the absolute de(iations of data points from their mean. 5isplays the diffusion in a data set. number 1$ number "$ J$ number '1 are (alues or ranges that represent a sample. Dach number can also be replaced by a reference. Heturns the a(erage of the arguments. number 1$ number "$ J$ number '1 are numerical (alues or ranges. Te3t is ignored. Heturns the a(erage of the arguments. The (alue of te3t is ta-en to be 0. value 1$ value "$ J$ value '1 are (alues or ranges. )(erages the arguments that meet the conditions. Cf the optional averageQrange is omitted' range' which is re?uired' is the range of cells that will be a(eraged. criteria is a re?uired (alue which determines which cells in range are a(eraged. Cf the optional averageQrange is used' it a(erages the (alues of cells of a range that is constructed using the top left cell of range and applying the dimensions' shape and siFe' of averageQrange. Cf no cell in range matches the criteria (alue' an Drror is returned. Cf no numbers are in the range to be a(eraged' an Drror is returned. )(erages the (alues of the cells in a range that meet multiple criteria in multiple ranges. averageQrange' range 1 and criteria 1 are re?uired (alues. )(erages the (alues of cells in averageQrange that meet the criteria 1 in range 1 and the criteria " in range "' and so on. )ll ranges must ha(e the same dimension and siFe' else an Drror is returned. ) logical ) 5 is applied between each array result of each selectionN a cell of averageQrange is e(aluated only if the same position in each array is the result of a criteria match. Cf no numbers are in the result set to be a(eraged' an Drror is returned.

)BDH)GD$number 1' number 2' p' number 30& )BDH)GD)$(alue 1' (alue 2' p' (alue 30& )BDH)GDC2$range' criteria' a(eragePrange&

)BDH)GDC2,$a(eragePrange' range 1' criteria 1' range 2' criteria 2' p' range 30' criteria 30&

,ppendi* B Description of 'unctions

3.%

!$ntax
4$trials' ,"' TP1' TP2&

*escription
Heturns the probability of a sample with binomial distribution. trials is the number of independent trials. +P is the probability of success on each trial. ,Q1 defines the lower limit for the number of trials. ,Q" $optional& defines the upper limit for the number of trials. Heturns the (alue of the probability density function or the cumulati(e distribution function for the beta distribution. number is the (alue between +tart and #nd at which to e(aluate the function. alpha is a parameter to the distribution. beta is a parameter to the distribution. +tart $optional& is the lower bound for number. #nd $optional& is the upper bound for number. Cumulative $optional& can be 0 or 2alse to calculate the probability density function. Ct can be any other (alue or True or omitted to calculate the cumulati(e distribution function.

4DT)5C,T$number' alpha' beta' ,tart' Dnd' Cumulati(e&

4DT)C B$numberN alpha' beta' ,tart' Dnd&

Heturns the in(erse of the cumulati(e beta probability density function. number is the (alue between +tart and #nd at which to e(aluate the function. alpha is a parameter to the distribution. beta is a parameter to the distribution. +tart $optional& is the lower bound for number. #nd $optional& is the upper bound for number. Heturns the indi(idual term binomial distribution probability. O is the number of successes in a set of trials. trials is the number of independent trials. +P is the probability of success on each trial. C Y 0 calculates the probability of a single e(ent and C Y 1 calculates the cumulati(e probability. Heturns the probability (alue that a hypothesis will be confirmed from the indicated chi s?uare. The probability determined by C/C5C,T can also be determined by C/CTD,T. ?umber is the chi+s?uare (alue of the random sample used to determine the error probability. degreesQfreedom is the degrees of freedom of the e3periment. This function is defined by the ;52 as #DG)CY.C/C5C,T. !se C/C,J5C,T for possible greater accuracy.

4C ;15C,T$Q' trials' ,"' C&

C/C5C,T$ umber' degreesPfreedom&

C/CC B$number' degreesPfreedom&

Heturns the in(erse of the one+tailed probability of the chi+ s?uared distribution. number is the (alue of the error probability. degreesQfreedom is the degrees of freedom of the e3periment. This function is defined by the ;52 as #DG)CY.C/CC B. !se C/C,JC B for possible greater accuracy.

C/C,J5C,T$ umber' 5egrees of 2reedom' Cumulati(e&

Heturns the (alue of the probability density function or the cumulati(e distribution function for the chi+s?uare distribution. ?umber is the (alue at which you want to e(aluate the distribution. %egrees of Freedom is the number of degrees of freedom. Cumulative $optional& is a logical (alue that determines the form of the function. Cf cumulati(e is TH!D' C/C,J5C,T returns the cumulati(e distribution functionN if 2)#,D' it returns the probability density function. Cf omitted' it is assumed TH!D.

3.&

LibreOffice ".# $alc Guide

!$ntax
C/C,JC B$"robability' 5egrees of 2reedom&

*escription
Heturns the in(erse of C/C,J5C,T$3' 5egrees of 2reedom' TH!D$&&. Probability is the probability (alue for which the in(erse of the chi s?uare distribution is to be calculated. %egrees of Freedom is the number of degrees of freedom.

C/CTD,T$5ataP4' dataPD&

Heturns the chi+s?uare distribution from a random distribution of two test series based on the chi+s?uare test for independence. The probability determined by C/CTD,T can also be determined with C/C5C,T' in which case the chi s?uare of the random sample must then be passed as a parameter instead of the data row. %ataQ7 is the array of the obser(ations. dataQ# is the range of the e3pected (alues. This function is defined by the ;52 as #DG)CY.C/CTD,T. Heturns the $1+alpha& confidence inter(al for a normal distribution. alpha is the le(el of the confidence inter(al. +,%#> is the standard de(iation for the total population. si5e is the siFe of the total population. Heturns the correlation coefficient between two data sets. %ataQ1 is the first data set. %ataQ" is the second data set. 4oth arrays shall be the same siFe and shape. )ny empty element or non+numeric (alue in an element will cause the corresponding element to be ignored. Counts how many numbers are in the list of arguments. Te3t entries are ignored. value 1$ value "$ J$ value '1 are (alues or ranges which are to be counted. Counts how many (alues are in the list of arguments. Te3t entries are also counted' e(en when they contain an empty string of length 0. Cf an argument is an array or reference' empty cells within the array or reference are ignored. value 1$ value "$ J$ value '1 are up to 30 arguments representing the (alues to be counted. Heturns the co(ariance of the product of paired de(iations. %ataQ1 is the first data set. %ataQ" is the second data set. )ny empty element or non+numeric (alue in an element will cause the corresponding element to be ignored. Heturns the smallest (alue for which the cumulati(e binomial distribution is less than or e?ual to a criterion (alue. trials is the total number of trials. +P is the probability of success for one trial. alpha is the threshold probability to be reached or e3ceeded. Heturns the sum of s?uares of de(iations based on a sample mean. number 1$ number "$ J$ number '1 are numerical (alues or ranges representing a sample. Heturns the (alue of the probability density function or the cumulati(e distribution function for the e3ponential distribution. ?umber is the (alue of the function. lambda is the parameter (alue. C is a logical (alue that determines the form of the function. C Y 0 calculates the density function' and C Y 1 calculates the distribution function.

C; 2C5D CD$alpha' ,T5DB' siFe&

C;HHD#$5ataP1' 5ataP2&

C;! T$(alue 1' (alue 2' p' (alue 30& C;! T)$(alue 1' (alue 2' p' (alue 30&

C;B)H$5ataP1' 5ataP2&

CHCT4C ;1$trials' ,"' alpha&

5DB,J$number 1' number 2' p' number 30& DQ"; 5C,T$ umberN lambda' C&

,ppendi* B Description of 'unctions

3.A

!$ntax
25C,T$ umber' degreesPfreedomP1' degreesPfreedomP2&

*escription
Calculates the (alues of an 2 probability distribution. ?umber is the (alue for which the 2 distribution is to be calculated. degreesQfreedomQ1 is the degrees of freedom in the numerator in the 2 distribution. degreesQfreedomQ" is the degrees of freedom in the denominator in the 2 distribution. Cn the ;52 specification this is named #DG)CY.25C,T and a new 25C,T has been defined which has yet to be implemented in Calc. Heturns the in(erse of the 2 probability distribution. number is the probability (alue for which the in(erse 2 distribution is to be calculated. degreesQfreedomQ1 is the number of degrees of freedom in the numerator of the 2 distribution. degreesQfreedomQ" is the number of degrees of freedom in the denominator of the 2 distribution. Cn the ;52 specification this is named #DG)CY.2C B and a new 2C B has been defined which has yet to be implemented in Calc. Heturns the 2isher transformation for the gi(en ?umber. 2C,/DH is a synonym for )T) /. Heturns the in(erse of the 2isher transformation for the gi(en ?umber. 2C,/DHC B is a synonym for T) /. D3trapolates future (alues based on e3isting 3 and y (alues. value is the 3 (alue' for which the y (alue of the linear regression is to be returned. dataQI is the array or range of -nown Y+(alues. dataQO is the array or range of -nown Q+ (alues. 5oes not wor- for e3ponential functions. 4oth arrays must be the same siFe and shape. ) non+numeric (alue in an element causes the corresponding element to be ignored. Heturns the result of an 2 test. dataQ1 is the first record array. dataQ" is the second record array. Heturns the (alue of the Gamma function. ?umber is the (alue for which the Gamma function is to be calculated. Heturns the (alue of the probability density function or the cumulati(e distribution function for the Gamma distribution. ?umber is the (alue for which the Gamma distribution is to be calculated. alpha is the parameter )lpha of the Gamma distribution. beta is the parameter 4eta of the Gamma distribution. Cumulative Y 0 calculates the density function' and Cumulative Y 1 calculates the distribution. Heturns the in(erse of the G)11)5C,T$ umber' alpha' beta' TH!D$&&. This function allows you to search for (ariables with different distribution. ?umber is the probability (alue for which the in(erse Gamma distribution is to be calculated. alpha is the parameter )lpha of the Gamma distribution. beta is the parameter 4eta of the Gamma distribution.

2C B$number' degreesPfreedomP1' degreesPfreedomP2&

2C,/DH$ umber& 2C,/DHC B$ umber& 2;HDC),T$(alue' dataPY' dataPQ&

2TD,T$dataP1' dataP2& G)11)$ umber& G)11)5C,T$ umber' alpha' beta' Cumulati(e&

G)11)C B$ umber' alpha' beta&

G)11)# $ umber& G)!,,$ umber&

Heturns the natural logarithm of the Gamma function for the gi(en ?umber. Heturns 0.A less than the standard normal cumulati(e distribution for the gi(en ?umber.

3.-

LibreOffice ".# $alc Guide

!$ntax
GD;1D) $number 1' number 2' p' number 30& /)H1D) $number 1' number 2' p' number 30&

*escription
Heturns the geometric mean of a sample. number 1$ number "$ J$ number '1 are numerical arguments or ranges that represent the sample. Heturns the harmonic mean of a data set. The harmonic mean is the reciprocal of the arithmetic mean of reciprocals. number 1$ number "$ J$ number '1 are (alues or ranges for which you want to calculate the harmonic mean. Heturns the hypergeometric distribution. O is the number of successes achie(ed in the random sample. nQsample is the siFe of the random sample. successes is the number of successes in the total population. nQpopulation is the siFe of the total population. This function does not fully comply with the ;52 (1.2 specification' ha(ing no logical Cumulative parameter. Calculates the y+(alue at which a line will intersect the y+a3is by using -nown 3+(alues and y+(alues. dataQI is the array of Y+(alues. dataQO is the array of Q+(alues umbers or names' arrays or references containing numbers must be used here.

/Y"GD;15C,T$Q' nPsample' successes' nPpopulation&

C TDHCD"T$dataPY' dataPQ&

6!HT$number 1' number 2' p' number 30&

Heturns the -urtosis of a data set $at least < (alues re?uired&. number 1$ number "$ J$ number '1 are numerical arguments or ranges representing a random sample of distribution. 6urtosis characteriFes the relati(e pea-edness or flatness of a distribution compared with the normal distribution. "ositi(e -urtosis indicates a relati(ely pea-ed distribution $compared to the normal distribution&' while negati(e -urtosis indicates a relati(ely flat distribution.

#)HGD$data' Han-Pc&

Heturns the Han-Pc+th largest (alue in a data set. data is the cell range of data. 3ankQc is the ran-ing of the (alue $2nd largest' 3rd largest' etc.& written as an integer. Heturns the in(erse of the lognormal distribution for the gi(en number' a probability (alue. mean is the arithmetic mean of the standard logarithmic distribution. +,%#> is the standard de(iation of the standard logarithmic distribution. Heturns the (alue of the probability density function or the cumulati(e distribution function for the lognormal distribution with the mean and standard de(iation gi(en. ?umber' a probability (alue. mean is the mean (alue of the standard logarithmic distribution. +,%#> is the standard de(iation of the standard logarithmic distribution. Cumulative $optional& Y 0 calculates the density function' Cumulative Y 1 calculates the distribution. Heturns the ma3imum (alue in a list of arguments. number 1$ numberQ"$ J$ number '1 are numerical (alues or ranges. one+numbers are ignored.

#;GC B$numberN mean' ,T5DB&

#;G ;H15C,T$ umber' mean' ,T5DB' Cumulati(e&

1)Q$number 1' number 2' p' number 30&

,ppendi* B Description of 'unctions

3..

!$ntax
1)Q)$(alue 1' (alue 2' p' (alue 30&

*escription
Heturns the ma3imum (alue in a list of arguments. !nli-e 1)Q' te3t and logical (alues can be entered. Te3t is e(aluated as 0' logical True is treated as 1 and logical 2alse as 0. value 1$ value "$ J$ value '1 are (alues or ranges. Heturns the median of a set of numbers. number 1$ number "$ J$ number '1 are (alues or ranges' which represent a sample. Dach number can also be replaced by a reference. 1D5C) logically ran-s the numbers $lowest to highest&. Cf gi(en an odd number of (alues' 1D5C) returns the middle (alue. Cf gi(en an e(en number of (alues' 1D5C) returns the arithmetic a(erage of the two middle (alues.

1D5C) $number 1' number 2' p' number 30&

1C $number 1' number 2' p' number 30& 1C )$(alue 1' (alue 2' p' (alue 30&

Heturns the minimum (alue in a list of arguments. number 1$ number "$ J$ number '1 are numerical (alues or ranges. Heturns the minimum (alue in a list of arguments. Te3t and logical (alues are e(aluated. Te3t is e(aluated as 0' logical True is treated as 1 and logical 2alse as 0. value 1$ value "$ J$ value '1 are (alues or ranges. Heturns the most common (alue in a data set. number 1$ number "$ J$ number '1 are numerical (alues or ranges. Cf se(eral (alues ha(e the same fre?uency' it returns the smallest (alue. )n error occurs if a (alue does not appear more than once. Heturns the negati(e binomial distribution. O is the (alue returned for unsuccessful tests. 3 is the (alue returned for successful tests. +P is the probability of the success of an attempt. DG4C ;15C,T returns the probability that there will be 3 failures before the r+th success' when the constant probability of a success is sp.

1;5D$number 1' number 2' p' number 30&

DG4C ;15C,T$Q' H' ,"&

;H15C,T$ umber' 1ean' ,T5DB' C&

Heturns the (alue of the probability density function or the cumulati(e distribution function for the normal distribution with the mean and standard de(iation gi(en. ?umber is the (alue for which the normal distribution is to be calculated. 4ean is the mean (alue of the normal distribution. +,%#> is the standard de(iation of the normal distribution. C Y 0 or 2)#,D it calculates the probability density function' and C Y 1' TH!D or omitted' it calculates the cumulati(e distribution function.

;H1C B$number' mean' ,T5DB&

Heturns the in(erse of the normal distribution for the gi(en probability (alue' number' in the distribution. mean is the mean (alue in the normal distribution. +,%#> is the standard de(iation of the normal distribution. Heturns the standard normal cumulati(e distribution for the gi(en ?umber. This function is defined as #DG)CY. ;H1,5C,T in the ;52 (1.2 specification. This is e3actly ;H15C,T$3'0'1'TH!D$&&.

;H1,5C,T$ umber&

"88

LibreOffice ".# $alc Guide

!$ntax
;H1,C B$number&

*escription
Heturns the in(erse of the standard normal distribution for the gi(en probability (alue' number. number must be 0 f number f 1. This function is defined as #DG)CY. ;H1,C B in the ;52 (1.2 specification. Heturns the "earson correlation coefficient' r' of two data sets. %ataQ1 is the array of the first data set. %ataQ" is the array of the second data set. 2or an empty element or an element of type Te3t or 4oolean in %ataQ1 the element at the corresponding position of %ataQ" is ignored' and (ice (ersa. 4oth arrays must be the same siFe and shape. Heturns the alpha+percentile of data (alues in an array. data is the array of data. Alpha is the percentile (alue between 0 and 1. Cf )lpha is not a multiple of 1/$n + 1&' "DHCD TC#D interpolates to determine the (alue between two data points. Heturns the percentage ran- $percentile& of the gi(en value in a sample. data is the array of data in the sample. Heturns the number of permutations for a gi(en number of obGects without repetition. CountQ1 is the total number of obGects. CountQ" is the number of obGects in each permutation. Heturns the number of permutations for a gi(en number of obGects $repetition allowed' meaning an obGect can combine with itself&. CountQ1 is the total number of obGects. CountQ" is the number of obGects in each permutation. Heturns the (alues of the distribution function for a standard normal distribution for the gi(en number. "/C$number& is a synonym for ;H15C,T$number'0'1'2)#,D$&&. Heturns the probability' or the cumulati(e distribution function for the "oisson distribution of ?umber. mean is the middle (alue of the "oisson distribution. Cumulative Y 0 calculates the probability density function' and Cumulative Y 1 calculates the distribution. Heturns the probability that (alues in a range are between two limits. data is the array or range of data in the sample. probability is the array or range of the corresponding probabilities. +tart is the start (alue of the inter(al whose probabilities are to be summed. #nd $optional& is the end (alue of the inter(al whose probabilities are to be summed. Cf this parameter is missing' then #nd Y +tart (alue is assumed. Heturns the ?uartile of a data set. data is the array of data in the sample. ,ype is the number of the ?uartile to return. $0 Y 1in' 1 Y 2Ad' 2 Y A0d $1edian&' 3 Y EAd and < Y 1a3&. 4ased on the statistical ran- of the data points in data' J!)HTC#D returns the percentile (alue indicated by ,ype. The percentile is calculated as ,ype di(ided by <. The same algorithm used in "DHCD TC#D is used here to interpolate between two data points.

"D)H,; $5ataP1' 5ataP2&

"DHCD TC#D$data' )lpha&

"DHCD TH) 6$data' (alue& "DH1!T$CountP1' CountP2&

"DH1!T)TC; )$CountP1' CountP2&

"/C$number&

";C,,; $ umber' mean' Cumulati(e&

"H;4$data' probability' ,tart' Dnd&

J!)HTC#D$data' Type&

,ppendi* B Description of 'unctions

"8#

!$ntax
H) 6$(alue' 5ata' Type&

*escription
Heturns the ran- of the gi(en value in a sample. %ata is the array or range of data in the sample. ,ype $optional& is the ran-ing order' if omitted or 0 data is ran-ed in ascending order' if not 0 data is ran-ed in descending order. Heturns the s?uare of the "earson product moment correlation coefficient based on the gi(en (alues. dataQI is an array of data points. dataQO is an array of data points. The arguments shall be either numbers or names' arrays' or references that contain numbers. Cf an array or reference argument contains Te3t' #ogical (alues' or empty cells' those (alues are ignoredN howe(er' cells with the (alue Fero are included. 4oth arrays must ha(e the same siFe and shape.

H,J$dataPY' dataPQ&

,6D0$number 1' number 2' p' number 30& ,6D0"$number 1' number 2' p' number 30&

Heturns the s-ewness of a distribution. number 1$ number "$ J$ number '1 are numerical (alues or ranges. There must be a minimum of three numbers. Calculates the s-ewness of a distribution using the population of a random (ariable. number 1$ number "$ J$ number '1 are numerical (alues or ranges. There must be a minimum of three numbers. Heturns the slope of the linear regression line. dataQI is the array or matri3 of Y data. dataQO is the array or matri3 of Q data. 4oth arrays must ha(e the same siFe and shape. 2or an empty element or an element of type Te3t or 4oolean in y the element at the corresponding position of 3 is ignored' and (ice (ersa. Heturns the Han-Pc+th smallest (alue in a data set. data is the cell range of data. 3ankQc is the ran- of the (alue $2nd smallest' 3rd smallest' etc.& written as an integer. Con(erts a random (ariable to a normaliFed (alue. ?umber is the (alue to be standardiFed. mean is the arithmetic mean of the distribution. +,%#> is the standard de(iation of the distribution. Computes the sample standard de(iation of a set of numbers. number 1$ number "$ J$ number '1 are numerical (alues or ranges representing a sample based on an entire population. Calculates the standard de(iation using a sample set of (alues' including (alues of type Te3t and #ogical. value 1$ value "$ J$ value '1 are (alues or ranges representing a sample deri(ed from an entire population. Te3t has the (alue 0.

,#;"D$dataPY' dataPQ&

,1)##$data' Han-Pc&

,T) 5)H5CTD$ umber' mean' ,T5DB&

,T5DB$number 1' number 2' p' number 30&

,T5DB)$(alue 1' (alue 2' p' (alue 30&

,T5DB"$number 1' number 2' p' number 30&

Calculates the standard de(iation using the population of a random (ariable' including (alues of type Te3t and #ogical. number 1$ number "$ J$ number '1 are numerical (alues or ranges representing a sample based on an entire population.

"89

LibreOffice ".# $alc Guide

!$ntax
,T5DB")$(alue 1' (alue 2' p' (alue 30&

*escription
Calculates the standard de(iation based on the entire population. value 1$ value "$ J$ value '1 are (alues or ranges representing a sample deri(ed from an entire population. Te3t has the (alue 0. #ogical 2)#,D is 0 and logical TH!D is 1. Heturns the standard error of the predicted y (alue for each 3 in the regression. dataQI is the array or matri3 of Y data. dataQO is the array or matri3 of Q data. 4oth arrays must ha(e the same siFe and shape and contain at least three numbers. Heturns the t+distribution for the gi(en ?umber. degreesQfreedom is the number of degrees of freedom for the t+distribution. mode Y 1 returns the one+tailed test' mode Y 2 returns the two+tailed test. This function is named #DG)CY.T5C,T in the ;52 (1.2 specification. Heturns the in(erse of the t+distribution' for the gi(en number associated with the two+tailed t+distribution. degreesQfreedom is the number of degrees of freedom for the t+distribution. Heturns the mean of a data set' ignoring a proportion of high and low (alues. data $re?uired& is the array of data in the sample. Alpha $re?uired& is the fractional number of data points to e3clude from the calculation. 2or e3ample' if Alpha Y 0.2' < points are trimmed from a data set of 20 points $20 3 0.2&% 2 from the top and 2 from the bottom of the set. Heturns the probability associated with a ,tudentIs t+Test. dataQ1 is the dependent array or range of data for the first record. dataQ" is the dependent array or range of data for the second record. mode Y 1 calculates the one+tailed distribution' mode Y 2 the two+ tailed distribution. ,ype of t+ test to perform% paired $1&' e?ual (ariance $homoscedastic& $2&' or une?ual (ariance $heteroscedastic& $3&. Calculates the (ariance based on a sample. number 1$ number "$ J$ number '1 are numerical (alues or ranges representing a sample based on an entire population. He?uires at least two numbers. Dstimates a (ariance based on a sample. value 1$ value "$ J$ value '1 are (alues or ranges representing a sample deri(ed from an entire population. Te3t is e(aluated as 0. #ogical TH!D is e(aluated as 1 and 2)#,D as 0. Calculates a (ariance based on the entire population. number 1$ number "$ J$ number '1 are numerical (alues or ranges representing an entire population. Calculates the (ariance based on the entire population. The (alue of te3t is 0. value 1$ value "$ J$ value '1 are (alues or ranges representing an entire population. Te3t is e(aluated as 0. #ogical TH!D is e(aluated as 1 and 2)#,D as 0.

,TDYQ$dataPY' dataPQ&

T5C,T$ umber' degreesPfreedom' mode&

TC B$number' degreesPfreedom&

THC11D) $data' )lpha&

TTD,T$dataP1' dataP2' mode' Type&

B)H$number 1' number 2' p' number 30&

B)H)$(alue 1' (alue 2' p' (alue 30&

B)H"$number 1' number 2' p' number 30& B)H")$(alue 1' (alue 2' p' (alue 30&

,ppendi* B Description of 'unctions

"83

!$ntax
0DC4!##$ umber' )lpha' beta' C&

*escription
Heturns the (alues of the 0eibull distribution at the gi(en ?umber. Alpha is the alpha parameter of the 0eibull distribution. beta is the beta parameter of the 0eibull distribution. C indicates the type of function% CY 0 the probability density function is calculated' CY1 the cumulati(e distribution function is calculated. Heturns the two+tailed " (alue of a F test with standard distribution. data is the array of the data. mu is the (alue to be tested. sigma $optional& is the standard de(iation of the total population. Cf this argument is missing' the standard de(iation of the sample is processed.

TTD,T$data' mu' sigma&

%ate and time functions


!se these functions for inserting' editing' and manipulating dates and times. #ibre;ffice handles and computes a date/time (alue as a number. 0hen you assign the number format K umberL to a date or time (alue' it is displayed as a number. 2or e3ample' 01/01/2000 12%00 "1' con(erts to 3@[email protected]. This is Gust a matter of formattingN the actual (alue is always stored and manipulated as a number. To see the date or time displayed in a standard format' change the number format $date or time& accordingly. To set the default date format used by Calc' go to ,ools < =ptions < 2ibre=ffice Calc < Calculate.

Caution

0hen entering dates' slashes or dashes used as date separators may be interpreted as arithmetic operators. To -eep dates from being interpreted as parts of formulas' and thus returning erroneous results' always place them in ?uotation mar-s' for e3ample' U12/0*/A2U. ,ee also ) note about dates on page 3*<.

(able "#: Data and time functions !$ntax


5)TD$year' month' day&

*escription
Con(erts a date written as year' month' day to an internal serial number and displays it in the cellIs formatting. year is an integer between 1A*3 and ::A@ or 0 and ::. month is an integer between 1 and 12. day is an integer between 1 and 31. Heturns the difference in years' months' or days of two date numbers' +tart date and #nd date. nterval is entered as KyL' KmL or KdL' to return the (alue in years' months or days or as KymL' KmdL or KydL for months ignoring the years (alueN days ignoring the months and years (aluesN or days ignoring the months and years (alues. +tart date and #nd date must be entered using double ?uotes. Heturns the date serial number for te3t in double ?uotes using the current locale. te.t is a (alid date e3pression. Heturns the day' as an integer' of the gi(en date (alue. ?umber is the date serial number $a negati(e date/time (alue can be entered& or a date (alue entered in double ?uotes.

5)TD5C2$,tart date' Dnd date' Cnter(al&

5)TDB)#!D$te3t& 5)Y$ umber&

"8"

LibreOffice ".# $alc Guide

!$ntax
5)Y,$5ateP2' 5ateP1&

*escription
Calculates the difference' in days' between two date (alues. %ateQ1 is the start date. %ateQ" is the end date. Cf %ateQ" is an earlier date than %ateQ1' the result is a negati(e number. 5ates can be entered as numbers or te3t. Heturns the difference between two dates based on the 3@0 day year used in interest calculations. Cf %ateQ" is earlier than %ateQ1' the function will return a negati(e number. ,ype $optional& determines the type of difference calculation% the !, method $0& or the Duropean method $r0&. 5ates can be entered as numbers or te3t. Calculates the number of days in the month of the gi(en %ate. 5ate can be entered as a number or te3t. Calculates the number of days in the year of the gi(en %ate. 5ate can be entered as a number or te3t. Heturns the date of Daster ,unday for the entered year. year is an integer between 1A*3 and ::A@ or 0 and :: $1:33 or 2033 depending on the option set&.. Heturns the serial number of the date a number of 4onths away from the gi(en +tart date. ;nly months are consideredN days are not used for calculation. 4onths is the number of months before $negati(e& or after $positi(e& the start date. +tart date may be entered as te3t or a number. Heturns the serial number date of the last day of a month which falls 4onths away from the gi(en +tart date. 4onths is the number of months before $negati(e& or after $positi(e& the start date. +tart date may be entered as te3t or a number. Heturns the hour' as an integer' for the gi(en time (alue. ?umber is a time (alue and can be either te3t or a number. 5etermines whether a gi(en %ate falls within a leap year. Heturns either 1 $TH!D& or 0 $2)#,D&. %ate must be a full date for te3t' a reference to a date (alue or a serial number. Heturns the minute' as an integer' for the gi(en time (alue. ?umber is a time (alue. Heturns the month' as an integer' for the gi(en date (alue. ?umber is a time (alue. Calculates the difference' in months' between two date (alues. +tart date is the start $earlier& date. #nd date is the end date. ,ype determines the type of calculation and is one of two possible (aluesN 1 returns the difference between the calendar month (alues in the two dates' disregarding the day (aluesN 0 returns the number of months that separate the dates ta-ing into account the day (alues of the two dates. Cf #nd date is an earlier date than +tart date' the result is a negati(e number.

5)Y,3@0$5ateP1' 5ateP2' Type&

5)Y,C 1; T/$5ate& 5)Y,C YD)H$5ate& D),TDH,! 5)Y$year&

D5)TD$,tart date' 1onths&

D;1; T/$,tart date' 1onths&

/;!H$ umber& C,#D)"YD)H$5ate&

1C !TD$ umber& 1; T/$ umber& 1; T/,$,tart date' Dnd date' Type&

,ppendi* B Description of 'unctions

"8%

!$ntax
DT0;H65)Y,$,tart date' Dnd date' /olidays&

*escription
Heturns the number of wor-days between +tart date and #nd date. /olidays can be deducted. +tart date is the date from which the calculation is carried out. #nd date is the date up to which the calculation is carried out. Cf the start or end date is a wor-day' the day is included in the calculation. ;olidays $optional& is a list of holidays. Dnter a cell range in which the holidays are listed indi(idually. ,aturdays and ,undays are considered non+wor-days. Heturns the computer system date and time. The (alue is updated when your document recalculates. ;0$& is a function without arguments. Heturns the second' as an integer' for the gi(en time (alue. ?umber is a time (alue. Heturns the time (alue from (alues for hours' minutes and seconds. This function can be used to con(ert a time based on these three elements to a decimal time (alue. hour' minute and second must all be integers. Heturns the time serial number (alue from te.t enclosed by ?uotes in a time entry format. The (alue of the decimal number returned is the result of the date system used under #ibre;ffice to calculate date entries. Heturns the current computer system date. The (alue is updated when your document recalculates. T;5)Y$& is a function without arguments. Heturns the day of the wee- for the gi(en ?umber $date (alue&. The day is returned as an integer based on the type. ,ype determines the type of calculation% ,ype Y 1 $assumed if ,ype is omitted&' the wee-days are counted $1+E& starting from ,unday $1onday Y 2&N ,ype Y 2' the wee-days are counted $1+E& starting from 1onday $1onday Y 1&N ,ype Y 3' the wee-days are counted $0+@& starting from 1onday $1onday Y 0&. Calculates the number of the calendar wee- of the year for the gi(en date ?umber. mode sets the start of the wee- and the calculation type% 1 Y ,unday' any other (alue Y 1onday. Calculates the calendar wee- of the year for a %ate. %ate is the date within the calendar wee-. 3eturn type sets the start of the wee- and the calculation type% 1 Y ,unday' 2 Y 1onday. This function returns the same results as the 0DD6 !1 function in D3cel. Calculates the difference in wee-s between two dates' +tart date and #nd date. ,ype is one of two possible (alues' 0 $number of whole wee-s in the inter(al& or 1 $returns the number of different wee-s in which the two dates appear&. This function uses the C,; wee-number. Calculates the number of wee-s in a year for a gi(en %ate. ) wee- that spans two years is added to the year in which most days of that wee- occur $so any wee- containing four or more days in the calendar year of %ate is counted&.

;0$&

,DC; 5$ umber& TC1D$hour' minute' second&

TC1DB)#!D$te3t&

T;5)Y$&

0DD65)Y$ umber' Type&

0DD6 !1$ umber' mode&

0DD6 !1P)55$5ate' Heturn type&

0DD6,$,tart date' Dnd date' Type&

0DD6,C YD)H$5ate&

"8&

LibreOffice ".# $alc Guide

!$ntax
0;H65)Y$,tart date' 5ays' /olidays&

*escription
Heturns a date serial number which is a specified number of wor- days $%ays& before or after an input date' +tart date. ;olidays $optional& is a list of holidays. Dnter a cell range in which the holidays are listed indi(idually. 0or- days e3clude ,aturdays and ,undays. This function does not fully implement the ;52(1.2 specification which allows you to set the non+wor- days. Heturns the calendar year as an integer according to the internal calculation rules. ?umber is the date (alue in date serial number format or as a te3t date' for which the year is to be returned. D3tracts the number of years $including fractional part& between two date (alues' +tart date and #nd date. 7asis is a (alue either omitted or between 0 and <' chosen from a list of options and indicates how the year is to be calculated $see /elp files&. Cf omitted it is e(aluated as 0. Calculates the difference in years between two dates% the +tart date and the #nd date. ,ype calculates the type of difference. "ossible (alues are 0 $inter(al& and 1 $in calendar years&.

YD)H$ umber&

YD)H2H)C$,tart date' Dnd date' 4asis&

YD)H,$,tart date' Dnd date' Type&

2ogical functions
!se the logical functions to test (alues and produce results based on the result of the test. These functions are conditional and pro(ide the ability to write longer formulas based on input or output. (able "9: Logical functions !$ntax
) 5$#ogical (alue 1' #ogical (alue 2' p' #ogical (alue 30&

*escription
Heturns TH!D if all arguments are TH!D. Cf any element is 2)#,D' this function returns the 2)#,D (alue. 2ogical value 1$ 2ogical value "$ J$ 2ogical value '1 are conditions to be chec-ed. )ll conditions can be either TH!D or 2)#,D. Cf a range is entered as a parameter' only logical (alues in the range are e(aluated. The result is TH!D if the logical (alue in all cells within the cell range is TH!D. 4ug E0@32% Concerning range statement gi(en in /elp. ,et the logical (alue to 2)#,D. The 2)#,D$& function does not re?uire any arguments. ,pecifies a logical test to be performed. ,est is any (alue or e3pression that can be TH!D or 2)#,D. ,henQvalue $optional& is the (alue that is returned if the logical test is TH!D. =therwiseQvalue $optional& is the (alue that is returned if the logical test is 2)#,D. D(aluates valueR if it is not an error it returns the result for value' or else it returns the alternative value. Cf value e(aluates to a logical (alue' then either 1 $for TH!D&' or 0 $for 2)#,D& is returned.
"8A

2)#,D$& C2$TestN ThenP(alue' ;therwiseP(alue&

C2DHH;H$(alue' alternati(e (alue&

,ppendi* B Description of 'unctions

!$ntax
C2 )$(alue' alternati(e (alue&

*escription
D(aluates valueR if it is not a h /) error it returns the result for value' or else it returns the alternative value. Cf value e(aluates to a logical (alue' then either 1 $for TH!D&' or 0 $for 2)#,D& is returned. He(erses the logical (alue. 2ogical value is the TH!D or 2)#,D (alue to be re(ersed. Heturns TH!D if at least one argument is TH!D. Heturns the (alue 2)#,D if all the arguments ha(e the logical (alue 2)#,D. 2ogical value 1$ 2ogical value "$ J$ 2ogical value '1 are conditions to be chec-ed. )ll conditions can be either TH!D or 2)#,D. ,ets the logical (alue to TH!D. The TH!D$& function does not re?uire any arguments. Computes the logical Q;H of the parameters. Cf an e(en number of parameters is TH!D it returns 2)#,D' if an odd number of parameters is TH!D it returns TH!D.

;T$#ogical (alue& ;H$#ogical (alue 1' #ogical (alue 2' p' #ogical (alue 30&

TH!D$& Q;H$#ogical (alue 1' #ogical (alue 2' p' #ogical (alue 30&

nformation functions
These functions pro(ide information $or feedbac-& regarding the results of a test for a specific condition' or a test for the type of data or content a cell contains. (able "3: 0nformational functions !$ntax
CD##$infoPtype' Heference&

*escription
Heturns information on a cell such as its address' formatting or contents of a cell based on the (alue of the infoPtype argument. infoQtype specifies the type of information to be returned and comes from a predefined list of arguments. ,ee /elp files for complete listing. infoQtype is not case sensiti(e' but it must be enclosed within ?uotes. 3eference is the address of the cell to be e3amined. Cf 3eference is a range' the cell reference mo(es to the top left of the range. Cf 3eference is missing' Calc uses the position of the cell in which this formula is located. Calculates the current (alue of a formula at the actual position. 5isplays in the current location' the formula contained in a cell cell at 3eference position. Cf no formula at 3eference can be found' or if the presented argument is not a reference' returns the error (alue h /). Heturns information about the wor-ing en(ironment. ,e.t is a string constant entered in double ?uotes ta-en from a list of arguments. ,ee the /elp files for the listing. Heturns TH!D if the referenced cell is blan-' else returns 2)#,D. Cf value is of type umber' Te3t' or #ogical' return 2)#,D. Cf value is a reference to a cell' e3amine the cellN if it is blan- $has no (alue&' return TH!D' but if it has a (alue' return 2)#,D. ) cell with the empty string is not considered blan-.

C!HHD T$& 2;H1!#)$Heference&

C 2;$Te3t&

C,4#) 6$(alue&

"8-

LibreOffice ".# $alc Guide

!$ntax
C,DHH$(alue&

*escription
Heturns TH!D if the (alue refers to any error (alue e3cept h /). You can use this function to control error (alues in certain cells. Cf an error occurs' the function returns a logical or numerical (alue. value is any (alue or e3pression in which a test is performed to determine whether an error (alue not e?ual to h /) is present. The C,DHH;H tests if the cells contain general error (alues. C,DHH;H recogniFes the h /) error (alue. Cf an error occurs' the function returns a logical or numerical (alue. value is any (alue where a test is performed to determine whether it is an error (alue. Heturns TH!D if the gi(en value is an e(en integer' or 2)#,D if the value is odd. Cf the value is not an integer' the function e(aluates only the integer part of the (alue. Tests for e(en numbers. Heturns TH!D $1& if the integer part of ?umber returns a whole number when di(ided by 2. Heturns TH!D if a cell is a formula cell. Cf an error occurs' the function returns a logical or numerical (alue. reference indicates the reference to a cell in which the test will be performed. Heturns TH!D if the cell contains a logical number format. The function is used in order to chec- for both TH!D and 2)#,D (alues in certain cells. Cf an error occurs' the function returns a logical or numerical (alue. value is the cell reference to be tested for logical number format. Heturns TH!D if value contains the h /) $(alue not a(ailable& error (alue. Cf an error occurs' the function returns a logical or numerical (alue. value is the cell' (alue or e3pression to be tested. Heturn TH!D if the parameter does not ha(e type Te3t' else return 2)#,D. Cf an error occurs' the function returns a logical or numerical (alue. value is any (alue or e3pression where a test is performed to determine whether it is a te3t or numbers or a 4oolean (alue. Dmpty cells are considered non+te3t and will return TH!D. Heturns TH!D if value e(aluates to a number. Cf an error occurs' the function returns a logical or numerical (alue. value is any e3pression to be tested to determine whether it is a number or te3t. TH!D $1& and 2)#,D $0& are e(aluated as numbers. Heturns TH!D if value e(aluates as an odd integer' else 2)#,D. value is truncated to an integer before e(aluation. TH!D $1& and 2)#,D $0& are e(aluated as numbers. Te3t returns an error. Tero is e(aluated 2)#,D. Heturns 1 if ?umber does not return a whole number when di(ided by 2' else 0. ?umber is the number to be tested. 5oes not return logical type TH!D/2)#,D li-e C,;55N returns number.

C,DHH;H$(alue&

C,DBD $(alue&

C,DBD P)55$ umber& C,2;H1!#)$reference&

C,#;GCC)#$(alue&

C, )$(alue&

C, ; TDQT$(alue&

C, !14DH$(alue&

C,;55$(alue&

C,;55P)55$ umber&

,ppendi* B Description of 'unctions

"8.

!$ntax
C,HD2$(alue&

*escription
Heturns TH!D if value is of type reference $including a reference list&' else return 2)#,D. Cf an error occurs' the function returns a logical or numerical (alue. Ct does not e(aluate the content of the reference. Heturns TH!D if value is of type te3t' else 2)#,D. Cf an error occurs' the function returns a logical or numerical (alue. >alue is a (alue' number' 4oolean (alue' or error (alue to be tested. Cf value is a reference' the content of the reference is e(aluated. Heturn the number of value. Cf value is a reference the reference content is e(aluated. Cf value is a logical (alue' 1 is returned for TH!D' else 0. Cf value is an error it is returned. Te3t returns a 0. Heturns the error (alue h /). D(aluates value and returns a number indicating its type. Cf an error occurs' the function returns the error. The numerical (alue from which the data type is determined isN 1 Y number' 2 Y te3t' < Y 4oolean (alue' * Y formula' 1@ Y error (alue. Cf value references an empty cell' an error is returned. The results of a formula in a reference are not e(aluated.

C,TDQT$(alue&

$(alue&

)$& TY"D$(alue&

%atabase functions
This section deals with functions used with data organiFed as one row of data for one record. The Database category should not be confused with the 4ase database component in #ibre;ffice. ) Calc database is simply a range of cells that comprises a bloc- of related data where each row contains a separate record. There is no connection between a database in #ibre;ffice and the Database category in #ibre;ffice Calc. The database functions use the following common arguments%

%atabase is a range of cells which define the database. %atabase field specifies the column which the function operates on after the search
criteria of the first parameter is applied and the data rows are selected. Ct is not related to the search criteria itself. The number 0 specifies the whole data range. To reference a column by using the column header name' place ?uotation mar-s around the header name.

+earch criteria is a cell range containing the search criteria.. Dmpty cells in the search
criteria range will be ignored.
)ll of the search criteria arguments for the database functions support regular e3pressions. 2or e3ample' Kall.Z can be entered to find the first location of Kall followed by any characters. To search for te3t that is also a regular e3pression' precede e(ery character with a m character. You can switch the automatic e(aluation of regular e3pressions on and off in ,ools < =ptions < 2ibre=ffice Calc < Calculate.

?ote

"#8

LibreOffice ".# $alc Guide

(able "": Database average !$ntax


5)BDH)GD$5atabase' 5atabase field' ,earch criteria& 5C;! T$5atabase' 5atabase field' ,earch criteria& 5C;! T)$5atabase' 5atabase field' ,earch criteria& 5GDT$5atabase' 5atabase field' ,earch criteria&

*escription
Heturns the a(erage of the (alues in a gi(en database field from the records $rows& in a database that match the search criteria. %atabase field cannot be 0 or empty. Counts the number of records $rows& in a database that match the search criteria and contain numerical (alues. %atabase field can be empty or 0. Counts the number of rows $records& in a database that match the specified search criteria and contain numeric or alphanumeric (alues. %atabase field can be empty or 0. Heturns the field (alue from a record in a database' which matches the search criteria. The search criteria must return a single (alue. Cn case of an error' the function returns either hB)#!Dl for no record or field (alues found' or DrrA02 for more than one cell in the search criteria. Heturns the ma3imum (alue of a field in a database $all records& that matches the specified +earch criteria. The search supports regular e3pressions. Heturns the minimum (alue of a field in a database that matches the specified +earch criteria. The search supports regular e3pressions. 1ultiplies all cells of a data range where the cell contents match the +earch criteria. The search supports regular e3pressions. 2inds the sample standard de(iation in a gi(en field from the records $rows& in a database that match a search criteria. 2inds the population standard de(iation in a gi(en field from the records $rows& in a database that match a search criteria. 2inds the sum of (alues in a gi(en field from the records $rows& in a database that match a search criteria. The search supports regular e3pressions. 2inds the sample (ariance in a gi(en field from the records $rows& in a database that match a search criteria. 2inds the population (ariance in a gi(en field from the records $rows& in a database that match a search criteria.

51)Q$5atabase' 5atabase field' ,earch criteria& 51C $5atabase' 5atabase field' ,earch criteria& 5"H;5!CT$5atabase' 5atabase field' ,earch criteria& 5,T5DB$5atabase' 5atabase field' ,earch criteria& 5,T5DB"$5atabase' 5atabase field' ,earch criteria& 5,!1$5atabase' 5atabase field' ,earch criteria& 5B)H$5atabase' 5atabase field' ,earch criteria& 5B)H"$5atabase' 5atabase field' ,earch criteria&

,ppendi* B Description of 'unctions

"##

Array functions
0hen using the 2unction 0iFard for )rray functions' those returning an array result ha(e the )rray chec-+bo3 automatically selected. (able "%: ,rra2 functions !$ntax
2HDJ!D CY$data' classes&

*escription
CategoriFes (alues into inter(als and counts the number of (alues in each inter(al. Heturns the results as a (ertical array containing one more result than the number of classes. data is the data that should be categoriFed and counted according to the gi(en inter(als. classes is the array containing the upper boundaries determining the inter(als the (alues in data should be grouped by. Calculates predicted e3ponential growth by using e3isting data. dataQI is the Y data array. dataQO $optional& is the Q data array. newQdataQO $optional& is the Q data array' for which the (alues are to be calculated. Cf newQdataQO is omitted it is assumed to be the same siFe as dataQO. Cf both arrays are omitted' they are assumed to be the array s1'2'3'...t that is the same siFe as the Y data array. FunctionQtype is optional. Cf FunctionQtype Y 1 or omitted' functions in the form y Y bZmi3 are calculated' else y Y mi3 functions are calculated. Heturns the parameters of the $simple or multiple& linear regression e?uation for the gi(en data and' optionally' statistics on this regression. The e?uation for the line is y Y m3 R c' or y Y m131 R m232 R p R c for multiple ranges of 3+(alues' where the dependent y+(alues are a function of the independent 3+(alues. The m+(alues are coefficients corresponding to each 3+(alue' and c is a constant (alue. dataQI is a single row or column range specifying the y coordinates in a set of data points. dataQO $optional& is a corresponding single row or column range specifying the 3 coordinates. Cf dataQO is omitted it defaults to s1'2'3'...' nt. Cf there is more than one set of (ariables dataQO may be a range with corresponding multiple rows or columns. 2inearQtype $optional&% if 2)#,D the straight line found is forced to pass through the origin $the constant c is FeroN y Y m3&. Cf omitted' 2inearQtype defaults to TH!D $the line is not forced through the origin&. stats $optional&% Cf stats Y 0' only the regression coefficient is calculated. ;therwise' other statistics will be returned' see the /elp file for full information. Calculates the adGustment of the entered data as an e3ponential regression cur(e $yYbZmi3&. dataQI is the Y 5ata array. dataQO $optional& is the Q data array. FunctionQtype $optional&% Cf FunctionQtype Y 0' functions in the form y Y mi3 are calculated. ;therwise' y Y bZmi3 functions are calculated. stats $optional&. Cf stats Y 0' only the regression coefficient is calculatedN if stats Y 1 other statistics will be returned' see the /elp file for full information. Heturns the determinant of a s?uare array. This function returns a (alue in the current cellN it is not necessary to define a range for the results. array is an array in which the determinants are defined. The )rray chec-+bo3 is not automatically selected.

GH;0T/$dataPY' dataPQ' newPdataPQ' 2unctionPtype&

#C D,T$dataPY' dataPQ' #inearPtype' stats&

#;GD,T$dataPY' dataPQ' 2unctionPtype' stats&

15DTDH1$array&

"#9

LibreOffice ".# $alc Guide

!$ntax
1C BDH,D$array& 11!#T$array' array&

*escription
Heturns the in(erse array. array is a s?uare array that is to be in(erted. Calculates the array product of two arrays. The number of columns for array 1 must e?ual the number of rows for array 2. array at first place is the first array used in the array product. array at second place is the second array with the same number of rows as the first array has columns. 4ug E112*% ,ame name for two (ariables. Heturns the unitary s?uare array of a certain siFe. The unitary array is a s?uare array where the main diagonal $top left to bottom right& elements are set to 1 and all other array elements are set to 0. %imensions refers to the column and row siFe of the array. 1ultiplies corresponding elements in the gi(en arrays' and returns the sum of those products. Array 1$ Array "$ J$ Array '1 are arrays whose corresponding elements are to be multiplied. )t least one array must be part of the argument list. Cf only one array is gi(en' the array elements are summed. )rrays must ha(e the same siFe and shape. on numeric elements are treated as 0. The )rray chec-+bo3 is not automatically selected. Heturns the sum of the difference of the s?uares of corresponding (alues in two arrays. arrayQ. is the first array whose elements are to be s?uared and added. arrayQy is the second array whose elements are to be s?uared and subtracted. )rrays must ha(e the same siFe and shape. The )rray chec-+bo3 is not automatically selected. Heturns the sum of the sum of the s?uares of the indi(idual (alues in each array. arrayQ. is the first array whose arguments are to be s?uared and summed. arrayQy is the second array' whose arguments are to be s?uared and summed and then summed with the result from the first array. )rrays must ha(e the same siFe and shape. The )rray chec-+bo3 is not automatically selected. )dds the s?uares of the difference between corresponding (alues in two arrays. arrayQ. is the first array from whose elements the corresponding elements of arrayQy are to be subtracted. The results of each subtraction are summed and the results s?uared. )rrays must ha(e the same siFe and shape. The )rray chec-+bo3 is not automatically selected. Transposes the rows and columns of an array. array is the array in the spreadsheet that is to be transposed. Heturns (alues along a linear trend. dataQI is the Y data array. dataQO $optional& is the Q data array. newQdataQO $optional& is the array of the Q data' which are used for recalculating (alues. Cf newQdataQO is omitted it is assumed to be the same siFe as dataQO. Cf both arrays are omitted' they are assumed to be the array s1'2'3'...t that is the same siFe as the Y data array. 2inearQtype is optional. Cf 2inearQtype Y 1 or omitted' functions in the form y Y m3 R c are calculated' else y Y m3 functions are calculated.

1! CT$5imensions&

,!1"H;5!CT$)rray 1' )rray 2' p' )rray 30&

,!1Q21Y2$arrayP3' arrayPy&

,!1Q2"Y2$arrayP3' arrayPy&

,!1Q1Y2$arrayP3' arrayPy&

TH) ,";,D$array& THD 5$dataPY' dataPQ' newPdataPQ' #inearPtype&

,ppendi* B Description of 'unctions

"#3

+preadsheet functions
!se spreadsheet functions to search and address cell ranges and pro(ide feedbac- regarding the contents of a cell or range of cells. You can use functions such as /Y"DH#C 6$& and 55D$& to connect to other documents or data sources. (able "&: Spreadsheet functions !$ntax
)55HD,,$row' column' )4,' )1' sheet&

*escription
Heturns a cell address $reference& as te3t' according to the specified row and column numbers. ;ptionally' whether the address is interpreted as an absolute address $for e3ample' g)g1& or as a relati(e address $as )1& or in a mi3ed form $)g1 or g)1& can be determined. The name of the sheet can also be specified. row $re?uired& is the row number for the cell reference. column $re?uired& is the column number for the cell reference $the number' not the letter&. A7+ $optional& determines the type of reference and is a (alue between 1 and <. ,ee the /elp files for e3planation of list numbers. ;ptional A1 if set to 0 uses the H1C1 notation' else it uses the )1 notation. ;ptional sheet is the name of the sheet entered in double ?uotes. Cf using H1C1 notation' )55HD,, returns address strings using the e3clamation mar- >l> as the sheet name separator. The function still uses the dot >.> sheet name separator with )1 notation. 0hen opening documents from ;52 1.0/1.1 format' the )55HD,, functions that show a sheet name as the fourth parameter will shift that sheet name to become the fifth parameter. ) new fourth parameter with the (alue 1 will be inserted. 0hen sa(ing a document in ;52 1.0/1.1 format' if the )55HD,, function has a fourth parameter' that parameter will be remo(ed. ) spreadsheet should not be sa(ed in the old ;52 1.0/1.1 format if A1 is set to 0.

)HD),$reference&

Heturns the number of indi(idual ranges that belong to a multiple range. ) range can consist of contiguous cells or a single cell. reference is a reference list of the ranges. The function e3pects a single argument. 1ultiple ranges can be entered using the tilde $k& $!nion& operator or a semicolon $N& as the di(ider' but the semicolon gets automatically con(erted to the tilde operator after the function is entered into the spreadsheet. Cf you state multiple ranges and you use the semicolon separator' you must enclose them in additional parentheses. The tilde is the union range operator. ,ee Chapter E for range operators. 1ultiple ranges can be entered into the reference input bo3 in two ways. 2irstly they can be be typed directly into the argument>s input bo3' noting the parentheses constraint mentioned abo(e for the semicolon. ,econdly' by clic-ing the +hrink button to the right of the input bo3 and then clic-ing and dragging in the sheet to select cell ranges. )dd the range operator between selections. ote the parentheses constraint abo(e for use of the semicolon. 4ug E122A concerning problems inputting data.

"#"

LibreOffice ".# $alc Guide

!$ntax
C/;;,D$Cnde3' (alue1' p' (alue30&

*escription
Heturns a (alue from a list of up to 30 (alues. nde. is a reference or number between 1 and 30 indicating which (alue is to be ta-en from the list. value1$ J$ value'1 is the list of (alues entered as any number type' reference' or formula e3pression. ;nly the selected (alue from the list is e(aluated' any other formulas in the list are not chec-ed for (alidity. Heturns the column number of a reference. Cf the reference is a single cell' the column number of the cell is returnedN if the parameter is a cell range containing more than one column' the corresponding column numbers are returned in a single+row array' if the formula is entered as an array formula. Cf the cell range is not entered as an array formula' only the column number of the first cell within the range is determined. Cf no reference is entered' the column number of the cell in which the formula is entered is returned as Calc automatically sets the reference to the current cell. Heturns the number of columns in the gi(en reference. array is the reference to a cell range whose total number of columns is to be found. The argument can also be a single cell. 5ynamic 5ata D3change. Heturns the result of a 55D re?uest. Cf the contents of the lin-ed range or section changes' the returned (alue will also change. The spreadsheet can be reloaded' or #dit < 2inks selected' to see the updated lin-s. Cross+platform lin-s' for e3ample from an #ibre;ffice installation running on a 0indows machine to a document created on a #inu3 machine' are not supported. server is the name of a ser(er application. #ibre;ffice applications ha(e the ser(er name K,officeL. File is the complete file name' including path. range is the area containing the data to be e(aluated. mode is an optional parameter that controls the method by which the 55D ser(er con(erts its data into numbers. ,ee the /elp files for information on choices. )n earlier bug that caused this function to crash #ibre;ffice has been fi3ed in (<.1.< and later releases.

C;#!1 $reference&

C;#!1 ,$array&

55D$ser(er' 2ile' range' mode&

DHH;HTY"D$reference&

D(aluates the cell (alue at reference location. Cf the cell contains an error then a logical or numerical (alue is returned else it returns h /). The numerical (alue is the error number $see /elp for full listing&. 2or a cell containing the h /) error' a (alue of 32E@E is returned.

,ppendi* B Description of 'unctions

"#%

!$ntax
GDT"CB;T5)T)$5ata 2ield' "i(ot Table' 2ield ame/Ctem1' 2ield ame/Ctem2' p' 2ield ame/Ctem30& This is the synta3 used in the 2unction 0iFard.

*escription
The GDT"CB;T5)T) function returns a calculated result (alue from a pi(ot table. The (alue is addressed using field and item names' so it remains (alid if the layout of the pi(ot table changes. Two different synta3 definitions can be used% the synta3 shown on the left and GDT"CB;T5)T)$"i(ot Table' Constraints& 2or synta3 1' %ata Field is a string that selects one of the pi(ot table>s data fields. The string can be the name of the source column' or the data field name as shown in the table $li-e U,um X ,alesU&. Pivot ,able is a reference to a cell or cell range that is positioned within a pi(ot table or contains a pi(ot table. Cf the cell range contains se(eral pi(ot tables' the table that was created last is used. Cf no Field ?ame H temO pairs are gi(en' the grand total is returned. ;therwise' each pair adds a constraint that the result must satisfy. Field ?ame is the name of a field from the pi(ot table. temO is the name of an item from that field. ) ma3imum of 30 Field ?ameH temO pairs can be entered. The second synta3 is assumed if e3actly two parameters are gi(en' Pivot ,able has the same meaning as in the first synta3. Constraints is a space+separated list. Dntries can be ?uoted $single ?uotes&. The whole string must be enclosed in ?uotes $double ?uotes&' unless you reference the string from another cell. ,ee the /elp file for detailed information. Cn some (ersions of #ibre;ffice' the second synta3 (ariation returns a hHD2 error. ,ee 4ug E123<.

/#;;6!"$searchPcriteria' array' Cnde3' sorted&

,earches for a (alue gi(en in searchQcriteria in the first row of the gi(en array' and returns the (alue from the row gi(en in nde. for the column in which the search item was found. Cf sorted is 0 or 2)#,D the first row of array need not be sorted' else the first row of array must be sorted in alpha+numerical and logical order. The search supports regular e3pressions. 0hen the te3t in a cell that contains the /Y"DH#C 6 function is Ctrl+clic-ed $the cursor becomes a pointing hand when correctly positioned&' the hyperlin- opens. *32 specifies the lin- target. The optional Cell,e.t argument is the te3t displayed in the cell. Cf either argument is a te3t string' it must be entered in double ?uotes. Cf the Cell,e.t parameter is not specified' the *32 te3t is displayed.

/Y"DH#C 6$!H#' CellTe3t&

"#&

LibreOffice ".# $alc Guide

!$ntax
C 5DQ$reference' row' column' range&

*escription
Gi(en a reference' returns the (alue at the gi(en row and column intersection $starting numbering at 1' relati(e to the top left of the reference& of the gi(en area range. Cf range is not gi(en' it is assumed to be 1 $the first and possibly only area&. Cf row is omitted or empty or 0' an entire column of the gi(en area range in reference is returned. Cf column is omitted or empty or 0' an entire row of the gi(en area range in reference is returned. Cf both' row and column' are omitted or empty or 0' the entire gi(en area range is returned. Cf reference is a one+dimensional column (ector' column is optional or can be omitted. Cf reference is a one+ dimensional row (ector' row is optional' which effecti(ely ma-es row act as the column offset into the (ector' or can be omitted. Cf row or column ha(e a (alue greater than the dimension of the corresponding gi(en area range' an Drror is returned. The Array chec-bo3 must be selected in this function unless row and column are both included. 4ug E132A% Heturns hB)#!D error when optional arguments are omitted.

C 5CHDCT$ref' )1&

Heturns a reference gi(en a string representation of a reference as ref. This function can also be used to return the area of a corresponding string. ref is a reference to a cell or an area $in te3t form& from which to return the contents. !nless ref refers to a cell containing a reference' ref must be entered in double ?uotes. A1 $optional& + if set to 0' the H1C1 notation is used. Cf this parameter is absent or set to another (alue than 0' the )1 notation is used. Heturns the contents of a cell either from a one+row or one+ column range or from an array. ;ptionally' the assigned (alue $of the same inde3& is returned in a different column and row. )s opposed to B#;;6!" and /#;;6!"' search and result (ectors may be at different positionsN they do not ha(e to be adGacent. )dditionally' the search (ector for the #;;6!" must be sorted ascending' otherwise the search will not return any usable results. The search supports regular e3pressions. +earch criterion is the (alue to be searched forN entered either directly or as a reference. +earch vector is the single+row or single+column area to be searched. resultQvector is another single+row or single+ column range from which the result of the function is ta-en. The result is the cell of the result (ector with the same inde3 as the instance found in the search (ector. 0hen gi(en two parameters' +earch vector is first e3amined% Cf +earch vector is s?uare or is taller than it is wide $more rows than columns&' #;;6!" searches in the first column $similar to B#;;6!"&' and returns the corresponding (alue in the last column. Cf +earch vector co(ers an area that is wider than it is tall $more columns

#;;6!"$,earch criterion' ,earch (ector' resultP(ector&

,ppendi* B Description of 'unctions

"#A

!$ntax

*escription
than rows&' #;;6!" searches in the first row $similar to /#;;6!"&' and returns the corresponding (alue in the last row. 4ug E1A*:% This fails if an alphabetic character is used for the search criterion.

1)TC/$,earch criterion' loo-upParray' Type&

Heturns the relati(e position of an item in an array that matches a specified (alue. The function returns the position of the (alue found in lookupQarray as a number. +earch criterion is the (alue which is to be searched for. lookupQarray is the (ector to be searched. ) loo-up array can be a single row or column' or part of a single row or column. ,ype may ta-e the (alues 1' 0' X1 or be omitted. Cf ,ype is (alue 1 or omitted' lookupQarray must be sorted ascending and the function finds the largest (alue that is less than or e?ual to +earch criterion. Cf ,ype is of (alue 0 the function finds the largest (alue that is less than or e?ual to +earch criterion. Balues in lookupQarray do not need to be sorted. Cf ,ype is of (alue +1' the function returns the smallest (alue that is greater than or e?ual to +earch criterion in a lookupQarray where (alues are sorted in descending order. The search supports regular e3pressions.

;22,DT$reference' rows' columns' height' width&

Heturns the (alue of a cell offset by a certain number of rows and columns from a gi(en reference point. reference is the cell from which the function searches for the new reference. rows is the number of cells by which the reference was corrected up $negati(e (alue& or down. columns is the number of columns by which the reference was corrected to the left $negati(e (alue& or to the right. height is the optional (ertical height for an area that starts at the new reference position. width is the optional horiFontal width for an area that starts at the new reference position. Heturns the row number of a cell reference. Cf the reference is a cell' it returns the row number of the cell. Cf the reference is a cell range' it returns the corresponding row numbers in a one+column array if the formula is entered as an array formula. Cf the H;0 function with a range reference is not used in an array formula' only the row number of the first range cell will be returned. reference is a cell' an area' or the name of an area. Cf a reference is not indicated' Calc automatically sets the reference to the current cell. Heturns the number of rows in a reference or array. array is the reference or named area whose total number of rows is to be determined. Heturns the sheet number of a reference or a string representing a sheet name. Cf no parameters are entered' the result is the sheet number of the spreadsheet containing the formula. reference $optional& is the reference to a cell' an area' or a sheet name string.

H;0$reference&

H;0,$array&

,/DDT$reference&

"#-

LibreOffice ".# $alc Guide

!$ntax
,/DDT,$reference&

*escription
5etermines the number of sheets in a reference. Cf no parameters are entered' the result is the number of sheets in the current document. reference $optional& is the reference to a sheet or an area. )pplies a style +tyle to the cell containing the formula for a length of time ,ime' after which the final style +tyle" is applied. ,tyles are listed $and may be created& in the Format < +tyles and Formatting $F11& menu and are te3t entries entered in double ?uotes. The initial style is applied for ,ime seconds after the cell itself is recalculated. "lease note that a manual recalculation $F0 -ey or ,ools < Cell Contents < 3ecalculate& will not trigger the initial style. ,ime and +tyle" may together be omittedN +tyle is then applied permanently. This function always returns the (alue 0' allowing it to be added to another function without changing the (alue.

,TY#D$,tyle' Time' ,tyle2&

B#;;6!"$,earch criterion' array' Cnde3' sort order&

,earches the first column of an array for the (alue gi(en by +earch criterion and if found returns the cell (alue at the intersection of the row in which it is found and the column inde3 gi(en by nde.. The search supports regular e3pressions. +earch criterion is the (alue searched for in the first column of the array. Cf te3t' it must be entered in double ?uotes. array is the reference' which must include at least two columns. nde. is the number of the column in the array that contains the (alue to be returned. The first column has the number 1. Cf the sort order parameter is omitted or set to TH!D or not 0' it is assumed that the data is sorted in ascending order. Cf the e3act +earch criterion is not found' the last (alue that is smaller than the criterion will be returned. Cf the sort order parameter is set to 2)#,D or Fero' an e3act match must be found' otherwise the error Drror% Balue ot )(ailable will be the result. Thus with a (alue of Fero the data does not need to be sorted in ascending order.

,e.t functions
!se Calcs te3t functions to search and manipulate te3t strings or character codes. (able "A: (e*t functions !$ntax
)H)4CC$Te3t&

*escription
Calculates the (alue of a Homan numeral. The (alue range must be between 0 and 3::: $K111C1L&. ,e.t is the te3t that represents a Homan numeral. Ct is not case sensiti(e and is entered in double ?uotes. The ),C function con(erts full+width to half+width ),CCC and -ata-ana characters. Heturns a te3t string. te.t is the te3t that contains characters to be con(erted.

),C$te3t&

,ppendi* B Description of 'unctions

"#.

!$ntax
4)/TTDQT$ umber&

*escription
Con(erts a number to Thai te3t' including the Thai currency names. ?umber is any number. U4ahtU is appended to the integral part of the number' and U,atangU is appended to the decimal part of the number. Con(erts a positi(e integer to a specified base then into te3t using the characters from the baseIs numbering system $decimal' binary' he3adecimal' etc.&. ;nly the digits 0+: and the letters )+T are used. number is the positi(e integer to be con(erted. radi. is the base of the number system. Ct may be any positi(e integer between 2 and 3@. 4inimum length $optional& is the minimum length of the character se?uence that has been created. Cf the te3t is shorter than the indicated minimum length' Feros are added to the left of the string. Con(erts a number into a character according to the current code table. The number can be a two+digit or three+digit integer number. number is a number between 1 and 2AA representing the code (alue for the character. Hemo(es all non+printing characters from the string entered into te.t. Te3t is entered using double ?uotes. Heturns a numeric code for the first character in a te3t string. te.t is the te3t for which the code of the first character is to be found and is entered in double ?uotes. Combines se(eral te3t strings into one string. te.t 1$ te.t "$ J$ te.t '1 are te3t passages that are to be combined into one string. Con(erts te3t with characters from a number system to a positi(e integer in the decimal system. The radi3 (alue defines the number system to which the te3t belongs. )ny characters not in the number system defined are ignored. te.t is the te3t to be con(erted and must be entered using double ?uotes. The te.t field is not case+sensiti(e. radi. is the base of the number system from which the con(ersion is to ta-e place. Ct may be any positi(e integer between 2 and 3@. Con(erts a number to te3t in the locale currency format' rounded to a specified decimal place. value is the number to be con(ertedN it can be a number' a reference to a cell containing a number' or a formula which returns a number. decimals $optional& is the number of decimal places to be used. Cf no decimals (alue is specified' all numbers in currency format will be displayed with two decimal places. The currency format is set in the system settings. Compares two te3t strings and returns TH!D if they are identical. This function is case+sensiti(e. te.tQ1 is the first te3t to compare. te.tQ" is the second te3t to compare. 4oth arguments if entered directly must be in double ?uotes.

4),D$number' radi3' 1inimum length&

C/)H$number&

C#D) $te3t& C;5D$te3t&

C; C)TD )TD$te3t 1' te3t 2' p' te3t 30& 5DCC1)#$te3t' radi3&

5;##)H$(alue' decimals&

DQ)CT$te3tP1' te3tP2&

"98

LibreOffice ".# $alc Guide

!$ntax
2C 5$findPte3t' te3t' position&

*escription
#oo-s for a string of te3t within another string and returns the position in the searched te3t where the searched+for te3t begins. 0here to begin the search can also be defined. The search term can be a number or any string of characters. The search is case+sensiti(e. findQte.t is the te3t to be found. te.t is the te3t which is being searched. position $optional& is the position in the te3t from which the search starts. Te3t must be entered in double ?uotes. Heturns a number' displayed as te3t' with a fi3ed number of decimal places and with or without a thousands separator. This function can be used to apply a uniform format to a column of numbers. number is the number to be formatted. %ecimals is the number of decimal places to be displayed. Cf %ecimals is negati(e' the number is rounded to )4,$number& %ecimals places to the left from the decimal point. ?o thousands separator $optional& determines whether the thousands separator is used or not. Cf the parameter is e?ual to 0 or omitted' the thousands separators of the current locale setting are displayed' else the separators are suppressed. The .C, function con(erts half+width to full+width ),CCC and -ata-ana characters. Heturns a te3t string. te.t is the te3t that contains characters to be con(erted. This is the complementary function to ),C. Heturns the number of characters from the left of a te3t string te.t determined by number. Cf this parameter is omitted' one character is returned. Cf number is greater than the length of the string' the whole string is returned. Heturns the length of a string including spaces. te.t is the te3t whose length is to be determined. Con(erts all uppercase letters in a te3t string to lowercase. te.t is the te3t to be con(erted. Heturns a te3t segment of a character string. The parameters specify the starting position and the number of characters to return. te.t is the te3t containing the characters from which to e3tract. start is the position mar-ing the beginning of the te3t to e3tract. number is the number of characters from that point on to be returned. Cf number is greater than #D $te3t& minus start' then the te3t from start to the end of te.t is returned. Con(ert te3t to number' in a locale+independent way. Con(erts gi(en te3t (alue te.t into a number. Cf te.t is a reference' it is first dereferenced. decimalQseparator and groupQseparator are optional parameters. Cf te.t contains a separator' then that separator must be entered into the rele(ant optional parameter. )ll parameters are entered in double ?uotes. Te3t is transformed according to the following rules% 1& ,tarting from the beginning' remo(e all occurrences of the groupQseparator before any decimalQseparator. 2& ,tarting from the beginning' replace the first occurrence in the te3t of the decimalQseparator character with the 2!## ,T;" $!R002D& character.

2CQD5$number' 5ecimals' o thousands separator&

.C,$te3t&

#D2T$te3t' number&

#D $te3t& #;0DH$te3t& 1C5$te3t' start' number&

!14DHB)#!D$te3t' decimalPseparator' groupPseparator&

,ppendi* B Description of 'unctions

"9#

!$ntax

*escription
3& Hemo(e all whitespace characters $A.1<&. <& Cf the first character of the resulting string is a period 2!## ,T;" $!R002D& then prepend a Fero. A& Cf the string ends in one or more instances of "DHCD T ,CG $!R002A&' remo(e the percent sign$s&. Cf percent signs were remo(ed in step A' di(ide the (alue of the returned number by 100 for each percent sign remo(ed.

"H;"DH$te3t& HD"#)CD$Te3t' position' length' new te3t&

CapitaliFes the first letter in all words of a te3t string. te.t is the te3t to be con(erted. Heplaces part of a te3t string with a different te3t string. This function can be used to replace both characters and numbers $which are automatically con(erted to te3t&. The result of the function is always displayed as te3t. To perform further calculations with a number which has been replaced by te3t' con(ert it bac- to a number using the B)#!D function. )ny te3t containing numbers must be enclosed in ?uotation mar-s so it is not interpreted as a number and automatically con(erted to te3t. ,e.t is te3t' a part of which will be replaced. position is the position within the te3t where the replacement will begin. length is the number of characters in te.t to be replaced. new te.t is the te3t which replaces te.t.. Hepeats a character string by the gi(en number of copies. te.t is the te3t to be repeated. number is the number of repetitions. The result can be a ma3imum of 2AA characters. Heturns the right+most number of characters of a te.t string. Cf optional number is omitted' 1 is assumed and the right+most character is returned. Cf number is greater than the length of te.t' the whole te3t is returned. Con(erts a number into a Homan numeral. The (alue range must be between 0 and 3:::N the modes can be integers from 0 to <. ?umber is the number that is to be con(erted into a Homan numeral. 4ode $optional& indicates the degree of simplification. The higher the (alue' the greater is the simplification of the Homan numeral. Dncrypts a character string by mo(ing the characters 13 positions in the alphabet. )fter the letter T' the alphabet begins again $Hotation&. Dntering te3t encrypted by this method' into the function decrypts the te3t. ,e.t is the character string to be encrypted/decrypted. Heturns the start position of a te3t string within a larger string. The start position for the search can be set as an option. The search te3t can be a number or any se?uence of characters. The search is not case+sensiti(e. The search supports regular e3pressions. findQte.t is the te3t to be searched for. te.t is the te3t where the search will ta-e place. position $optional& is the position in the te3t where the search is to start.

HD"T$te3t' number&

HCG/T$te3t' number&

H;1) $ umber' 1ode&

H;T13$Te3t&

,D)HC/$findPte3t' te3t' position&

"99

LibreOffice ".# $alc Guide

!$ntax
,!4,TCT!TD$te3t' searchPte3t' new te3t' occurrence&

*escription
,ubstitutes new te3t for old te3t in a string. te.t is the te3t in which te3t segments are to be e3changed. searchQte.t is the te3t segment that is to be replaced $a number of times&. new te.t is the te3t that is to replace the te3t segment. occurrence $optional& indicates how many occurrences of the search te3t are to be replaced. Cf this parameter is missing' the search te3t is replaced throughout. Heturns value if te3t' else returns a blan- te3t string. value is the (alue to be e(aluated. ) reference can be used as a parameter. Cf the dereferenced (alue is not of type te3t' the result will be an empty string. Con(erts a number into te3t according to a gi(en format. number is the numerical (alue to be con(erted. Format is the te3t which defines the format and can be found on the @umbers tab in the 'ormat $ells dialog. !se decimal and thousands separators according to the language set in the cell format. Heturns a te3t string from which leading and trailing spaces ha(e been remo(ed' and replaces all internal multiple spaces with a single space. te.t is the te3t from which spaces are to be remo(ed. Heturns the character represented by the gi(en number according to the V! CC;5DW ,tandard. number is a decimal integer (alue between 0 and 111<111. Heturns the V! CC;5DW code point corresponding to the first character of the te3t (alue. te.t is a string from which the code number is returned. Con(erts the string specified in the te.t parameter to uppercase characters. Con(erts a te3t string into a number. te.t is the te3t to be con(erted to a number.

T$(alue&

TDQT$number' 2ormat&

THC1$te3t&

! CC/)H$number&

! CC;5D$te3t&

!""DH$te3t& B)#!D$te3t&

Add/in functions
(able "-: ,dd!in functions !$ntax
4D,,D#C$Q' &

*escription
Calculates the modified 4essel function Cn$3&. O is the (alue on which the function will be calculated. ? is the order of the 4essel function. Calculates the 4essel function .n$3& $cylinder function&. O is the (alue on which the function will be calculated. ? is the order of the 4essel function. Calculates the modified 4essel function 6n$3&. O is the (alue on which the function will be calculated. ? is the order of the 4essel function.

4D,,D#.$Q' &

4D,,D#6$Q' &

,ppendi* B Description of 'unctions

"93

!$ntax
4D,,D#Y$Q' &

*escription
Calculates the modified 4essel function Yn$3&' also -nown as the 0eber or eumann function. O is the (alue on which the function will be calculated. ? is the order of the 4essel function. Heturns the decimal number for the binary number entered. ?umber is the binary (alue entered as a number or as te3t. Heturns a string representing the he3adecimal number for the binary number entered. ?umber is the binary (alue entered as a number or te3t. Places $optional& is the number of places to be output. Heturns the octal number for the binary number entered. ?umber is the binary (alue entered as a number or te3t.. Places is the number of places to be output. Heturns a comple3 number from a real coefficient and an imaginary coefficient. 3eal num is the real coefficient of the comple3 number. num is the imaginary coefficient of the comple3 number. +uffi. is optional' and may be UiL or UGL. Cf omitted KiL is assumed. +uffi. must be lowercase. Con(erts a (alue from one unit of measure to the corresponding (alue in another unit of measure. ?umber is the (alue to be con(erted. From unit is the unit from which con(ersion is ta-ing place. ,o unit is the unit to which con(ersion is ta-ing place. ) list of abbre(iations for units can be found in the /elp files. 5o not enter the full+stop. Heturns the binary number for the decimal number entered between XA12 and A11. ?umber is the decimal number. Places is the number of places to be output. Heturns the he3adecimal number for the decimal number entered. ?umber is the decimal number. Places is the number of places to be output. Heturns the octal number for the decimal number entered. ?umber is the decimal number. Places is the number of places to be output. Heturns TH!D $1& if both numbers are e?ual' otherwise returns 2)#,D $0&. ?umber " is optional and assumes a (alue of 0 if omitted. Calculates the error function. 2ower limit is the lower limit of integral. *pper limit $optional& is the upper limit of the integral. Cf this (alue is missing' the calculation ta-es places between 0 and the lower limit. Calculates the complementary error function between 3 and infinity. 2ower limit is the lower limit of integral $3&. Heturns the factorial of ?umber with increments of 2. Cf ?umber is e(en' the following factorial is calculated% nZ$ + 2&Z$n+<&Z...Z<Z2. Cf ?umber is odd' the following factorial is calculated% nZ$ +2&Z$n+<&Z...Z3Z1. Heturns 1 if ?umber is greater than or e?ual to +tep.

4C 25DC$ umber& 4C 2/DQ$ umber' "laces&

4C 2;CT$ umber' "laces&

C;1"#DQ$Heal num' C num' ,uffi3&

C; BDHTP)55$ umber' 2rom unit' To unit&

5DC24C $ umber' "laces&

5DC2/DQ$ umber' "laces&

5DC2;CT$ umber' "laces&

5D#T)$ umber 1' umber 2&

DH2$#ower limit' !pper limit&

DH2C$#ower limit& 2)CT5;!4#D$ umber&

GD,TD"$ umber' ,tep&

"9"

LibreOffice ".# $alc Guide

!$ntax
/DQ24C $ umber' "laces&

*escription
Heturns the binary number for the he3adecimal number entered. ?umber is the he3adecimal number. Places is the number of places to be output. Heturns the decimal number for the he3adecimal number entered. ?umber is the he3adecimal number. Heturns the octal number for the he3adecimal number entered. ?umber is the he3adecimal number. Places is the number of places to be output. Heturns the absolute (alue $modulus& of the entered Comple. number. The comple3 number is entered in the form U3 R yiU or U3 R yGU. Heturns the imaginary coefficient of the entered Comple. number. The comple3 number is entered in the form U3 R yiU or U3 R yGU. Heturns the argument $the phi angle& of the entered Comple. number. The comple3 number is entered in the form U3 R yiU or U3 R yGU. Heturns the conGugated comple3 complement to the entered Comple. number. The comple3 number is entered in the form U3 R yiU or U3 R yGU. Heturns the cosine of the entered Comple. number. The comple3 number is entered in the form U3 R yiU or U3 R yGU. Heturns the hyperbolic cosine of the entered Comple. number. The comple3 number is entered in the form U3 R yiU or U3 R yGU. Heturns the cotangent of the entered Comple. number. The comple3 number is entered in the form U3 R yiU or U3 R yGU. Heturns the cosecant of the entered Comple. number. The comple3 number is entered in the form U3 R yiU or U3 R yGU. Heturns the hyperbolic cosecant of the entered Comple. number. The comple3 number is entered in the form U3 R yiU or U3 R yGU. Heturns the di(ision of two comple3 numbers. ?umerator and %enominator are entered in the form U3 R yiU or U3 R yGU. Heturns the power of e $the Dulerian number& and the comple3 number. Comple. number is entered in the form U3 R yiU or U3 R yGU. Heturns the natural logarithm of the entered Comple. number. The comple3 number is entered in the form U3 R yiU or U3 R yGL. Heturns the common logarithm of the entered Comple. number. The comple3 number is entered in the form U3 R yiU or U3 R yGU.

/DQ25DC$ umber& /DQ2;CT$ umber' "laces&

C1)4,$Comple3 number&

C1)GC )HY$Comple3 number&

C1)HG!1D T$Comple3 number&

C1C; .!G)TD$Comple3 number&

C1C;,$Comple3 number& C1C;,/$Comple3 number&

C1C;T$Comple3 number&

C1C,C$Comple3 number& C1C,C/$Comple3 number&

C15CB$ umerator' 5enominator&

C1DQ"$Comple3 number&

C1# $Comple3 number&

C1#;G10$Comple3 number&

,ppendi* B Description of 'unctions

"9%

!$ntax
C1#;G2$Comple3 number&

*escription
Heturns the binary logarithm of the entered Comple. number. The comple3 number is entered in the form U3 R yiU or U3 R yGU. Heturns the entered Comple. number raised to the power ?umber. The comple3 number is entered in the form U3 R yiU or U3 R yGU. Heturns the product of the entered Comple. number with up to 30 other Comple. numbers. The comple3 numbers are entered in the form U3 R yiU or U3 R yGU. Heturns the real coefficient of the entered Comple. number. The comple3 number is entered in the form U3 R yiU or U3 R yGU. Heturns the sine of the entered Comple. number. The comple3 number is entered in the form U3 R yiU or U3 R yGU. Heturns the hyperbolic sine of the entered Comple. number. The comple3 number is entered in the form U3 R yiU or U3 R yGU. Heturns the s?uare root of the entered Comple. number. The comple3 numbers are entered in the form U3 R yiU or U3 R yGU. Heturns the difference of two comple3 numbers. The comple3 numbers are entered in the form U3 R yiU or U3 R yGU. Heturns the sum of the entered Comple. number with up to 30 other comple3 numbers. The comple3Pnumbers are entered in the form U3 R yiU or U3 R yGU. Heturns the tangent of the entered Comple. number. The comple3 number is entered in the form U3 R yiU or U3 R yGU. Heturns the binary number for the octal (alue entered. ?umber is the octal number. Places is the number of places to be output. ?umber may be entered as te3t or a number. Heturns the decimal number for the octal (alue entered. ?umber is the octal number. ?umber may be entered as te3t or a number. Heturns the he3adecimal number for the octal (alue entered. ?umber is the octal number. Places is the number of places to be output. ?umber may be entered as te3t or a number.

C1";0DH$Comple3 number' umber& C1"H;5!CT$Comple3 number' Comple3 number1' p' Comple3 number30& C1HD)#$Comple3 number&

C1,C $Comple3 number& C1,C /$Comple3 number&

C1,JHT$Comple3 number&

C1,!4$Comple3 number 1' Comple3 number 2& C1,!1$Comple3 number' Comple3 number 1' p' Comple3 number30& C1T) $Comple3 number& ;CT24C $ umber' "laces&

;CT25DC$ umber&

;CT2/DQ$ umber' "laces&

"9&

LibreOffice ".# $alc Guide

,ppendi* $ $alc )rror $odes

ntroduction to Calc error codes


Calc pro(ides feedbac- for errors of miscalculation' incorrect use of functions' in(alid cell references and (alues' and other user initiated mista-es. The feedbac- may be displayed within the cell that contains the error $2igure 33@& or on the status bar $2igure 33E& or in both' depending on the type of error. Generally spea-ing' if the error occurs in the cell that is selected $or contains the cursor&' the error message is displayed on the status bar. )s an e3ample' 2igure 33@ shows the error code returned when a column is too narrow to display the entire formatted date. The date displayed within the input line' 0</0A/1::*' would fit within the cell without a problem' but the format used by the cell produces the date (alue Sunda2= ,pril 8%= #..-.

'igure 33&: )rror codes displa2ed within cells 0hen the cell displaying the X3#F error code in 2igure 33@ is selected' the status bar displays the error message as shown in 2igure 33E. This message is more descripti(e than the message displayed in the cell' but it still may not pro(ide enough information to correctly diagnose the problem. 2or fuller e3planations' consult the following tables and the /elp topic' )rror $odes in LibreOffice $alc.

'igure 33A: ,n error message displa2ed in the status bar This appendi3 presents error codes in two tables. This first table e3plains error messages which are displayed within the cell that actually contains the error. D3cept in the case of the XXX error' they all correspond to a Calc error code number. The second table e3plains all of the error codes' listed by code number' including those errors codes in the first table.

"9-

LibreOffice ".# $alc Guide

#rror codes displayed within cells


Cell error
hhh

Code
/)

Explanation of t"e error


The column is too narrow to display the complete formatted contents of the cell. This is not really an error (alue' so there is no corresponding numerical error code. The solutions to this problem are to increase the width of the column. or select Format < Cells < Alignment and clic- either <rap te*t automatically or Shrin4 to fit cell si1e to ma-e the te3t match the current column width. 2unction argument is not (alid' or more than one matching cell is found by the 5GDT function. ) calculation resulted in an o(erflow of the defined (alue range. The formula within the cell returns a (alue that does not correspond to the definition of the formula or functions used. This error could also mean that the cell referenced by the formula contains te3t instead of a number. The formula within the cell uses a reference that does not e3ist. Dither a column or row description name could not be resol(ed' or the column' row' or sheet that contains a referenced cell is missing. )n identifier could not be e(aluated% no (alid reference' no (alid domain name' no column/row label' no macro' incorrect decimal di(ider' add+in not found. 2or e3ample' entering in a cell Ysum$bobZA& where there is no cell named KbobL or containing the te3t KbobL generates this error. 5i(ision operator / if the denominator is 0. ,ome more functions return this errorN see ne3t table for details.

DrrA02 h !1l hB)#!D

A02 A03 A1:

hHD2l

A2<

h )1D=

A2A

h5CB/0l

A32

,ppendi* $ $alc )rror $odes

"9.

(eneral error codes


The following table is an o(er(iew of the most common error messages for #ibre;ffice Calc.
Drrors described as 0nternal errors should not be encountered by users under normal conditions. Drrors listed as @ot used are not currently assigned to any error condition and will not occur.

?ote

Code
A01

Messa%e
Cn(alid character

Explanation of t"e error


Character in a formula is not (alid. This error is the same as the 0nvalid @ame error $A2A& e3cept that it occurs within a formula. The cell containing the error will display the h )1D= error reference. 2unction argument is not (alidN for e3ample' a negati(e number for the root function. This error also occurs if more than one matching cell is found by the 5GDT function. 5i(ision by 0' or another calculation that results in an o(erflow of the defined (alue range $a (alue too big or too small&. 2unction parameter is not (alidN for e3ample' te3t instead of a number' or a domain reference instead of a cell reference. ot used. ot used. ot used. 1issing brac-et or parenthesisN for e3ample' closing brac-ets but no opening brac-ets. ;perator is missingN for e3ample' "=2(3+4) * "' where the operator between U2U and U$U is missing. Bariable is missingN for e3ample' when two operators are together UY1RZ2U. 2unction re?uires more (ariables than are pro(idedN for e3ample' ) 5$& and ;H$&. The total number of internal to-ens $that is' operators' (ariables' brac-ets& in the formula e3ceeds A12' or the total number of matrices the formula creates e3ceeds 1A0. This includes basic functions that recei(e too large an array as a parameter. )n identifier in the formula e3ceeds @< 64 in siFe' or a result of a string operation e3ceeds @< 64 in siFe. ,ort operation attempted on too much numerical data $ma3. 100000& or a calculation stac- o(erflow.

A02

Cn(alid argument

A03

Cn(alid floating point operation $cell displays X?*4[& "arameter list error Cnternal synta3 error Cn(alid semicolon "air missing "air missing 1issing operator

A0< A0A A0@ A0E A0* A0:

A10 A11 A12

1issing (ariable 1issing (ariable 2ormula o(erflow

A13 A1<

,tring o(erflow Cnternal o(erflow

"38

LibreOffice ".# $alc Guide

Code
A1A A1@ A1E

Messa%e
Cnternal synta3 error Cnternal synta3 error Cnternal synta3 error

Explanation of t"e error


ot used. 1atri3 is e3pected on the calculation stac-' but is not a(ailable. !n-nown errorN for e3ample' a document with a newer function is loaded in an older (ersion of Calc that does not contain the function. Bariable is not a(ailable. 2ormula yields a (alue that does not correspond to the definition' or a cell that is referenced in the formula contains te3t instead of a number. Compiler creates an un-nown compiler code. o result. 2ormula refers directly or indirectly to itself and the terations option is not selected under ,ools < =ptions < 2ibre=ffice Calc < Calculate. 2inancial statistics function missed a targeted (alue' or iterations of circular references do not reach the minimum change within the ma3imum steps that are set. ) column or row description name could not be resol(ed' or the column' row' or sheet that contains a referenced cell is missing. )n identifier could not be e(aluatedN for e3ample' no (alid reference' no (alid domain name' no column/row label' no macro' incorrect decimal di(ider' add+in not found. ;bsolete' no longer used' but could come from old documents if the result is a formula from a domain. Heferences' such as when a cell references a cell' are too encapsulated or deeply nested. This is an internal error and should not be displayed in #ibre;ffice. ot used. 5i(ision operator / if the denominator is 0. ,ome more functions return this errorN for e3ample% B)H" with less than 1 argument ,T5DB" with less than 1 argument B)H with less than 2 arguments ,T5DB with less than 2 arguments ,T) 5)H5CTD with stde(Y0 ;H15C,T with stde(Y0

A1* A1:

Cnternal synta3 error o result $cell displays X>A2*#& Cnternal synta3 error Cnternal synta3 error Circular reference

A20 A21 A22

A23

The calculation procedure does not con(erge Cn(alid references $cell displays X3#F[& Cn(alid names $cell displays X?A4#9& Cnternal synta3 error Cnternal o(erflow

A2<

A2A

A2@ A2E

A2*X A31 A32

c 5i(ision by Fero

,ppendi* $ $alc )rror $odes

"3#

nde.
'
35 chart appearance :* area chart 112 bar chart 10: illumination :: line chart 113 pie chart 110 rotation and perspecti(e :* rotation' interacti(e :* calculation order 1:A calculations lin-ing sheets 1:A cell styles applying 123 description 122 2ill 2ormat mode 12< cells description 1@' 1: information on status bar 21 range 2* selecting 2* (alidating contents A0 changes accepting or reGecting 2:3 adding comments 2:0 editing comments 2:1 options 3AE recording 2*: re(iewing 2:3 (iewing 2:3 chart appearance of 35 :* area bac-ground :@ colors :E creating *2 data labels :0 editing *E formatting :A formatting 35 :E graphic bac-ground :@ grids *@ illumination of 35 :: interacti(e 35 rotation :* mean (alue lines :3 mo(ing elements :@ perspecti(e :* "osition and ,iFe dialog 10@ resiFing 10A rotation :* titles *@ trend lines :2 types 10* Q or Y error bars :3 chart elements ** chart type *<' *E Chart 0iFard *2 collaboration 2*@ color coding for input 20* color options 3<1 Color toolbar 1A1 column and line charts 11: column charts 10* columns deleting 31 inserting 31
LibreOffice ".# $alc Guide

A
absolute reference 1:3 ad(anced functions 21@ anchor' (isible 3A2 anchoring of obGects 1A: appearance of 35 chart :* appearance options 3<< )pply ,tyle list 12< area charts 111 arguments 3E* arguments in functions 200 arithmetic operators 1*E array functions <12 arrow -eys na(igating within spreadsheets 2@ assign styles to shortcut -eys 12A auto filters 322 )utoCorrect options 3A: a3es labels *<

7
bar charts 10: 4ase editing data sources 2E* bubble charts 11A

C
Calc sorting records EA Calc options case sensiti(e 3A< changes 3AE dates 3A< grid 3A* grid lines' (iewing 3A0 input settings 3<: iterati(e references 3A< page brea-s' (isible 3A1 screen display 3A2 unit of measurement 3<: updating lin-s 3<: Toom 3A2 calculation options 3A3
"39

columns' in Calc freeFing 3< selecting 2: comma separated (alues $C,B& 21 comments adding 2:1 editing 2:2 finding 2:2 formatting 2:2 comments on changes adding 2:0 editing 2:1 comparati(e operators 1** comparing documents 2:A concatenation operator 1:1 consolidating data 2<2 create document from template 13* creating new spreadsheets 21 cropping 1A1 C,B file open 21 C,B files 21 customiFing Dnter -ey 2* -eyboard shortcuts 3@A menus 3@0 toolbars 3@3

%
data analysis consolidating data 2<2 Goal ,ee- 2AE introduction 2<2 1ultiple ;perations tool 2A2 scenarios 2<* ,ol(er 2A* subtotals 2<< data editing' Calc changing data in a cell A< remo(ing data from a cell A3 replacing all data in a cell A< data entry -eyboard <2 speeding up <@ 5ata range *< 5ata series *A data source data to te3t 2E* editing 2E* editing using 4ase 2E* lin-ing 2E@ registering 2E@ using in ;;o documents 2E* (iewing 2EE data to te3t 2E* database functions <10 database range 31* 5ata"ilot

cell formatting 23@ data fields 223 data sources 21: filter 23A group rows or columns 22: group scalar (alues 22: group without inter(als 230 preconditions 21* refresh 23@ shortcuts 23@ sort results 232 date functions <0< dates and times' entry <3 55D lindescription 2*2 in Calc 2*2 in 0riter 2*2 default template 13* deleting columns and rows 31 sheets 3< 5etecti(e 20: digital rights management $5H1& 1*0 digital signature 1*2 status bar indicator 20 5ocumentation : documents comparing 2:A merging 2:A 5rawing ;bGect "roperties toolbar 1AE drawing obGects grouping 1A* properties 1AE resiFing 1A* 5rawing toolbar 1AE drawing tools 1AA 5ynamic 5ata D3change $55D& 2*2

#
e+mailing Calc document as attachment 1*1 se(eral recipients 1*1 Dnter -ey 2* D", images in "52 1EE error codes common messages <32 displayed within cells <31 introduction <30 error messages 20@' 211 error+chec-ing formulas 1*< errors' finding and fi3ing 20@ e3port directly as "52 1E@ D3porting 1*1 e3porting to "52 1E@ e3tensions installing 3@* introduction 3@E D3ternal 5ata dialog 2E1

0nde*

"33

F
252 1E* features *' 1@ file sharing options 3<2 2ill 2ormat mode 12< fill series adding <E defining <* 2ill tool <@ filled net charts 11@ filtering 321 filters ad(anced 32A auto 322 standard 322 financial analysis functions 3*< fi3ed (alues 1*< formatting chart :A symbols 10A formatting cell borders @1 conditional @A formatting data 2ont effects A: fonts A* 1anual line brea-s A* multiple lines of te3t AE numbers A* shrin-ing data to fit cell A* formula bar 1* formulas absolute reference 1:3 brea-ing into parts 20A calculation e3amples 1*A concatenation operator 1:1 definition 1*< intersection operator 1:2 operator types 1*E operators in 1*A range operator 1:1 relati(e reference 1:2 strategies for creating 20< using the 4asic editor to create 20@ 2unction #ist 201 2unction 0iFard 1*' 202 functions add+in <2< )55HD,, 333 arguments 200' 30:' 3E* array <12 basic arithmetic 211 CDC#C G 213 C; C)TD )TD 1** C;! TC2 21A' 32: database 32*' <10 date and time <0< date formats 3*<
"3"

definition 1*< description 1*< entering 1*A e3amples 211 financial analysis 3*< 2#;;H 213 /#;;6!" 331 C 5DQ 33A C 5CHDCT 33< informational <0* logical <0E #;;6!" 331 macros 303 1)TC/ 332 mathematical 3E: 1H;! 5 21< nested 201 ;22,DT 33< o(er(iew 1:: H;! 5 213 H;! 55;0 213 H;! 5!" 213 simple statistics 211 spreadsheet <1< statistical analysis 3:A structure 200 ,!4T;T)# 330 ,!1C2 32: terminology 3E* te3t <20 B#;;6!" 331

(
Gallery /ide/,how button 1<E opening 1<E GDT"CB;T5)T) function 23* Goal ,ee- 2AE graphic filters 1A0 graphics adding 1<< anchoring 1A: arrangement 1A* lin-ing 1<A positioning 1A* resiFing 1A2 transparency 1A1 graphics mode 1A0 grid options 3A* grid lines' (iewing 3A0

;
/elp system * /ide/,how button 1<E hiding and showing data @: /T1# compatibility 3<E hyperlin-s absolute 2@*

LibreOffice ".# $alc Guide

creating 2@: Ctrl+clic- to acti(ate 3<< editing 2E1 relati(e 2@* remo(ing 2E1 illumination of 35 chart :: image map 1@1 images adding 1<< conte3t menu 1A3 cropping 1A1 embedding 1<@ inserting from file 1<< inserting from the clipboard 1<E inserting from the Gallery 1<E lin-ing 1<A modifying 1<* resiFing 1A2 rotating 1A3 informational functions <0* input settings options 3<: insert mode 20 Cnsert "icture dialog 1<< inserting columns and rows 31 sheets 32 interest rates 3*< Cnternational ,upport : intersection operator 1:2

load/sa(e options 3<A logical functions <0E

4
macro recorder 300 macro security options 3<3 macros 3@E accessing cells directly 30: arguments 30* arguments in functions 30: as Calc functions 303 introduction 300 organiFing 303 recording 300 sorting data 311 1anual line brea-s A* mean (alue lines :3 menu bar 1E menu font' customiFing 3@0 menus adding commands 3@2 creating 3@1 customiFing 3@0 modifying 3@1 modifying entries 3@2 merging documents 2:A 1icrosoft ;ffice file con(ersion 3<E mo(ing chart elements :@ mo(ing from sheet to sheet 2@ 1ultiple ;perations tool 2A2 multiple sheets introduction 2@2 setting up 2@2

6
-eyboard data entry <2 -eyboard -eys na(igating within spreadsheets 2@ -eyboard shortcuts arrow -eys 3E3 assigning 3@A cell formatting 3E3 customiFing 3@@ function -eys 3E2 introduction 3E0 loading from a file 3@E na(igation 3E0 resetting to default (alues 3@E sa(ing to a file 3@@ selection 3E0

?
named range 31A a(igator 2A' 3@ scenarios 2A1 nested functions 201 net charts 11@ numbers entering in spreadsheet cell <2 numbers' data entry <3

=
;bGect #in-ing and Dmbedding $;#D& 2E: ;#D obGect lin-ed 2*2 non+lin-ed 2*1 other $0indows& 2*1 ;pen ,ource Cnitiati(e $;,C& 12 ;pen5ocument 2ormat 3<A opening spreadsheets 21 order of calculation 1:A outline group controls E1

2
le3ical E< licensing of #ibre;ffice 12 line charts 112 lin-ing to e3ternal data D3ternal 5ata dialog 2E1 find re?uired range 2E< a(igator 2E3 load 4asic code to edit 3<E

P
page brea-s' (isible 3A1

0nde*

"3%

page style on status bar 20 page styles applying 12A description 123 password protection 2A password+protect "52 1*0 "52 blan- page e3port 1E* digital rights management $5H1& 1*0 embed standard fonts 1E* encrypt 1*0 D", 1EE e3port documents to 1E@ form 1E* image compression and resolution 1EE initial (iew selection 1E* pages to e3port 1E@ password+protect 1*0 security settings 1*0 tagged 1EE user interface settings 1E* "52 ;ptions dialog 1E@ "52/)+1 1EE perspecti(e of chart :* picture conte3t menu 1A3 "icture toolbar 1<* pictures lin-ing 1<A resiFing 1A2 transparency 1A1 pie charts 10: "osition and ,iFe dialog for chart 10@ "osition and ,iFe of graphics 1A< precision 3A< prepare document for re(iew 2** print file directly 1@< print options 3<1 printer metrics 3A0 printing general options 1@A multiple pages per sheet 1@A page orientation 1@A "rint dialog 1@< selecting what to print 1@@ "roperties 3* protect a document 2**

regular e3pressions enable in formulas 3AA in functions 21< relati(e reference 1:2 remo(e personal information on sa(ing 3<3 renaming sheets 3< resolution options 3A* rotating images 1A3 rotation chart :* rounding methods 213 rounding off numbers 213 rows deleting 31 inserting 31 rows' in Calc freeFing 3< selecting 2:

+
sa(ing spreadsheets methods 23 scatter charts 113 scenarios 2<* security 2A ,election list <: selection mode indicator 20 selection' in Calc cells 2* sheets 30 send document as e+mail 1*1 shared e3tension 3@* shared spreadsheet introduction 2*@ opening 2*E sa(ing 2*E setting up 2*@ sheet tabs 1: sheets copying sheets 32 description 1@ identifying 2@2 inserting 32' 2@2 inserting from other spreadsheets 2@< na(igating 2@ referencing 2@A renaming 3<' 2@< se?uence number 20 sharing content A0 sheets' in Calc selecting 30 shrin-ing data to fit cell A* siFe optimiFation 3<A snap grid 3A* ,ol(er 2A* sorting 320 using macros 311

3
range database 31* named 31A range operators 1:1 record changes 2** reference operators 1:0 references in color 3A2 referencing other spreadsheets 2@E sheets 2@A

"3&

LibreOffice ".# $alc Guide

sorting records' Calc EA special characters << spreadsheet create from template 13* update from changed template 13* spreadsheet functions <1< spreadsheets comparing 2:A creating new 21 description 1@ documentation' internal 1*< embedding 2E: identifying copies 2*: merging 2:A na(igate 2A opening shared spreadsheet 2*E sa(ing 23 sa(ing as 1icrosoft D3cel 23 sa(ing shared 2*E setting up sharing 2*@ sharing 2*@ statistical analysis functions 3:A status bar 20 stoc- charts 11E styles assign to shortcut -eys 12A assigning to shortcut -eys 3@@ cell 122 create from selection 12E create using ,tyle dialog 12@ delete 13@ description 122 modifying 13< page 123' 12A types supported 122 ,tyles and 2ormatting dialog 123 subtotals 2<< support : synchroniFe a3es 3A* system font 3@0

mo(e 1<0 organiFe 1<0 reset default 13: te3t functions <20 te3t operators 1** te3t o(erflow 3A2 time functions <0< title bar 1@ titles of charts *@ toolbars 1* adding commands 3@< choosing icons for commands 3@A creating 3@< tooltip 1* trac- changes 2** transparency 1A1 trend lines :2

*
unsa(ed changes indicator 20 !H# Hecognition 2@: user data options 3<1 !ser guides : user interface' customiFing 3@0 user interface' parts of 10

>
(alidating cell contents A0 (alue highlighting 3A2 B4) properties load/sa(e options 3<@ (ersions sa(ing 2:@ (iewing Calc 3< (iewing data filtering E2 hiding and showing @: outline group controls E1 (isible grid 3A*

O
Q or Y error bars :3 Q1# 3<A QY charts 113

,
template associate spreadsheet with different template 13: create spreadsheet from 13* delete 1<0 delete folder 1<0 description 122 edit 13E e3port 1<1 folder 1<0

D
Foom 3<

X
h5CB/0l 5i(ision by Fero 20E hHD2 Cncorrect references 20* hB)#!D o result 20*

0nde*

"3A

You might also like