Funkcie zošitu

This section contains descriptions of the Spreadsheet functions together with an example.

Pre prístup k tomuto príkazu...

Vložiť - Funkcia - Kategória Zošit


[text/scalc/01/func_error_type.xhp#error_type_head not found].

Returns a number representing a specific Error type, or the error value #N/A, if there is no error.

ADDRESS

Vráti adresu bunky (súradnicu) v textovom tvare na základe zadaných čísel riadku a stĺpca. Môžete určiť, či bude adresa interpretovaná ako absolútna (napríklad $A$1) alebo ako relatívna (A1) či v zmiešanom tvare (A$1 alebo $A1). Môžete tiež zadať názov pracovného listu.

For interoperability the ADDRESS and INDIRECT functions support an optional parameter to specify whether the R1C1 address notation instead of the usual A1 notation should be used.

In ADDRESS, the parameter is inserted as the fourth parameter, shifting the optional sheet name parameter to the fifth position.

In INDIRECT, the parameter is appended as the second parameter.

In both functions, if the argument is inserted with the value 0, then the R1C1 notation is used. If the argument is not given or has a value other than 0, then the A1 notation is used.

In case of R1C1 notation, ADDRESS returns address strings using the exclamation mark '!' as the sheet name separator, and INDIRECT expects the exclamation mark as sheet name separator. Both functions still use the dot '.' sheet name separator with A1 notation.

When opening documents from ODF 1.0/1.1 format, the ADDRESS functions that show a sheet name as the fourth paramater will shift that sheet name to become the fifth parameter. A new fourth parameter with the value 1 will be inserted.

When storing a document in ODF 1.0/1.1 format, if ADDRESS functions have a fourth parameter, that parameter will be removed.

Note Icon Do not save a spreadsheet in the old ODF 1.0/1.1 format if the ADDRESS function's new fourth parameter was used with a value of 0.

Note Icon The INDIRECT function is saved without conversion to ODF 1.0/1.1 format. If the second parameter was present, an older version of Calc will return an error for that function.

Syntax

ADDRESS(Row; Column; Abs; A1; "Sheet")

Row represents the row number for the cell reference

Column represents the column number for the cell reference (the number, not the letter)

Abs determines the type of reference:

1: absolútna adresa ($A$1)

2: absolútna adresa súradnice riadku; relatívna adresa súradnice stĺpca (A$1)

3: relatívna adresa súradnice riadku; absolútna adresa súradnice stĺpca ($A1)

4: relatívna adresa (A1)

A1 (optional) - if set to 0, the R1C1 notation is used. If this parameter is absent or set to another value than 0, the A1 notation is used.

Sheet represents the name of the sheet. It must be placed in double quotes.

Príklad:

=ADDRESS(1;1;2;;"Sheet2") returns the following: Sheet2.A$1

Ak obsahuje bunka A1 v zošite2 hodnotu -6, môžete odkazovať nepriamo na adresu bunky s použitím funkcie vložením do B2 =ABS(INDIRECT(B2)). Výsledkom je absolútna hodnota adresy bunky špecifikovanej v B2, ktorá je v tomto prípade 6.

AREAS

Vráti počet súvislých oblastí buniek, ktoré sú súčasťou zadanej oblasti. Oblasťou sa rozumie súvislý rozsah buniek alebo jediná bunka.

The function expects a single argument. If you state multiple ranges, you must enclose them into additional parentheses. Multiple ranges can be entered using the semicolon (;) as divider, but this gets automatically converted to the tilde (~) operator. The tilde is used to join ranges.

Syntax

AREAS(Odkaz)

Odkaz: Súradnice buniek alebo oblastí.

Príklad

=AREAS((A1:B3;F2;G1)) returns 3, as it is a reference to three cells and/or areas. After entry this gets converted to =AREAS((A1:B3~F2~G1)).

=AREAS(All) returns 1 if you have defined an area named All under Data - Define Range.

CHOOSE

Použije index na vrátenie hodnoty zo zoznamu až 30 hodnôt.

Syntax

CHOOSE(Index; Hodnota1; ...; Hodnota30)

Index is a reference or number between 1 and 30 indicating which value is to be taken from the list.

Value1...Value30 is the list of values entered as a reference to a cell or as individual values.

Príklad

=CHOOSE(A1;B1;B2;B3;"Today";"Yesterday";"Tomorrow"), for example, returns the contents of cell B2 for A1 = 2; for A1 = 4, the function returns the text "Today".

COLUMN

Vráti číslo stĺpca odkazu na bunku. Ak odkazuje odkaz na bunku, je vrátené číslo stĺpca zodpovedajúcej bunky. Ak je odkazované na maticu, sú vrátené zodpovedajúce čísla stĺpcov v jednoriadkovej matici ak bol vzorec zadaný ako maticový vzorec. Ak nie je funkcia COLUMN odkazujúca na maticu použitá ako maticový vzorec, potom je vrátené iba číslo stĺpca prvej bunky z matice.

Syntax

COLUMN(odkaz)

Reference is the reference to a cell or cell area whose first column number is to be found.

Ak nie je parameter odkaz zadaný, potom je vrátené číslo stĺpca bunky, v ktorej je samotná funkcia zadaná. LibreOffice Calc automaticky nastaví odkaz na aktuálnu bunku.

Príklad

=COLUMN(A1) equals 1. Column A is the first column in the table.

=COLUMN(C3:E3) equals 3. Column C is the third column in the table.

=COLUMN(D3:G10) returns 4 because column D is the fourth column in the table and the COLUMN function is not used as an array formula. (In this case, the first value of the array is always used as the result.)

{=COLUMN(B2:B7)} and =COLUMN(B2:B7) both return 2 because the reference only contains column B as the second column in the table. Because single-column areas have only one column number, it does not make a difference whether or not the formula is used as an array formula.

=COLUMN() returns 3 if the formula was entered in column C.

{=COLUMN(Rabbit)} returns the single-row array (3, 4) if "Rabbit" is the named area (C1:D3).

COLUMNS

Vráti počet stĺpcov v zadanej oblasti.

Syntax

COLUMNS(oblasť)

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.

Príklad

=COLUMNS(B5) returns 1 because a cell only contains one column.

=COLUMNS(A1:C5) equals 3. The reference comprises three columns.

=COLUMNS(Rabbit) returns 2 if Rabbit is the named range (C1:D3).

DDE

Vráti výsledok DDE prepojenia. Ak sa obsah pripojenej oblasti alebo oddielu zmení, bude zmenená i hodnota vrátená touto funkciou. Aby sa zmeny prejavili, je nutné buď zošit znovu otvoriť, alebo zvoliť Úpravy - Odkazy. Nie je možné použiť medziplatformové odkazy, napríklad z inštalácie LibreOffice na počítači so systémom Windows do dokumentu vytvoreného na linuxovom stroji.

Syntax

DDE("Server"; "Súbor"; "Oblasť"; Režim)

Server is the name of a server application. LibreOffice applications have the server name "soffice".

File is the complete file name, including path specification.

Range is the area containing the data to be evaluated.

Mode is an optional parameter that controls the method by which the DDE server converts its data into numbers.

Názov

Odchýlka

0 alebo nezadané

Formát čísla podľa východzieho formátu zadaného v štýle bunky.

1

Dáta budú interpretované vo východzích formátoch pre češtinu.

2

Dáta nebudú prevedené na čísla, ale vložené ako text.


Príklad

=DDE("soffice";"c:\office\document\data1.ods";"sheet1.A1") reads the contents of cell A1 in sheet1 of the LibreOffice Calc spreadsheet data1.ods.

=DDE("soffice";"c:\office\document\motto.odt";"Today's motto") returns a motto in the cell containing this formula. First, you must enter a line in the motto.odt document containing the motto text and define it as the first line of a section named Today's Motto (in LibreOffice Writer under Insert - Section). If the motto is modified (and saved) in the LibreOffice Writer document, the motto is updated in all LibreOffice Calc cells in which this DDE link is defined.

ERRORTYPE

Vráti číslo zodpovedajúce chybovej hodnote v inej bunke. Pomocou tohto čísla je možné vygenerovať text chybovej správy.

If an error occurs, the function returns a logical or numerical value.

Note Icon Ak kliknete na bunku obsahujúcu chybu, stavový riadok zobrazuje preddefinovaný chybový kód LibreOffice.

Syntax

ERRORTYPE(Odkaz)

Reference contains the address of the cell in which the error occurs.

Príklad

Ak bunka A1 zobrazí Err:518, funkcia =ERRORTYPE(A1) vracia číslo 518.

GETPIVOTDATA

Funkcia GETPIVOTDATA vracia výslednú hodnotu z tabuľky Sprievodca dátami. Hodnota je odkazovaná pomocou názvu poľa a položiek, takže zostane platná aj keď sa zmení rozvrhnutie tabuľky Sprievodca dátami.

Syntax

Možno použiť dve rôzne syntaxy:

GETPIVOTDATA(CieľovéPole; Sprievodca dátami; [ Pole 1; Položka 1; ... ])

GETPIVOTDATA(Sprievodca dátami; Obmedzenie)

Druhá syntax sa použije, ak sú zadané presne dva parametre, z ktorých prvý je bunka alebo rozsah buniek. V ostatných prípadoch sa použije prvá syntax. Sprievodca funkciou ponúkne prvú syntaxu.

Prvá syntax

TargetField is a string that selects one of the pivot table's data fields. The string can be the name of the source column, or the data field name as shown in the table (like "Sum - Sales").

pivot table is a reference to a cell or cell range that is positioned within a pivot table or contains a pivot table. If the cell range contains several pivot tables, the table that was created last is used.

Ak nie sú zadané dvojice Pole n / Položka n, vráti funkcia celkový súčet. Inak každá dvojica pridá obmedzujúcu podmienku, ktorú musí výsledok splniť. Pole n je názov poľa z tabuľky Sprievodca dátami. Položka n je názov položky z tohto poľa.

Ak tabuľka Sprievodca dátami obsahuje iba jedinú výslednú hodnotu, ktorá spĺňa všetky podmienky alebo medzisúčet, ktorý sčíta všetky zodpovedajúce hodnoty, vráti sa výsledok. Ak nie je nájdený žiadny zodpovedajúci výsledok alebo je výsledkov niekoľko, vráti sa chyba. Podmienky sa aplikujú na výsledky, ktoré sú obsiahnuté v tabuľke Sprievodca dátami.

Ak zdrojové dáta obsahujú záznamy, ktoré sú nastavením tabuľky Sprievodca dátami skryté, ignorujú sa. Na poradí dvojíc Pole/Položka nezáleží. Pri názve polí a položiek nezáleží na veľkosti znakov.

Ak nie je určená obmedzujúca podmienka pre pole stránky, zvolí sa aktuálne použitá hodnota poľa. Ak je použitá obmedzujúca podmienka, musí sa zhodovať s aktuálnou hodnotou poľa, inak sa vráti chyba. Polia stránky sú polia v ľavej hornej časti tabuľky Sprievodca dátami, zaplnené oblasťou "Pole stránky" v dialógu rozvrhnutia Sprievodca tu. Z každého poľa stránky možno vybrať položku (hodnotu), čo znamená, že sa do výpočtu zahrnie len táto položka.

Hodnoty medzisúčtu z tabuľky Sprievodca dátami sa použijú, iba ak používajú funkciu "auto" (okrem prípadu, kedy sú určené v obmedzujúcich podmienkach, viď. Druhá syntax nižšie).

Druhá syntax

pivot table has the same meaning as in the first syntax.

Constraints is a space-separated list. Entries can be quoted (single quotes). The whole string must be enclosed in quotes (double quotes), unless you reference the string from another cell.

Jedna z položiek môže byť názov dátového poľa. Názov dátového poľa možno vynechať, ak tabuľka Sprievodca dátami obsahuje len jedno dátové pole, inak musí byť prítomný.

Ostatné položky určujú obmedzujúce podmienky v podobe Pole[Položka] (s hranatými zátvorkami [ a ]), alebo len Položka, ak je názov položky jedinečný v rámci všetkých polí, ktoré sú použité v tabuľke Sprievodca dátami.

Meno funkcie môže byť pridané vo forme Pole[Položka;Funkcia], čo spôsobí, že obmedzujúce podmienky sa budú porovnávať s dielčimi výsledkami použitými tou funkciou. Možné názvy funkcií sú Sum, Count, Average, Max, Min, Product, Count (Iba čísla), StDev (Vzorka), StDevP (Populácia), Var (Vzorka), a VarP (Populácia), nerozlišujúce veľké písmená.

HLOOKUP

Hľadá hodnotu a odkáže na bunky vybranej oblasti. Táto funkcia overuje či prvý riadok oblasti obsahuje určitú hodnotu. Funkcia potom vráti hodnotu z rovnakého stĺpca, ale z riadku určeného v parametri Index.

The search supports regular expressions. You can enter "all.*", for example to find the first location of "all" followed by any characters. If you want to search for a text that is also a regular expression, you must precede every character with a \ character. You can switch the automatic evaluation of regular expression on and off in - LibreOffice Calc - Calculate.

Syntax

HLOOKUP(SearchCriterion; Array; Index; Sorted)

See also: VLOOKUP (columns and rows are exchanged)

Narábanie s prázdnymi bunkami

HYPERLINK

Ak kliknete na bunku, ktorá obsahuje funkciu HYPERLINK, otvorí sa hypertextový odkaz.

If you use the optional CellText parameter, the formula locates the URL, and then displays the text or number.

Tip Icon Bunku s hypertextovým odkazom otvoríte pomocou klávesnice tak, že najskôr vyberiete bunku, stlačíte F2, aby ste sa dostali do režimu úprav, presuniete kurzor pred hypertextový odkaz, stlačíte Shift+F10 a potom vyberiete Otvoriť Hypertextový odkaz.

Syntax

HYPERLINK("URL") alebo HYPERLINK("URL"; "TextBunky")

URL specifies the link target. The optional CellText parameter is the text or a number that is displayed in the cell and will be returned as the result. If the CellText parameter is not specified, the URL is displayed in the cell text and will be returned as the result.

The number 0 is returned for empty cells and matrix elements.

Príklad

=HYPERLINK("http://www.example.org") displays the text "http://www.example.org" in the cell and executes the hyperlink http://www.example.org when clicked.

=HYPERLINK("http://www.example.org";"Click here") displays the text "Click here" in the cell and executes the hyperlink http://www.example.org when clicked.

=HYPERLINK("http://www.example.org";12345) displays the number 12345 and executes the hyperlink http://www.example.org when clicked.

=HYPERLINK($B4) where cell B4 contains http://www.example.org. The function adds http://www.example.org to the URL of the hyperlink cell and returns the same text which is used as formula result.

=HYPERLINK("http://www.";"Click ") & "example.org" displays the text Click example.org in the cell and executes the hyperlink http://www.example.org when clicked.

=HYPERLINK("#Sheet1.A1";"Go to top") displays the text Go to top and jumps to cell Sheet1.A1 in this document.

=HYPERLINK("file:///C:/writer.odt#Specification";"Go to Writer bookmark")displays the text Go to Writer bookmark, loads the specified text document and jumps to bookmark "Specification".

INDEX

INDEX vracia podoblasť špecifikovanú číslami riadkov a stĺpcov alebo voliteľným indexom oblasti. V závislosti od obsahu INDEX vracia odkaz alebo obsah.

Syntax

INDEX(Odkaz; Riadok; Stĺpec; Oblasť)

Reference is a reference, entered either directly or by specifying a range name. If the reference consists of multiple ranges, you must enclose the reference or range name in parentheses.

Row (optional) represents the row index of the reference range, for which to return a value. In case of zero (no specific row) all referenced rows are returned.

Column (optional) represents the column index of the reference range, for which to return a value. In case of zero (no specific column) all referenced columns are returned.

Range (optional) represents the index of the subrange if referring to a multiple range.

Príklad

=INDEX(Prices;4;1) returns the value from row 4 and column 1 of the database range defined in Data - Define as Prices.

=INDEX(SumX;4;1) returns the value from the range SumX in row 4 and column 1 as defined in Sheet - Named Ranges and Expressions - Define.

=INDEX(A1:B6;1) returns a reference to the first row of A1:B6.

=INDEX(A1:B6;0;1) returns a reference to the first column of A1:B6.

=INDEX((multi);4;1) indicates the value contained in row 4 and column 1 of the (multiple) range, which you named under Sheet - Named Ranges and Expressions - Define as multi. The multiple range may consist of several rectangular ranges, each with a row 4 and column 1. If you now want to call the second block of this multiple range enter the number 2 as the range parameter.

=INDEX(A1:B6;1;1) indicates the value in the upper-left of the A1:B6 range.

=INDEX((multi);0;0;2) returns a reference to the second range of the multiple range.

INDIRECT

Vráti odkaz určený textovým reťazcom. Túto funkciu je tiež možné použiť na získanie oblasti zodpovedajúceho názvu.

For interoperability the ADDRESS and INDIRECT functions support an optional parameter to specify whether the R1C1 address notation instead of the usual A1 notation should be used.

In ADDRESS, the parameter is inserted as the fourth parameter, shifting the optional sheet name parameter to the fifth position.

In INDIRECT, the parameter is appended as the second parameter.

In both functions, if the argument is inserted with the value 0, then the R1C1 notation is used. If the argument is not given or has a value other than 0, then the A1 notation is used.

In case of R1C1 notation, ADDRESS returns address strings using the exclamation mark '!' as the sheet name separator, and INDIRECT expects the exclamation mark as sheet name separator. Both functions still use the dot '.' sheet name separator with A1 notation.

When opening documents from ODF 1.0/1.1 format, the ADDRESS functions that show a sheet name as the fourth paramater will shift that sheet name to become the fifth parameter. A new fourth parameter with the value 1 will be inserted.

When storing a document in ODF 1.0/1.1 format, if ADDRESS functions have a fourth parameter, that parameter will be removed.

Note Icon Do not save a spreadsheet in the old ODF 1.0/1.1 format if the ADDRESS function's new fourth parameter was used with a value of 0.

Note Icon The INDIRECT function is saved without conversion to ODF 1.0/1.1 format. If the second parameter was present, an older version of Calc will return an error for that function.

Syntax

INDIRECT(Ref; A1)

Ref represents a reference to a cell or an area (in text form) for which to return the contents.

A1 (optional) - if set to 0, the R1C1 notation is used. If this parameter is absent or set to another value than 0, the A1 notation is used.

Note Icon Ak otvoríte zošit aplikácie Microsoft Excel používajúci nepriame adresy získavané pomocou reťazových funkcií, tieto adresy nebudú automaticky preložené. Napríklad adresa INDIRECT("filename!sheetname"&B1) nebude prevedená na Calc adresu INDIRECT("filename.sheetname"&B1).

Príklad

=INDIRECT(A1) equals 100 if A1 contains C108 as a reference and cell C108 contains a value of 100.

=SUM(INDIRECT("a1:" & ADDRESS(1;3))) totals the cells in the area of A1 up to the cell with the address defined by row 1 and column 3. This means that area A1:C1 is totaled.

LOOKUP

Returns the contents of a cell either from a one-row or one-column range. Optionally, the assigned value (of the same index) is returned in a different column and row. As opposed to VLOOKUP and HLOOKUP, search and result vector may be at different positions; they do not have to be adjacent. Additionally, the search vector for the LOOKUP must be sorted ascending, otherwise the search will not return any usable results.

Note Icon Ak LOOKUP nemôže nájsť kritérium vyhľadávania, použije najvyššiu hodnotu prehľadávaného vektoru, ktorá je menšia alebo rovná kritériu vyhľadávania.

The search supports regular expressions. You can enter "all.*", for example to find the first location of "all" followed by any characters. If you want to search for a text that is also a regular expression, you must precede every character with a \ character. You can switch the automatic evaluation of regular expression on and off in - LibreOffice Calc - Calculate.

Syntax

LOOKUP(KritériumHľadania; VyhľadávacíVektor; VýsledkovýVektor)

SearchCriterion is the value to be searched for; entered either directly or as a reference.

SearchVector is the single-row or single-column area to be searched.

ResultVector is another single-row or single-column range from which the result of the function is taken. The result is the cell of the result vector with the same index as the instance found in the search vector.

Narábanie s prázdnymi bunkami

Príklad

=LOOKUP(A1;D1:D100;F1:F100) searches the corresponding cell in range D1:D100 for the number you entered in A1. For the instance found, the index is determined, for example, the 12th cell in this range. Then, the contents of the 12th cell are returned as the value of the function (in the result vector).

MATCH

Vráti relatívnu polohu prvku v poli, ktorý sa zhoduje so zadanou hodnotou. Funkcia vracia číselnú pozíciu hodnoty nájdenej vo vyhľadávacie_pole.

Syntax

MATCH(KritériumHľadania, VyhľadávaciaOblasť, Typ)

SearchCriterion is the value which is to be searched for in the single-row or single-column array.

LookupArray is the reference searched. A lookup array can be a single row or column, or part of a single row or column.

Type may take the values 1, 0, or -1. If Type = 1 or if this optional parameter is missing, it is assumed that the first column of the search array is sorted in ascending order. If Type = -1 it is assumed that the column in sorted in descending order. This corresponds to the same function in Microsoft Excel.

If Type = 0, only exact matches are found. If the search criterion is found more than once, the function returns the index of the first matching value. Only if Type = 0 can you search for regular expressions (if enabled in calculation options) or wildcards (if enabled in calculation options).

Ak sa Typ=0 alebo tretí parameter chýba, je vrátený index poslednej hodnoty, ktorá je menšia alebo rovná hľadanému kritériu. Toto je použité iba ak prehľadávané pole nie je zoradené. Pre Typ=-1 je vrátená prvá hodnota, ktorá je väčšia alebo rovná.

The search supports regular expressions. You can enter "all.*", for example to find the first location of "all" followed by any characters. If you want to search for a text that is also a regular expression, you must precede every character with a \ character. You can switch the automatic evaluation of regular expression on and off in - LibreOffice Calc - Calculate.

Príklad

=MATCH(200;D1:D100) searches the area D1:D100, which is sorted by column D, for the value 200. As soon as this value is reached, the number of the row in which it was found is returned. If a higher value is found during the search in the column, the number of the previous row is returned.

OFFSET

Vráti hodnotu bunky posunutej od východzieho odkazu o určený počet riadkov a stĺpcov.

Syntax

OFFSET(Odkaz, Riadky, Stĺpce, Výška, Šírka)

Reference is the reference from which the function searches for the new reference.

Rows is the number of rows by which the reference was corrected up (negative value) or down. Use 0 to stay in the same row.

Columns is the number of columns by which the reference was corrected to the left (negative value) or to the right. Use 0 to stay in the same column

Height (optional) is the vertical height for an area that starts at the new reference position.

Width (optional) is the horizontal width for an area that starts at the new reference position.

Argumenty Výška a Šírka nesmú viesť k nulovému alebo zápornému počtu riadkov a stĺpcov.

Argumenty Výška a Šírka nesmú viesť k nulovému alebo zápornému počtu riadkov a stĺpcov.

Ak sú parametre funkcií LibreOffice Calc označené ako nepovinné, je možné ich vynechať pokiaľ za nimi nenasledujú žiadne parametre. Napr. pokiaľ má funkcia štyri parametre a posledné dva sú označené ako "nepovinné", je možné vynechať parameter 4 alebo parametre 3 a 4, ale nie je možné vynechať samotný parameter 3.

Príklad

=OFFSET(A1;2;2) returns the value in cell C3 (A1 moved by two rows and two columns down). If C3 contains the value 100 this function returns the value 100.

=OFFSET(B2:C3;1;1) returns a reference to B2:C3 moved down by 1 row and one column to the right (C3:D4).

=OFFSET(B2:C3;-1;-1) returns a reference to B2:C3 moved up by 1 row and one column to the left (A1:B2).

=OFFSET(B2:C3;0;0;3;4) returns a reference to B2:C3 resized to 3 rows and 4 columns (B2:E4).

=OFFSET(B2:C3;1;0;3;4) returns a reference to B2:C3 moved down by one row resized to 3 rows and 4 columns (B3:E5).

=SUM(OFFSET(A1;2;2;5;6)) determines the total of the area that starts in cell C3 and has a height of 5 rows and a width of 6 columns (area=C3:H7).

Note Icon If the width or height is included, the OFFSET function returns a range and thus must be entered as an array formula. If both the width and height are missing, a cell reference is returned.

ROW

Vráti číslo riadku odkazu na bunku. Ak ide o odkaz na bunku, je vrátené číslo riadku bunky. Ak ide o odkaz na oblasť buniek, sú vrátené čísla jednotlivých riadkov v jednostĺpcovej matici ak bolo určené, že ide o maticový vzorec. Ak je funkcia ROW použitá s odkazom na oblasť, ale nie je určené, že ide o maticový vzorec, potom je vrátené číslo prvého riadku oblasti.

Syntax

ROW(Odkaz)

Reference is a cell, an area, or the name of an area.

Ak nezadáte parameter odkaz, potom je vrátené číslo riadku bunky obsahujúce túto funkciu. LibreOffice Calc automaticky nastaví odkaz na aktuálnu bunku.

Príklad

=ROW(B3) returns 3 because the reference refers to the third row in the table.

{=ROW(D5:D8)} returns the single-column array (5, 6, 7, 8) because the reference specified contains rows 5 through 8.

=ROW(D5:D8) returns 5 because the ROW function is not used as array formula and only the number of the first row of the reference is returned.

{=ROW(A1:E1)} and =ROW(A1:E1) both return 1 because the reference only contains row 1 as the first row in the table. (Because single-row areas only have one row number it does not make any difference whether or not the formula is used as an array formula.)

=ROW() returns 3 if the formula was entered in row 3.

{=ROW(Rabbit)} returns the single-column array (1, 2, 3) if "Rabbit" is the named area (C1:D3).

ROWS

Vráti počet riadkov odkazu alebo poľa.

Syntax

ROWS(Matica)

Array is the reference or named area whose total number of rows is to be determined.

Príklad

=Rows(B5) returns 1 because a cell only contains one row.

=ODD(1.2) vráti 3.

=ROWS(Rabbit) returns 3 if "Rabbit" is the named area (C1:D3).

SHEET

Vráti číslo listu pre zadaný odkaz alebo názov listu ako reťazec. Ak nezadáte žiadny z parametrov, funkcia vráti číslo toho listu zošitu, ktorý obsahuje vzorec.

Syntax

SHEET(Odkaz)

Reference is optional and is the reference to a cell, an area, or a sheet name string.

Príklad

=SHEET(Sheet2.A1) returns 2 if Sheet2 is the second sheet in the spreadsheet document.

SHEETS

Určí počet listov v odkaze. Ak nezadáte žiadny z parametrov funkcie, potom je vrátený počet listov aktuálneho dokumentu.

Syntax

SHEETS(Odkaz)

Reference is the reference to a sheet or an area. This parameter is optional.

Príklad

=SHEETS(Sheet1.A1:Sheet3.G12) returns 3 if Sheet1, Sheet2, and Sheet3 exist in the sequence indicated.

STYLE

Applies a style to the cell containing the formula. After a set amount of time, another style can be applied. This function always returns the value 0, allowing you to add it to another function without changing the value. Together with the CURRENT function you can apply a color to a cell depending on the value. For example: =...+STYLE(IF(CURRENT()>3;"red";"green")) applies the style "red" to the cell if the value is greater than 3, otherwise the style "green" is applied. Both cell formats have to be defined beforehand.

Syntax

STYLE("Štýl"; Čas; "Štýl2")

Style is the name of a cell style assigned to the cell. Style names must be entered in quotation marks.

Time is an optional time range in seconds. If this parameter is missing the style will not be changed after a certain amount of time has passed.

Style2 is the optional name of a cell style assigned to the cell after a certain amount of time has passed. If this parameter is missing "Default" is assumed.

Ak sú parametre funkcií LibreOffice Calc označené ako nepovinné, je možné ich vynechať pokiaľ za nimi nenasledujú žiadne parametre. Napr. pokiaľ má funkcia štyri parametre a posledné dva sú označené ako "nepovinné", je možné vynechať parameter 4 alebo parametre 3 a 4, ale nie je možné vynechať samotný parameter 3.

Príklad

=STYLE("Invisible";60;"Default") formats the cell in transparent format for 60 seconds after the document was recalculated or loaded, then the Default format is assigned. Both cell formats have to be defined beforehand.

Pretože STYLE() má číselnú návratovú hodnotu rovnú nule, je táto návratová hodnota pripojená k reťazcu. Tomu sa možno vyhnúť použitím T() tak, ako v nasledujúcom príklade.

="Text"&T(STYLE("myStyle"))

Viď. tiež CURRENT() pre ďalší príklad.

VLOOKUP

Vertical search with reference to adjacent cells to the right. This function checks if a specific value is contained in the first column of an array. The function then returns the value in the same row of the column named by Index. If the Sorted parameter is omitted or set to TRUE or one, it is assumed that the data is sorted in ascending order. In this case, if the exact SearchCriterion is not found, the last value that is smaller than the criterion will be returned. If Sorted is set to FALSE or zero, an exact match must be found, otherwise the error Error: Value Not Available will be the result. Thus with a value of zero the data does not need to be sorted in ascending order.

The search supports regular expressions. You can enter "all.*", for example to find the first location of "all" followed by any characters. If you want to search for a text that is also a regular expression, you must precede every character with a \ character. You can switch the automatic evaluation of regular expression on and off in - LibreOffice Calc - Calculate.

Syntax

=VLOOKUP(SearchCriterion; Array; Index; Sorted)

SearchCriterion is the value searched for in the first column of the array.

Array is the reference, which is to comprise at least two columns.

Index is the number of the column in the array that contains the value to be returned. The first column has the number 1.

Sorted is an optional parameter that indicates whether the first column in the array is sorted in ascending order. Enter the Boolean value FALSE or zero if the first column is not sorted in ascending order. Sorted columns can be searched much faster and the function always returns a value, even if the search value was not matched exactly, if it is between the lowest and highest value of the sorted list. In unsorted lists, the search value must be matched exactly. Otherwise the function will return this message: Error: Value Not Available.

Narábanie s prázdnymi bunkami

Príklad

You want to enter the number of a dish on the menu in cell A1, and the name of the dish is to appear as text in the neighboring cell (B1) immediately. The Number to Name assignment is contained in the D1:E100 array. D1 contains 100, E1 contains the name Vegetable Soup, and so forth, for 100 menu items. The numbers in column D are sorted in ascending order; thus, the optional Sorted parameter is not necessary.

Do bunky B1 zadajte nasledujúci vzorec:

=VLOOKUP(A1;D1:E100;2)

Akonáhle zadáte do bunky A1 číslo, zobrazí sa v bunke B1 zodpovedajúci text obsiahnutý v druhom stĺpci v oblasti buniek D1:E100. Ak zadáte číslo, ktoré sa v stĺpci D nenachádza, bude zobrazený text zodpovedajúci najbližšej nasledujúcej číselnej hodnote. Ak chcete, aby pri zadaní neexistujúceho čísla bola zobrazená chybová správa, zadajte v poslednom parametri vzorca logickú hodnotu NEPRAVDA.