Text Functions

This section contains descriptions of the Text functions.

For å bruke denne funksjonen …

Sett inn → Funksjon → Kategori Tekst


ARABISK (ARABIC på engelsk)

Regner ut verdien av et romertall. Verdiområdet må være mellom 0 og 3999.

Syntaks

ARABISK("Tekst")

Tekst er teksten som tilsvarer et romertall.

Eksempel

=ELLER(A; B) gir SANN

=ELLER(A; B) gir SANN

ASC

The ASC function converts full-width to half-width ASCII and katakana characters. Returns a text string.

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

Syntaks

ASC("Text")

Text is the text that contains characters to be converted.

Se også JIS-funksjonen.

BAHTTEKST

Gjør om et tall til Thaitekst, inklusive Thaivalutanavn.

Syntaks

BAHTTEKST(Tall)

Number is any number. "Baht" is appended to the integral part of the number, and "Satang" is appended to the decimal part of the number.

Eksempel

=BAHTTEXT(12.65) returns a string in Thai characters with the meaning of "Twelve Baht and sixty five Satang".

BASE

Gjør om et positivt heltall til en tekst i et bestemt tallsystem. Tallene 0-9 og bokstavene A-Z brukes.

Syntaks

BASE(Tall; Grunntall; [MinimumLength])

Tekst er teksten som tilsvarer et romertall.

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.

Eksempel

=ELLER(A; B) gir SANN

=ELLER(A; B) gir SANN

=ELLER(A; B) gir SANN

BYTT.UT (SUBSTITUTE på engelsk)

Erstatter en tekst med en ny tekst i en streng.

Syntaks

BYTT.UT("Tekst"; "SøkeTekst"; "NyTekst"; Forekomst)

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.

Eksempel

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

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

DESIMAL

Converts text with characters from a number system to a positive integer in the base radix given. The radix must be in the range 2 to 36. Spaces and tabs are ignored. The Text field is not case-sensitive.

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.

Syntaks

DESIMAL("Tekst"; Grunntall)

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.

Eksempel

=RADER(A10:B12) gir 3.

=RADER(A10:B12) gir 3.

=RADER(A10:B12) gir 3.

ERSTATT (REPLACE på engelsk)

Replaces part of a text string with a different text string. This function can be used to replace both characters and numbers (which are automatically converted to text). The result of the function is always displayed as text. If you intend to perform further calculations with a number which has been replaced by text, you will need to convert it back to a number using the VALUE function.

Any text containing numbers must be enclosed in quotation marks if you do not want it to be interpreted as a number and automatically converted to text.

Syntaks

ERSTATT("Tekst"; Plassering; Lengde; "NyTekst")

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.

Eksempel

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

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.

Syntaks

SØK("FinnTekst"; "Tekst"; Plassering)

Tekst er teksten som tilsvarer et romertall.

Text is the text where the search takes place.

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

Eksempel

=FIND(76;998877665544) returns 6.

FIXED

Returns a number as text with a specified number of decimal places and optional thousands separators.

Syntaks

FIXED(Number; Decimals; NoThousandsSeparators)

Tekst er teksten som tilsvarer et romertall.

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.

Eksempel

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

=FIXED(1234567.89;3;1) returns 1234567.890 as a text string.

GJENTA (REPT på engelsk)

Denne funksjonen gjentar en tekststreng et visst antall ganger.

Syntaks

GJENTA("Tekst"; Antall)

Tekst er teksten som tilsvarer et romertall.

Tekst er teksten som tilsvarer et romertall.

Resultatet kan høyst være 255 tegn.

Eksempel

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

HØYRE (RIGHT på engelsk)

Gir tegnene lengst til høyre i en tekst.

Syntaks

HØYRE("Tekst"; Antall)

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.

Eksempel

=RADER(A10:B12) gir 3.

JIS

The JIS function converts half-width to full-width ASCII and katakana characters. Returns a text string.

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

Syntaks

TRIM("Tekst")

Text is the text that contains characters to be converted.

Se også funksjonen ASC.

KJEDE.SAMMEN (CONCATENATE på engelsk)

Slå sammen flere tekststrenger til en streng.

Syntaks

KJEDE.SAMMEN(Tekst1; ...; Tekst30)

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

Eksempel

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

KODE (CODE på engelsk)

Gir en tallkode for det første tegnet i en tekststreng.

Syntaks

KODE("Tekst")

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

Koder større end 127 kan være avhengig av ditt systems tegnsett (for eksempel iso-8859-1, iso-8859-2, Windows-1252, Windows-1250), og som følge muligens ikke være kompatibel andre.

Eksempel

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

Merknadsikon

Koden, som brukes her refererer ikke til ASCII, men til gjeldende tegntabellen lastet inn.


LEFTB

Returnerer deiførste tegnene av en DBCS-tekst.

Syntaks

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.

Eksempler

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

LEFTB("中国";2) returns "中" (2 bytes constitute one complete DBCS character).

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

LEFTB("中国";4) returns "中国" (4 bytes constitute two complete DBCS characters).

LEFTB("office";3) returns "off" (3 non-DBCS characters each consisting of 1 byte).

LENB

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

Syntaks

LENB("Text")

Text is the text whose length is to be determined.

Eksempler

LENB("中") returns 2 (1 DBCS character consisting of 2 bytes).

LENB("中国") returns 4 (2 DBCS characters each consisting of 2 bytes).

LENB("office") returns 6 (6 non-DBCS characters each consisting of 1 byte).

=LENB("Good Afternoon") returns 14.

=LENB(12345.67) returns 8.

LENGDE (LEN på engelsk)

Gir lengden på en tekststreng medregnet mellomrom.

Syntaks

LENGDE("Tekst")

Text is the text whose length is to be determined.

Eksempel

=RADER(A10:B12) gir 3.

=RADER(A10:B12) gir 3.

MIDB

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

Syntaks

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.

Eksempler

MIDB("中国";1;0) returns "" (0 bytes is always an empty string).

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

MIDB("中国";1;2) returns "中" (2 bytes constitute one complete DBCS character).

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

MIDB("中国";1;4) returns "中国" (4 bytes constitute two complete DBCS characters).

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

MIDT

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

Syntaks

MID("Text"; Start; Number)

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.

Eksempel

=RADER(A10:B12) gir 3.

NØYAKTIG (EXACT på engelsk)

Sammenligner to tekststrenger og gir SANN hvis de er nøyaktig like, ellers USANN. Denne funksjonen skiller mellom små og store bokstaver.

Syntaks

EXACT("Text1"; "Text2")

Tekst er teksten som tilsvarer et romertall.

Tekst er teksten som tilsvarer et romertall.

Eksempel

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

OPPHØY (POWER på engelsk)

Gjør om alle store bokstaver i en tekststreng til små bokstaver.

Syntaks

LENGDE("Tekst")

Tekst er teksten som tilsvarer et romertall.

Eksempel

=ELLER(A; B) gir SANN

PROPER

Sett den første bokstaven i hvert ord i en tekststreng til stor forbokstav.

Syntaks

STORE.BOKSTAVER("Tekst")

Tekst er teksten som tilsvarer et romertall.

Eksempel

=ELLER(A; B) gir SANN

RENSK (CLEAN på engelsk)

Alle tegn som ikke skrives ut blir fjernet fra strengen.

Syntaks

RENSK("Tekst")

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

RIGHTB

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

Syntaks

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.

Eksempler

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

RIGHTB("中国";2) returns "国" (2 bytes constitute one complete DBCS character).

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

RIGHTB("中国";4) returns "中国" (4 bytes constitute two complete DBCS characters).

RIGHTB("office";3) returns "ice" (3 non-DBCS characters each consisting of 1 byte).

ROMERTALL

Gjør om et tall til et romertall. Verdiområdet må ligge mellom 0 og 3999, og modusverdien må ligge mellom 0 og 4.

Syntaks

ROMERTALL(Tall; Tilstand)

Number is the number that is to be converted into a Roman numeral.

Mode (optional) indicates the degree of simplification. The higher the value, the greater is the simplification of the Roman number.

Eksempel

=ELLER(A; B) gir SANN

=ELLER(A; B) gir SANN

=OG(A; B) gir USANN

=ELLER(A; B) gir SANN

=ELLER(A; B) gir SANN

=RADER(A10:B12) gir 3.

STORE.BOKSTAVER (UPPER på engelsk)

Gjør om en tekst til store bokstaver.

Syntaks

STORE.BOKSTAVER("Tekst")

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

Eksempel

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

SØK (SEARCH på engelsk)

Gir posisjonen til en deltekst i en tekststreng. Du kan velge startposisjonen til søket. Søketeksten kan være et tall eller en streng med tegn. Søket skiller ikke mellom store og små bokstaver.

Søket har støtte for regulære uttrykk. Du kan for eksempel skrive inn «all.*» for å finne den første forekomsten av «all» etterfølgt av hvilket tegn som helst. Hvis du vil søke etter en tekst som også er et uttrykk, må du skrive inn \ foran hvert tegn i søkeordet. Du kan slå den automatiske evalueringen av uttrykk, av og på i LibreOffice Calc → Regn ut.

Syntaks

SØK("FinnTekst"; "Tekst"; Plassering)

Tekst er teksten som tilsvarer et romertall.

Text is the text where the search will take place.

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

Eksempel

=SEARCH(54;998877665544) returns 10.

T

Denne funksjonen gir målteksten eller en tom tekststreng, hvis målet ikke er en tekst.

Syntaks

T(Verdi)

Hvis Verdi er en tekststreng eller refererer til en tekststreng, gir T denne tekststrengen; ellers gir den en tom tekststreng.

Eksempel

=T(12345) returns an empty string.

=T("12345") returns the string 12345.

TEGNKODE (CHAR på engelsk)

Gjør om et tall til et tegn i henhold til den kodetabellen som er i bruk. Nummeret kan inneholde to eller tre siffer og bare hele tall.

Koder større end 127 kan være avhengig av ditt systems tegnsett (for eksempel iso-8859-1, iso-8859-2, Windows-1252, Windows-1250), og som følge muligens ikke være kompatibel andre.

Syntaks

TEGNKODE(Tall)

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

Eksempel

=CHAR(100) returns the character d.

="abc" & CHAR(10) & "def" inserts a newline character into the string.

TEKST (TEXT på engelsk)

Gjør om et tall til et tegn i henhold til formatet som er angitt.

Syntaks

TEKST(Tall; Format)

Tekst er teksten som tilsvarer et romertall.

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

Eksempel

=TEXT(12.34567;"###.##") returns the text 12.35

=TEXT(12.34567;"000.00") returns the text 012.35

TRIM

Fjerner mellomrom fra en streng og etterlater bare et enkelt mellomromstegn mellom ord.

Syntaks

TRIM("Tekst")

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

Eksempel

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

UNICHAR

Converts a code number into a Unicode character or letter.

Syntaks

UNICHAR(number)

Eksempel

=UNICHAR(169) returns the Copyright character ©.

Tipsikon

See also the UNICODE() function.


UNICODE

Gir en tallkode for det første tegnet i en tekststreng.

Syntaks

UNICODE("Text")

Eksempel

=UNICODE("©") returns the Unicode number 169 for the Copyright character.

Tipsikon

See also the UNICHAR() function.


VALUTA (DOLLAR på engelsk)

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.

Valutaformatet stiller inn du i dine systeminnstillinger.

Syntaks

VALUTA(Verdi; Desimal)

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.

Eksempel

=DOLLAR(255) Returnerer $255.00.

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

VENSTRE

Gir tegnene lengst til venstre i en tekst.

Syntaks

GJENTA("Tekst"; Antall)

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.

Eksempel

=RADER(A10:B12) gir 3.

VERDI (VALUE på engelsk)

Gjør om en tekststreng til et tall.

Syntaks

VERDI("Tekst")

Tekst er teksten som tilsvarer et romertall.

Eksempel

=USANN() gir USANN