Tabelarvutuse funktsioonid

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

Selle käsu kasutamiseks...

Lisamine - Funktsioon - Kategooria Arvutustabel


ERROR.TYPE

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

ADDRESS

Tagastab lahtri aadressi (viite) teksti kujul vastavalt ette antud rea ja veeru numbritele. Võimalik on määrata, kas aadress on absoluutaadress (näiteks $A$1), suhteline aadress (nagu A1) või kombinatsioon nendest (A$1 või $A1). Saab määrata ka lehe nime.

Koostalitlusvõime huvides toetavad funktsioonid ADDRESS ja INDIRECT mittekohustuslikku parameetrit, mille abil saab määrata, kas tavapärase A1-kuju asemel tuleks kasutada aadressikuju R1V1.

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.

Kui argument sisestatakse väärtusega 0, kasutatakse mõlema funktsiooni korral kujul R1V1. Kui argumenti ei ole antud või selle väärtus pole 0, kasutatakse kuju A1.

R1V1-tähistuse korral tagastab ADDRESS aadressistringid kasutades lehenimede eraldajana hüüumärki '!' ning funktsioon INDIRECT eeldab lehenimede eraldajana hüüumärki. A1-tähistuse korral kasutavad mõlemad funktsioonid lehenimede eraldajana punkti '.'.

When opening documents from ODF 1.0/1.1 format, the ADDRESS functions that show a sheet name as the fourth parameter 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.

Märkuse ikoon

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.


Märkuse ikoon

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.


SĂĽntaks

ADDRESS(rida; veerg; abs; A1; "leht")

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: absoluutne ($A$1)

2: rida absoluutne, veerg suhteline (A$1)

3: rida suhteline; veerg absoluutne ($A1)

4: suhteline (A1)

A1 (mittekohustuslik) - kui see väärtus on 0, kasutatakse R1V1-tähistust. Kui see parameeter puudub või selle väärtus pole 0, kasutatakse A1-tähistust.

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

Näide:

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

If the formula above is in cell B2 of current sheet, and the cell A1 in sheet 2 contains the value -6, you can refer indirectly to the referenced cell using a function in B2 by entering =ABS(INDIRECT(B2)). The result is the absolute value of the cell reference specified in B2, which in this case is 6.

AREAS

Tagastab mitmesesse alasse kuuluvate üksikute vahemike arvu. Vahemik võib koosneda kõrvutiasuvatest lahtritest või üksikust lahtrist.

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.

SĂĽntaks

AREAS(viide)

Viide tähistab viidet lahtrile või lahtrite vahemikule.

Näide

=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

Tagastab indeksi abil väärtuse kuni 30 väärtuse loendist.

SĂĽntaks

CHOOSE(Index; Value1; ...; Value30)

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

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

Näide

=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

Returns the column number of a cell reference. If the reference is a cell the column number of the cell is returned; if the parameter is a cell area, the corresponding column numbers are returned in a single-row array if the formula is entered as an array formula. If the COLUMN function with an area reference parameter is not used for an array formula, only the column number of the first cell within the area is determined.

SĂĽntaks

COLUMN(viide)

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

Kui viide puudub, tagastatakse veeru number, milles valem ise asub. LibreOffice Calc määrab viite aktiivsele lahtrile automaatselt.

Näide

=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

Tagastab viitega määratud ala veergude arvu.

SĂĽntaks

COLUMNS(massiiv)

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.

Näide

=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

Returns the result of a DDE-based link. If the contents of the linked range or section changes, the returned value will also change. You must reload the spreadsheet or choose Edit - Links to see the updated links. Cross-platform links, for example from a LibreOffice installation running on a Windows machine to a document created on a Linux machine, are not allowed.

SĂĽntaks

DDE("server"; "fail"; "vahemik"; reĹľiim)

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.

ReĹľiim

Efekt

0 või puudub

Lahtristiilile "Vaikimisi" vastav arvuvorming

1

Andmeid käsitletakse alati vastavalt USA inglise keele standardvormingule

2

Andmeid käsitletakse tekstina, neid arvudeks teisendamata


Näide

=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

Tagastab arvu, mis vastab viidatud lahtris olevale vea koodile. Selle arvu abiga saab tekitada veateate teksti.

Vea korral tagastab funktsioon loogilise või arvulise väärtuse.

Märkuse ikoon

Kui klõpsata viga sisaldavale lahtrile, kuvatakse olekuribal LibreOffice'i eeldefineeritud veakoodi.


SĂĽntaks

ERRORTYPE(viide)

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

Näide

Kui lahtris A1 kuvatakse viga Err:518, tagastab funktsioon =ERRORTYPE(A1) arvu 518.

GETPIVOTDATA

The GETPIVOTDATA function returns a result value from a pivot table. The value is addressed using field and item names, so it remains valid if the layout of the pivot table changes.

SĂĽntaks

Kasutada võib kaht erinevat süntaksit:

GETPIVOTDATA(sihtväli; liigendtabel; [ väli 1; element 1; ... ])

GETPIVOTDATA(pivot table; Constraints)

Teist süntaksit eeldatakse, kui antud on täpselt kaks argumenti, millest esimene on viide lahtrile või lahtrite vahemikule. Kõikidel muudel juhtumitel eeldatakse esimest süntaksit. Funktsiooninõustaja kuvab esimest süntaksit.

SĂĽntaks

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.

If no Field n / Item n pairs are given, the grand total is returned. Otherwise, each pair adds a constraint that the result must satisfy. Field n is the name of a field from the pivot table. Item n is the name of an item from that field.

If the pivot table contains only a single result value that fulfills all of the constraints, or a subtotal result that summarizes all matching values, that result is returned. If there is no matching result, or several ones without a subtotal for them, an error is returned. These conditions apply to results that are included in the pivot table.

If the source data contains entries that are hidden by settings of the pivot table, they are ignored. The order of the Field/Item pairs is not significant. Field and item names are not case-sensitive.

Kui leheküljevälja jaoks pole piirangut määratud, kasutatakse vaikimisi välja valitud väärtust. Kui leheküljevälja jaoks on piirang määratud, peab see vastama välja valitud väärtusele, muidu tagastatakse viga. Leheküljeväljad on on liigendtabeli vasakpoolses ülaosas asuvad väljad, mis asustatakse liigendtabeli paigutuse dialoogi ala "Leheküljeväljad" kaudu. Igal leheküljeväljal saab valida elemendi (väärtuse), mis tähendab ainult selle elemendi kaasamist arvutusse.

Subtotal values from the pivot table are only used if they use the function "auto" (except when specified in the constraint, see Second Syntax below).

SĂĽntaks

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.

One of the entries can be the data field name. The data field name can be left out if the pivot table contains only one data field, otherwise it must be present.

Each of the other entries specifies a constraint in the form Field[Item] (with literal characters [ and ]), or only Item if the item name is unique within all fields that are used in the pivot table.

A function name can be added in the form Field[Item;Function], which will cause the constraint to match only subtotal values which use that function. The possible function names are Sum, Count, Average, Max, Min, Product, Count (Numbers only), StDev (Sample), StDevP (Population), Var (Sample), and VarP (Population), case-insensitive.

HLOOKUP

Otsib väärtust, viidates selle leidmisel valitud ala all olevale lahtrile. Funktsioon kontrollib, kas massiivi esimene rida sisaldab määratud väärtust. Seejärel tagastab funktsioon leitud lahtriga samas veerus oleva parameetriga indeks määratud rea lahtri sisu.

The search supports wildcards or regular expressions. With regular expressions enabled, 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 either precede every character with a "\" character, or enclose the text into \Q...\E. You can switch the automatic evaluation of wildcards or regular expression on and off in - LibreOffice Calc - Calculate.

warning

When using functions where one or more arguments are search criteria strings that represents a regular expression, the first attempt is to convert the string criteria to numbers. For example, ".0" will convert to 0.0 and so on. If successful, the match will not be a regular expression match but a numeric match. However, when switching to a locale where the decimal separator is not the dot makes the regular expression conversion work. To force the evaluation of the regular expression instead of a numeric expression, use some expression that can not be misread as numeric, such as ".[0]" or ".\0" or "(?i).0".


SĂĽntaks

HLOOKUP(SearchCriterion; Array; Index; SortedRangeLookup)

For an explanation on the parameters, see: VLOOKUP (columns and rows are exchanged)

Tühjade lahtrite käsitlemine

HYPERLINK

Kui klõpsata lahtrile, mis sisaldab funktsiooni HYPERLINK, avaneb hüperlink.

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

Nõuande ikoon

HĂĽperlingiga lahtri avamiseks klaviatuuri abil vali lahter, vajuta redigeerimisreĹľiimi sisenemiseks F2, vii kursor hĂĽperlingi ette, vajuta Shift+F10 ja vali Ava hĂĽperlink.


SĂĽntaks

HYPERLINK("URL") või HYPERLINK("URL"; "lahtri tekst")

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.

Näide

=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 tagastab alamvahemiku, mis on määratud rea ja veeru numbriga või mittekohustusliku vahemiku indeksiga. Sõltuvalt kontekstist tagastab INDEX kas viite või sisu.

SĂĽntaks

INDEX(viide; rida; veerg; vahemik)

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.

Näide

=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

Tagastab tekstistringiga määratud viite. Funktsioon võib tagastada ka stringiga määratud lahtrite vahemiku.

Koostalitlusvõime huvides toetavad funktsioonid ADDRESS ja INDIRECT mittekohustuslikku parameetrit, mille abil saab määrata, kas tavapärase A1-kuju asemel tuleks kasutada aadressikuju R1V1.

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.

Kui argument sisestatakse väärtusega 0, kasutatakse mõlema funktsiooni korral kujul R1V1. Kui argumenti ei ole antud või selle väärtus pole 0, kasutatakse kuju A1.

R1V1-tähistuse korral tagastab ADDRESS aadressistringid kasutades lehenimede eraldajana hüüumärki '!' ning funktsioon INDIRECT eeldab lehenimede eraldajana hüüumärki. A1-tähistuse korral kasutavad mõlemad funktsioonid lehenimede eraldajana punkti '.'.

When opening documents from ODF 1.0/1.1 format, the ADDRESS functions that show a sheet name as the fourth parameter 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.

Märkuse ikoon

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.


Märkuse ikoon

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.


SĂĽntaks

INDIRECT(viide; A1)

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

A1 (mittekohustuslik) - kui see väärtus on 0, kasutatakse R1V1-tähistust. Kui see parameeter puudub või selle väärtus pole 0, kasutatakse A1-tähistust.

Märkuse ikoon

If you open an Excel spreadsheet that uses indirect addresses calculated from string functions, the sheet addresses will not be translated automatically. For example, the Excel address in INDIRECT("[filename]sheetname!"&B1) is not converted into the Calc address in INDIRECT("filename#sheetname."&B1).


Näide

=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.

Märkuse ikoon

Kui LOOKUP ei leia otsingukriteeriumi, leiab funktsioon vastavuse suurimale väärtusele otsinguvektoris, mis on väiksem sisestatud kriteeriumist või võrdne sellega.


The search supports wildcards or regular expressions. With regular expressions enabled, 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 either precede every character with a "\" character, or enclose the text into \Q...\E. You can switch the automatic evaluation of wildcards or regular expression on and off in - LibreOffice Calc - Calculate.

warning

When using functions where one or more arguments are search criteria strings that represents a regular expression, the first attempt is to convert the string criteria to numbers. For example, ".0" will convert to 0.0 and so on. If successful, the match will not be a regular expression match but a numeric match. However, when switching to a locale where the decimal separator is not the dot makes the regular expression conversion work. To force the evaluation of the regular expression instead of a numeric expression, use some expression that can not be misread as numeric, such as ".[0]" or ".\0" or "(?i).0".


SĂĽntaks

LOOKUP(otsingukriteerium; otsinguvektor; tulemusvektor)

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.

Tühjade lahtrite käsitlemine

Näide

=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

Tagastab massiivi elemendi, mis vastab määratud väärtusele, suhtelise aadressi massiivis. Funktsioon tagastab otsingumassiivis leitud väärtuse asukoha arvuna.

SĂĽntaks

MATCH(otsingukriteerium; otsingumassiiv; tĂĽĂĽp)

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).

If Type = 1 or the third parameter is missing, the index of the last value that is smaller or equal to the search criterion is returned. This applies even when the search array is not sorted. For Type = -1, the first value that is larger or equal is returned.

The search supports wildcards or regular expressions. With regular expressions enabled, 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 either precede every character with a "\" character, or enclose the text into \Q...\E. You can switch the automatic evaluation of wildcards or regular expression on and off in - LibreOffice Calc - Calculate.

warning

When using functions where one or more arguments are search criteria strings that represents a regular expression, the first attempt is to convert the string criteria to numbers. For example, ".0" will convert to 0.0 and so on. If successful, the match will not be a regular expression match but a numeric match. However, when switching to a locale where the decimal separator is not the dot makes the regular expression conversion work. To force the evaluation of the regular expression instead of a numeric expression, use some expression that can not be misread as numeric, such as ".[0]" or ".\0" or "(?i).0".


Näide

=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

Tagastab viidatud lahtrist määratud arvu ridade ja veergude kaugusel oleva lahtri väärtuse.

SĂĽntaks

OFFSET(viide; read; veerud; kõrgus; laius)

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.

Arguments Rows and Columns must not lead to zero or negative start row or column.

Argumendid kõrgus ja laius ei tohi põhjustada ridade või veergude arvu negatiivset ega nullväärtust.

LibreOffice Calci funktsioonides võib argumendi, mis on märgitud kui "mittekohustuslik", jätta ära ainult siis, kui talle ei järgne enam teisi argumente. Näiteks, kui nelja argumendiga funktsiooni kaks viimast argumenti omavad märget "mittekohustuslik", võib ära jätta argumendi 4 või argumendid 3 ja 4, kuid mitte argumenti 3 üksinda.

Näide

=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).

Märkuse ikoon

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

Tagastab lahtriviitega määratud rea numbri. Kui viidatud on lahtrile, tagastatakse selle lahtri rea number. Kui viidatud on lahtrite vahemikule, tagastakse vastavad ridade numbrid üheveerulise massiivina, kui valem on sisestatud massiivi valemina. Kui funktsioon ROW viitega lahtrite vahemikule ei ole sisestatud massiivi valemina, tagastatakse ainult vahemiku esimese rea number.

SĂĽntaks

ROW(viide)

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

Kui viide puudub, leitakse selle lahtri rea number, kuhu valem on sisestatud. LibreOffice Calc määrab viite aktiivsele lahtrile automaatselt.

Näide

=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

Tagastab ridade arvu massiivis või vastavalt viitele.

SĂĽntaks

ROWS(massiiv)

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

Näide

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

=ROWS(A10:B12) tagastab 3.

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

SHEET

Tagastab viite lehenumbri või lehe nime sisaldava stringi. Kui argumendid puuduvad, tagastatakse selle lehe number, mis sisaldab valemit.

SĂĽntaks

SHEET(viide)

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

Näide

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

SHEETS

Tuvastab lehtede arvu viites. Kui argumendid puuduvad, tagastatakse aktiivse dokumendi lehtede arv.

SĂĽntaks

SHEETS(viide)

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

Näide

=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, "red" and "green" have to be defined beforehand.

SĂĽntaks

STYLE("stiil"; aeg; "stiil2")

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.

LibreOffice Calci funktsioonides võib argumendi, mis on märgitud kui "mittekohustuslik", jätta ära ainult siis, kui talle ei järgne enam teisi argumente. Näiteks, kui nelja argumendiga funktsiooni kaks viimast argumenti omavad märget "mittekohustuslik", võib ära jätta argumendi 4 või argumendid 3 ja 4, kuid mitte argumenti 3 üksinda.

Näide

=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.

Since STYLE() has a numeric return value of zero, this return value gets appended to a string. This can be avoided using T() as in the following example:

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

Teine näide on funktsiooni CURRENT() juures.

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 wildcards or regular expressions. With regular expressions enabled, 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 either precede every character with a "\" character, or enclose the text into \Q...\E. You can switch the automatic evaluation of wildcards or regular expression on and off in - LibreOffice Calc - Calculate.

warning

When using functions where one or more arguments are search criteria strings that represents a regular expression, the first attempt is to convert the string criteria to numbers. For example, ".0" will convert to 0.0 and so on. If successful, the match will not be a regular expression match but a numeric match. However, when switching to a locale where the decimal separator is not the dot makes the regular expression conversion work. To force the evaluation of the regular expression instead of a numeric expression, use some expression that can not be misread as numeric, such as ".[0]" or ".\0" or "(?i).0".


SĂĽntaks

=VLOOKUP(SearchCriterion; Array; Index; SortedRangeLookup)

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

Array is the reference, which is to comprise at least as many columns as the number passed in Index argument.

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

SortedRangeLookup is an optional parameter that indicates whether the first column in the array contains range boundaries instead of plain values. In this mode, the lookup returns the value in the row with first column having value equal to or less than SearchCriterion. E.g., it could contain dates when some tax value had been changed, and so the values represent starting dates of a period when a specific tax value was effective. Thus, searching for a date that is absent in the first array column, but falls between some existing boundary dates, would give the lower of them, allowing to find out the data being effective to the searched date. Enter the Boolean value FALSE or zero if the first column is not a range boundary list. When this parameter is TRUE or not given, the first column in the array must be 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 greater than the lowest value of the sorted list. In unsorted lists, the search value must be matched exactly. Otherwise the function will return #N/A with message: Error: Value Not Available.

Tühjade lahtrite käsitlemine

Näide

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.

Sisesta lahtrisse B1 järgmine valem:

=VLOOKUP(A1;D1:E100;2)

Niipea kui sisestad arvu lahtrisse A1, kuvab lahter B1 vastavat teksti, mis asub viidatud ala D1:E100 teises veerus. Kui sisestada arv, mida esimene veerg ei sisalda, tagastatakse lähimale väiksemale arvule vastav tekst. Kui sa ei soovi seda, sisesta neljanda parameetrina VÄÄR, siis tagastatakse esimesest veerust puuduva arvu sisestamisel veateade.

Palun toeta meid!