VwkgH‖

7ZrHE‖Text Functions

zUHLY‖This section contains descriptions of the Text functions.

To access this command...

Insert - Function - Category Text


Yb8u7‖

XXyWj‖Using double quotation marks in formulas

aGDFQ‖To include a text string in a formula, place the text string between two double quotation marks (") and Calc takes the characters in the string without attempting to interpret them. For example, the formula ="Hello world!" displays the text string Hello world! in the cell, with no surrounding double quotation marks.

HCwEU‖The more complex formula =CONCATENATE("Life is really simple, "; "but we insist on making it complicated "; "(Confucius).") concatenates three individual strings in double quotation marks, outputting Life is really simple, but we insist on making it complicated (Confucius).

XBDt9‖To place a literal double quotation mark within a string inside a formula, two methods can be used:

  1. 8qFEv‖You can "escape" the double quotation mark with an additional double quotation mark, and Calc treats the escaped double quotation mark as a literal value. For example, the formula ="My name is ""John Doe""." outputs the string My name is "John Doe". Another simple example is the formula =UNICODE("""") which returns 34, the decimal value of the Unicode quotation mark character (U+0022) — here the first and fourth double quotation marks indicate the beginning and end of the string, while the second double quotation mark escapes the third.

  2. MfLZn‖You can use the CHAR function or the UNICHAR function to insert a double quotation mark. For example, the formula =UNICHAR(34) & "The Catcher in the Rye" & UNICHAR(34) & " is a famous book by J. D. Salinger." displays the string "The Catcher in the Rye" is a famous book by J. D. Salinger.

wDvCT‖Be aware that Calc's AutoCorrect function may modify double quotation marks. AutoCorrect should not change the double quotation marks within formula cells but may change those used in non-formula cells containing text. For example, if you copy a string that is surrounded by some other form of typographical double quotation marks, such as the left double quotation mark (U+201C) and the right double quotation mark (U+201D), and then paste into a formula cell, an error may result. Open the Double Quotes area of the Tools - AutoCorrect Options - Localized Options dialog to set the characters used to automatically correct the start and end typographical double quotation marks. Uncheck the Replace toggle button to disable the feature.

mtsYd‖Empty string and blank cells

J56DC‖Cells with the empty string ("") are not equivalent to blank cells. When searching or calculating with text, the empty string "" is the text with length zero.

X2gVW‖For example, when the formula in A1 returns the empty string "", the following applies:

CAh4t‖=ISBLANK(A1) returns FALSE. The cell is not blank.

ugD6W‖=ISFORMULA(A1) returns TRUE. The cell is a formula.

ypsic‖=ISLOGICAL(A1) returns FALSE. Not a logical value.

5vBHz‖=ISNONTEXT(A1) returns FALSE. The cell has the empty string.

Z7cMy‖=ISNUMBER(A1) returns FALSE. Not a number.

Vcmm7‖=ISTEXT(A1) returns TRUE. The cell has the empty string, calculated by a formula.

xDUEz‖=LEN(A1) returns 0. The length of the empty string is 0.

ku3Gp‖ARABIC

xPXrU‖Returns the numeric value corresponding to a Roman number expressed as text.

4QDi7‖ASC

gtGVG‖Converts double-byte (full-width) characters to single-byte (half-width) ASCII and katakana characters.

GbNBh‖ BAHTTEXT

DBGfP‖Converts a number to Thai text, including the Thai currency names.

9azqb‖ BASE

Xssin‖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.

EaKPp‖ CHAR

ArZC4‖Converts a number into a character according to the current code table. The number can be a two-digit or three-digit integer number.

GsBYz‖ CLEAN

gQ9yL‖ All non-printing characters are removed from the string.

AbKCo‖ CODE

Bb562‖ Returns a numeric code for the first character in a text string.

j3X3f‖ CONCATENATE

4hKRK‖ Combines several text strings into one string.

tNiR4‖ DECIMAL

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

wmWdH‖ DOLLAR

EzjoV‖Converts a number to a string representing the amount in the currency format, rounded to a specified decimal places, using the decimal separator that corresponds to the current locale setting. In the Value field enter the number to be converted. 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.

6KQxC‖ EXACT

kGvM7‖Compares two text strings and returns TRUE if they are identical. This function is case-sensitive.

iZjp9‖ FIND

A8LEF‖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.

j9tYW‖ FIXED

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

v8tni‖JIS

3XKQ3‖Converts single-byte (half-width) ASCII or katakana characters to double-byte (full-width) characters.

EMZSo‖ LEFT

HyF5H‖ Returns the first character or characters of a text.

b7UGd‖LEFTB

wevX6‖Returns the first characters of a DBCS text.

gAC88‖ LEN

SQBeA‖ Returns the length of a string including spaces.

jUtWq‖LENB

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

Cs9ci‖ LOWER

XZq2v‖ Converts all uppercase letters in a text string to lowercase.

tchFE‖ MID

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

PEZYE‖MIDB

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

PTzXC‖ PROPER

DAs3P‖ Capitalizes the first letter in all words of a text string.

nqtH7‖REGEX

uTy7w‖Matches and extracts or optionally replaces text using regular expressions.

44TfH‖ REPLACE

XdnQ3‖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.

yArxm‖ REPT

zvBCG‖ Repeats a character string by the given number of copies.

sCdXr‖ RIGHT

AywGp‖ Returns the last character or characters of a text.

nhEQs‖RIGHTB

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

aXrXe‖ROMAN

pdMgk‖Converts a number into a Roman numeral. The value range must be between 0 and 3999. A simplification mode can be specified in the range from 0 to 4.

GKBG3‖ SEARCH

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

jDq6a‖ SUBSTITUTE

mfNmg‖ Substitutes new text for old text in a string.

LFXux‖ T

D6qQF‖ This function returns the target text, or a blank text string if the target is not text.

7QRS7‖ TEXT

J4ppx‖ Converts a value into text according to a given format.

6AGrs‖ TRIM

BYBBg‖ Removes spaces from a string, leaving only a single space character between words.

Udij5‖ UNICHAR

DpQMN‖ Converts a code number into a Unicode character or letter.

6CD6G‖ UNICODE

Lonme‖ Returns the numeric code for the first Unicode character in a text string.

9feuC‖ UPPER

dEnYo‖ Converts the string specified in the text field to uppercase.

F39J8‖VALUE

BZ7SU‖Converts the string representation of a number to numeric form. If the supplied string is a valid date, time, or date-time, the corresponding date-time serial number is returned.

4hhWq‖WEBSERVICE

NXAzC‖Get some web content from a URI.

tSXAu‖FILTERXML

2zvQv‖Apply a XPath expression to a XML document.

DBC4X‖ENCODEURL

K5FwD‖Returns a URL-encoded string.