Table of Contents
Text Functions
This section contains descriptions of the Text functions.
ARABIC
- Calculates the value of a Roman number. The value range must be between 0 and 3999.
Syntax
ARABIC(“Text”) - Text is the text that represents a Roman number.
=ARABIC(“MXIV”) returns 1014
=ARABIC(“MMII”) returns 2002
BASE
- Converts a positive integer to a specified base into a text from the numbering system. The digits 0-9 and the letters A-Z are used.
Syntax
BASE(Number; Radix; [MinimumLength]) - 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.
=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
- Converts a number into a character according to the current code table. The number can be a two-digit or three-digit integer number.
- Codes greater than 127 may depend on your system’s character mapping (for example iso-8859-1, iso-8859-2, Windows-1252, Windows-1250), and hence may not be portable.
Syntax
CHAR(Number) - Number is a number between 1 and 255 representing the code value for the character.
=CHAR(100) returns the character d.
=”abc” & CHAR(10) & “def” inserts a newline character into the string.
CLEAN
- All non-printing characters are removed from the string.
Syntax
CLEAN(“Text”) - Text refers to the text from which to remove all non-printable characters.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.
CONCATENATE
- Combines several text strings into one string.
Syntax
CONCATENATE(“Text1”; …; “Text30”) - Text 1; Text 2; … represent up to 30 text passages which are to be combined into one string.
=CONCATENATE(“Good “;”Morning “;”Mrs. “;”Doe”) returns: Good Morning Mrs. Doe.
DECIMAL
- 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.
Syntax
DECIMAL(“Text”; Radix) - 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.
=DECIMAL(“17”;10) returns 17.
=DECIMAL(“FACE”;16) returns 64206.
=DECIMAL(“0101”;2) returns 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.
- You set the currency format in your system settings.
Syntax
DOLLAR(Value; Decimals) - 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.
=DOLLAR(255) returns $255.00.
=DOLLAR(367.456;2) returns $367.46. Use the decimal separator that corresponds to the current locale setting.
EXACT
- Compares two text strings and returns TRUE if they are identical. This function is case-sensitive.
Syntax
EXACT(“Text1”; “Text2”) - Text1 refers to the first text to compare.
- Text2 is the second text to compare.
=EXACT(“microsystems”;”Microsystems”) returns FALSE.
LEFT
- Returns the first character or characters of a text.
Syntax
LEFT(“Text”; Number) - 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.
=LEFT(“output”;3) returns “out”.
LEN
- Returns the length of a string including spaces.
Syntax
LEN(“Text”) - Text is the text whose length is to be determined.
=LEN(“Good Afternoon”) returns 14.
=LEN(12345.67) returns 8.
LOWER
- Converts all uppercase letters in a text string to lowercase.
Syntax
LOWER(“Text”) - Text refers to the text to be converted.
=LOWER(“Sun”) returns sun.
MID
- Returns a text string of a text. The parameters specify the starting position and the number of characters.
Syntax
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.
=MID(“office”;2;2) returns ff.
PROPER
- Capitalizes the first letter in all words of a text string.
Syntax
PROPER(“Text”) - Text refers to the text to be converted.
=PROPER(“open office”) returns Open Office.
REPLACE
- 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.
Syntax
REPLACE(“Text”; Position; Length; “NewText”) - 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.
=REPLACE(“1234567″;1;1;”444”) returns “444234567”. One character at position 1 is replaced by the complete NewText.
REPT
- Repeats a character string by the given number of copies.
Syntax
REPT(“Text”; Number) - Text is the text to be repeated.
- Number is the number of repetitions.
- The result can be a maximum of 255 characters.
=REPT(“Good morning”;2) returns Good morningGood morning.
RIGHT
- Returns the last character or characters of a text.
Syntax
RIGHT(“Text”; Number) - 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.
=RIGHT(“Sun”;2) returns un.
ROMAN
- Converts a number into a Roman numeral. The value range must be between 0 and 3999, the modes can be integers from 0 to 4.
Syntax
ROMAN(Number; Mode) - 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.
=ROMAN(999) returns CMXCIX
=ROMAN(999;0) returns CMXCIX
=ROMAN (999;1) returns LMVLIV
=ROMAN(999;2) returns XMIX
=ROMAN(999;3) returns VMIV
=ROMAN(999;4) returns IM
T
- This function returns the target text, or a blank text string if the target is not text.
Syntax
T(Value) - If Value is a text string or refers to a text string, T returns that text string; otherwise it returns a blank text string.
=T(12345) returns an empty string.
=T(“12345”) returns the string 12345.
TEXT
- Converts a number into text according to a given format.
Syntax
TEXT(Number; Format) - 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.
=TEXT(12.34567;”###.##”) returns the text 12.35
=TEXT(12.34567;”000.00″) returns the text 012.35
TRIM
- Removes spaces from a string, leaving only a single space character between words.
Syntax
TRIM(“Text”) - Text refers to text in which spaces are to be removed.
=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.
Syntax
UNICHAR(number)
=UNICHAR(169) returns the Copyright character ©.
UNICODE
- Returns the numeric code for the first Unicode character in a text string.
Syntax
UNICODE(“Text”)
=UNICODE(“©”) returns the Unicode number 169 for the Copyright character.
UPPER
- Converts the string specified in the text field to uppercase.
Syntax
UPPER(“Text”) - Text refers to the lower case letters you want to convert to upper case.
=UPPER(“Good Morning”) returns GOOD MORNING.
VALUE
- Converts a text string into a number.
Syntax
VALUE(“Text”) - Text is the text to be converted to a number.Text is the text to be converted to a number.
=VALUE(“4321”) returns 4321.