Text Functions

This section contains descriptions of the Text functions.

Selle käsu kasutamiseks...

Lisamine - Funktsioon - Kategooria Tekst


REGEX

Matches and extracts or optionally replaces text using regular expressions.

WEBSERVICE

Veebisisu hankimine antud URI-lt.

FILTERXML

Teisendab tekstistringi arvuks.

ENCODEURL

Returns a URL-encoded string.

ARABIC

Arvutab rooma numbri väärtuse. Väärtuste vahemik peab jääma 0 ja 3999 vahele.

Syntax

ARABIC("tekst")

Text is the text that represents a Roman number.

Example

=ARABIC("MXIV") tagastab 1014

=ARABIC("MMII") tagastab 2002

ASC

Funktsioon ASC teisendab täislaiusega ASCII ja katakana märgid poollaiusega märkideks. Tulemuseks on tekstistring.

See https://wiki.documentfoundation.org/Calc/Features/JIS_and_ASC_functions for a conversion table.

Syntax

ASC("tekst")

Tekst on teisendatavaid märke sisaldav tekst.

Vaata ka funktsiooni JIS.

BAHTTEXT

Teisendab arvu Tai tekstiks, sealhulgas ka Tai rahaĂĽhiku nimed.

Syntax

BAHTTEXT(arv)

Arv on suvaline arv. "Baht" lisatakse arvu täisarvulise osa lõppu ja "Satang" lisatakse arvu kümnendosale.

Example

=BAHTTEXT(12,65) tagastab tai märkide stringi, mille tähendus on "kaksteist bahti ja kuuskümmend viis satangi".

BASE

Teisendab positiivse täisarvu alusele vastavasse arvusüsteemi. Kasutatakse numbreid 0-9 ja inglise tähestiku tähti A-Z.

Syntax

BASE(arv; alus; [miinimumpikkus])

Number is the positive integer to be converted.

Radix indicates the base of the number system. It may be any positive integer between 2 and 36.

MinimumLength (optional) determines the minimum length of the character sequence that has been created. If the text is shorter than the indicated minimum length, zeros are added to the left of the string.

Example

=BASE(17;10;4) returns 0017 in the decimal system.

=BASE(17;2) returns 10001 in the binary system.

=BASE(255;16;4) returns 00FF in the hexadecimal system.

CHAR

Teisendab arvu märgiks vastavalt aktiivsele märgistikule. Arvuks võib olla kahe- või kolmekohaline täisarv.

Suuremad koodid kui 127 võivad sõltuda sinu süsteemi märgistikust (näiteks iso-8859-1, iso-8859-2, Windows-1252, Windows-1250) ega pruugi seetõttu olla universaalsed.

Syntax

CHAR(arv)

Number is a number between 1 and 255 representing the code value for the character.

Example

=CHAR(100) returns the character d.

="abc" & CHAR(10) & "def" sisestab stringi uue rea märgi.

CLEAN

Eemaldab stringist kõik mitteprinditavad märgid.

Syntax

CLEAN("tekst")

Text refers to the text from which to remove all non-printable characters.

CODE

Tagastab stringi esimese märgi arvkoodi.

Syntax

CODE("tekst")

Text is the text for which the code of the first character is to be found.

Suuremad koodid kui 127 võivad sõltuda sinu süsteemi märgistikust (näiteks iso-8859-1, iso-8859-2, Windows-1252, Windows-1250) ega pruugi seetõttu olla universaalsed.

Example

=CODE("Hieronymus") returns 72, =CODE("hieroglyphic") returns 104.

Märkuse ikoon

Kood ei vasta mitte ASCII tabelile, vaid aktiivsele märgistikule.


CONCATENATE

Kombineerib mitu tekstistringi ĂĽheks stringiks.

Syntax

CONCATENATE("tekst1"; ...; "tekst30")

Text 1; Text 2; ... represent up to 30 text passages which are to be combined into one string.

Example

=CONCATENATE("Good ";"Morning ";"Mrs. ";"Doe") returns: Good Morning Mrs. Doe.

DECIMAL

Teisendab arvusüsteemi märkidest koosneva teksti positiivseks täisarvuks vastavalt antud arvüsteemi alusele. Alus peab olema vahemikus 2 kuni 36. Tühikuid ja tabeldusmärke eiratakse. Teksti väli ei ole tõstutundlik.

If the radix is 16, a leading x or X or 0x or 0X, and an appended h or H, is disregarded. If the radix is 2, an appended b or B is disregarded. Other characters that do not belong to the number system generate an error.

Syntax

DECIMAL("tekst"; alus)

Text is the text to be converted. To differentiate between a hexadecimal number, such as A1 and the reference to cell A1, you must place the number in quotation marks, for example, "A1" or "FACE".

Radix indicates the base of the number system. It may be any positive integer between 2 and 36.

Example

=DECIMAL("17";10) tagastab 17.

=DECIMAL("FACE";16) returns 64206.

=DECIMAL("0101";2) tagastab 5.

DOLLAR

Converts a number to an amount in the currency format, rounded to a specified decimal place. In the Value field enter the number to be converted to currency. Optionally, you may enter the number of decimal places in the Decimals field. If no value is specified, all numbers in currency format will be displayed with two decimal places.

Raha vorming on määratud süsteemi sätetega.

Syntax

DOLLAR(väärtus; kümnendkohad)

Value is a number, a reference to a cell containing a number, or a formula which returns a number.

Decimals is the optional number of decimal places.

Example

=DOLLAR(255) returns $255.00.

=DOLLAR(367.456;2) returns $367.46. Use the decimal separator that corresponds to the current locale setting.

EXACT

Võrdleb kaht tekstistringi ja tagastab TÕENE, kui need on identsed. Funktsioon on tõstutundlik.

Syntax

EXACT("tekst1";"tekst2")

Text1 refers to the first text to compare.

Text2 is the second text to compare.

Example

=EXACT("microsystems";"Microsystems") returns FALSE.

FIND

Returns the position of a string of text within another string.You can also define where to begin the search. The search term can be a number or any string of characters. The search is case-sensitive.

Syntax

FIND("otsingutekst"; "tekst"; asukoht)

FindText refers to the text to be found.

Text is the text where the search takes place.

Position (optional) is the position in the text from which the search starts.

Example

=FIND(76;998877665544) returns 6.

FIXED

Tagastab arvu teksti kujul koos määratud arvu kohtadega pärast koma ja mittekohustusliku tuhandeliste eraldajaga.

Syntax

FIXED(arv; komakohad; tuhandeliste eraldaja puudub)

Number refers to the number to be formatted.

Decimals refers to the number of decimal places to be displayed.

NoThousandsSeparators (optional) determines whether the thousands separator is used. If the parameter is a number not equal to 0, the thousands separator is suppressed. If the parameter is equal to 0 or if it is missing altogether, the thousands separators of your current locale setting are displayed.

Example

=FIXED(1234567.89;3) returns 1,234,567.890 as a text string.

=FIXED(1234567,89;3;1) tagastab tekstistringina 1234567,890.

JIS

Funktsioon JIS teisendab poollaiusega ASCII ja katakana märgid täislaiusega märkideks. Tulemuseks on tekstistring.

See https://wiki.documentfoundation.org/Calc/Features/JIS_and_ASC_functions for a conversion table.

Syntax

JIS("tekst")

Tekst on teisendatavaid märke sisaldav tekst.

Vaata ka funktsiooni ASC.

LEFT

Tagastab tekstistringi esimese märgi või märgid.

Syntax

LEFT("tekst"; arv)

Text is the text where the initial partial words are to be determined.

Number (optional) specifies the number of characters for the start text. If this parameter is not defined, one character is returned.

Example

=LEFT("väljund";3) tagastab "väl".

LEFTB

Returns the first characters of a DBCS text.

Syntax

LEFTB("Text"; Number_bytes)

Text is the text where the initial partial words are to be determined.

Number_bytes (optional) specifies the number of characters you want LEFTB to extract, based on bytes. If this parameter is not defined, one character is returned.

Example

LEFTB("中国";1) returns " " (1 byte is only half a DBCS character and a space character is returned instead).

=TODAY() tagastab arvuti praeguse kuupäeva.

LEFTB("中国";3) returns "中 " (3 bytes constitute one DBCS character and a half; the last character returned is therefore a space character).

=TODAY() tagastab arvuti praeguse kuupäeva.

=QUOTIENT(11;3) tagastab 3. Jääk 2 jäetakse kõrvale.

LEN

Tagastab stringi pikkuse märkides, tühikud kaasa arvatud.

Syntax

LEN("tekst")

Text is the text whose length is to be determined.

Example

=LEN("Good Afternoon") returns 14.

=LEN(12345.67) returns 8.

LENB

For double-byte character set (DBCS) languages, returns the number of bytes used to represent the characters in a text string.

Syntax

LENB("Text")

Text is the text whose length is to be determined.

Example

=COSH(0) tagastab 1, arvu 0 hĂĽperboolse koosinuse.

=COSH(0) tagastab 1, arvu 0 hĂĽperboolse koosinuse.

=COSH(0) tagastab 1, arvu 0 hĂĽperboolse koosinuse.

=LENB("Good Afternoon") returns 14.

=LENB(12345.67) returns 8.

LOWER

Muudab kõik tekstistringi tähed väiketähtedeks.

Syntax

LOWER("tekst")

Text refers to the text to be converted.

Example

=LOWER("Päike") tagastab "päike".

MID

Tagastab tekstilõigu stringi. Vastuse alguskoht ja märkide arv on määratud argumentidega.

Syntax

MID("tekst"; algus; arv)

Text is the text containing the characters to extract.

Start is the position of the first character in the text to extract.

Number specifies the number of characters in the part of the text.

Example

=MID("office";2;2) returns ff.

MIDB

Returns a text string of a DBCS text. The parameters specify the starting position and the number of characters.

Syntax

MIDB("Text"; Start; Number_bytes)

Text is the text containing the characters to extract.

Start is the position of the first character in the text to extract.

Number_bytes specifies the number of characters MIDB will return from text, in bytes.

Example

=T(12345) tagastab tĂĽhja stringi.

MIDB("中国";1;1) returns " " (1 byte is only half a DBCS character and therefore the result is a space character).

=TODAY() tagastab arvuti praeguse kuupäeva.

MIDB("中国";1;3) returns "中 " (3 bytes constitute one and a half DBCS character; the last byte results in a space character).

=TODAY() tagastab arvuti praeguse kuupäeva.

MIDB("中国";2;1) returns " " (byte position 2 is not at the beginning of a character in a DBCS string; 1 space character is returned).

MIDB("中国";2;2) returns " " (byte position 2 points to the last half of the first character in the DBCS string; the 2 bytes asked for therefore constitutes the last half of the first character and the first half of the second character in the string; 2 space characters are therefore returned).

MIDB("中国";2;3) returns " 国" (byte position 2 is not at the beginning of a character in a DBCS string; a space character is returned for byte position 2).

MIDB("中国";3;1) returns " " (byte position 3 is at the beginning of a character in a DBCS string, but 1 byte is only half a DBCS character and a space character is therefore returned instead).

MIDB("中国";3;2) returns "国" (byte position 3 is at the beginning of a character in a DBCS string, and 2 bytes constitute one DBCS character).

MIDB("office";2;3) returns "ffi" (byte position 2 is at the beginning of a character in a non-DBCS string, and 3 bytes of a non-DBCS string constitute 3 characters).

PROPER

Muudab kõikide stringi sõnade esitähe suurtäheks.

Syntax

PROPER("tekst")

Text refers to the text to be converted.

Example

=PROPER("open office") returns Open Office.

REPLACE

Asendab tekstistringi osa teise stringiga. Funktsiooniga saab asendada nii teksti kui arve (arvud teisendatakse seejuures automaatselt tekstiks). Funktsiooni tulemuseks on alati tekst. Vajadusel teostada selle funktsiooni abil töödeldud arvuga edasisi tehteid, tuleb see funktsiooniga VALUE teisendada tagasi arvuks.

Kõik arve sisaldavad tekstid tuleb panna jutumärkide vahele, kui neid ei soovita käsitleda arvudena ja lasta automaatselt tekstiks teisendada.

Syntax

REPLACE("tekst"; koht; pikkus; "uus tekst")

Text refers to text of which a part will be replaced.

Position refers to the position within the text where the replacement will begin.

Length is the number of characters in Text to be replaced.

NewText refers to the text which replaces Text.

Example

=REPLACE("1234567";1;1;"444") returns "444234567". One character at position 1 is replaced by the complete NewText.

REPT

Kordab stringi määratud arv korda.

Syntax

REPT("tekst"; arv)

Text is the text to be repeated.

Number is the number of repetitions.

Tulemuse pikkus võib olla kuni 255 märki.

Example

=REPT("Good morning";2) returns Good morningGood morning.

RIGHT

Tagastab tekstistringi viimase märgi või märgid.

Syntax

RIGHT("tekst"; arv)

Text is the text of which the right part is to be determined.

Number (optional) is the number of characters from the right part of the text.

Example

=RIGHT("Päike";2) tagastab "ke".

RIGHTB

Returns the last character or characters of a text with double bytes characters sets (DBCS).

Syntax

RIGHTB("Text"; Number_bytes)

Text is the text of which the right part is to be determined.

Number_bytes (optional) specifies the number of characters you want RIGHTB to extract, based on bytes.

Example

RIGHTB("中国";1) returns " " (1 byte is only half a DBCS character and a space character is returned instead).

=TODAY() tagastab arvuti praeguse kuupäeva.

RIGHTB("中国";3) returns " 国" (3 bytes constitute one half DBCS character and one whole DBCS character; a space is returned for the first half).

=TODAY() tagastab arvuti praeguse kuupäeva.

=COSH(0) tagastab 1, arvu 0 hĂĽperboolse koosinuse.

ROMAN

Teisendab arvu rooma numbriks. Arvu väärtus peab olema vahemikus 0 kuni 3999, režiim võib olla täisarv 0 kuni 4.

Syntax

ROMAN(arv; reĹľiim)

Arv on Rooma numbritesse teisendatav arv.

Režiim (mittekohustuslik) näitab lihtsustuse astet. Mida kõrgem selle väärtus, seda enam Rooma numbreid lihtsustatakse.

Example

=ROMAN(999) tagastab CMXCIX

=ROMAN(999;0) tagastab CMXCIX

=ROMAN (999;1) returns LMVLIV

=ROMAN(999;2) tagastab XMIX

=ROMAN(999;3) tagastab VMIV

=ROMAN(999;4) tagastab IM

SEARCH

Returns the position of a text segment within a character string. You can set the start of the search as an option. The search text can be a number or any sequence of characters. The search is not case-sensitive. If the text is not found, returns error 519 (#VALUE).

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

SEARCH("otsingutekst"; "tekst"; asukoht)

FindText is the text to be searched for.

Text is the text where the search will take place.

Position (optional) is the position in the text where the search is to start.

Example

=SEARCH(54;998877665544) returns 10.

SUBSTITUTE

Asendab määratud sisuga tekstiosad asendustekstiga.

Syntax

SUBSTITUTE("tekst"; "otsingutekst"; "uus tekst"; koht)

Text is the text in which text segments are to be exchanged.

SearchText is the text segment that is to be replaced (a number of times).

NewText is the text that is to replace the text segment.

Occurrence (optional) indicates which occurrence of the search text is to be replaced. If this parameter is missing the search text is replaced throughout.

Example

=SUBSTITUTE("123123123";"3";"abc") returns 12abc12abc12abc.

=SUBSTITUTE("123123123";"3";"abc";2) returns 12312abc123.

T

Funktsioon tagastab teksti korral teksti, vastasel juhul tĂĽhja stringi.

Syntax

T(väärtus)

Kui väärtus on tekstistring või viide sellele, tagastab T selle tekstistringi, vastasel juhul tagastatakse tühi tekstistring.

Example

=T(12345) returns an empty string.

=T("12345") tagastab stringi 12345.

TEXT

Teisendab arvu tekstiks vastavalt antud vormingule.

Syntax

TEXT(arv; vorming)

Number is the numerical value to be converted.

Format is the text which defines the format. Use decimal and thousands separators according to the language set in the cell format.

Example

=TEXT(12,34567;"###,##") tagastab tekstistringi 12,35

=TEXT(12,34567;"000,00") tagastab tekstistringi 012,35

Nõuande ikoon

See also Number format codes: custom format codes defined by the user.


TRIM

Eemaldab stringist tühikud, jättes alles ainult ühekordsed tühikud sõnade vahel.

Syntax

TRIM("tekst")

Text refers to text in which spaces are to be removed.

Example

=TRIM(" hello world ") returns hello world without leading and trailing spaces and with single space between words.

UNICHAR

Teisendab koodarvu Unicode'i märgiks või täheks.

Syntax

UNICHAR(number)

Example

=UNICHAR(169) tagastab autoriõiguse märgi ©.

Nõuande ikoon

See also the UNICODE() function.


UNICODE

Tagastab tekstistringi esimese Unicode'i märgi arvulise koodi.

Syntax

UNICODE("Text")

Example

=UNICODE("©") tagastab Unicode'i koodi 169, mis tähistab autoriõiguse märki.

Nõuande ikoon

See also the UNICHAR() function.


UPPER

Muudab argumendiga tekst määratud stringi tähed suurtähtedeks.

Syntax

UPPER("tekst")

Text refers to the lower case letters you want to convert to upper case.

Example

=UPPER("Good Morning") returns GOOD MORNING.

VALUE

Teisendab tekstistringi arvuks.

Syntax

VALUE("tekst")

Text is the text to be converted to a number.

Example

=VALUE("4321") tagastab 4321.