Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions

  




 

 

OpenOffice Calc User Guide
Previous Page Home Next Page

Text functions

Use Calc’s text functions to search and manipulate text strings or character codes.

Table 20: Text functions

Syntax

Description

ARABIC(text)

Calculates the value of a Roman number. The value range must be between 0 and 3999. Text is the text that represents a Roman number.

BASE(number; radix; [minimum_length])

Converts a positive integer to a specified base then into text using the characters from the base's numbering system (decimal, binary, hexadecimal, etc.). Only the digits 0-9 and the letters A-Z are used. Number is the positive integer to be converted. Radix is the base of the number system. It may be any positive integer between 2 and 36. Minimum_length (optional) is 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.

CHAR(number)

Converts a number into a character according to the current code table. The number can be a two-digit or three-digit integer number. Number is a number between 1 and 255 representing the code value for the character.

CLEAN(text)

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

CODE(text)

Returns a numeric code for the first character in a text string. Text is the text for which the code of the first character is to be found.

CONCATENATE(text_1; text_2; ...; text_30)

Combines several text strings into one string. Text_1; text_2; ... text_30 are text passages that are to be combined into one string.

DECIMAL(text; radix)

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. Text is the text to be converted. To differentiate between a hexadecimal number, such as A1 and the reference to cell A1, 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.

DOLLAR(value; decimals)

Converts a number to an amount in the currency format, rounded to a specified decimal place. Value is the number to be converted to currency; it can be a number, a reference to a cell containing a number, or a formula which returns a number. Decimals (optional) is the number of decimal places. If no decimals value is specified, all numbers in currency format will be displayed with two decimal places. The currency format is set in the system settings.

EXACT(text_1; text_2)

Compares two text strings and returns TRUE if they are identical. This function is case-sensitive. Text_1 is the first text to compare. Text_2 is the second text to compare.

FIND(find_text; text; position)

Looks for a string of text within another string. Where to begin the search can also be defined. The search term can be a number or any string of characters. The search is case-sensitive. Find_text is 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.

FIXED(number; decimals; no_thousands_separator)

Specifies that a number be displayed with a fixed number of decimal places and with or without a thousands separator. This function can be used to apply a uniform format to a column of numbers. Number is the number to be formatted. Decimals is the number of decimal places to be displayed. No_thousands_separator (optional) determines whether the thousands separator is used or not. 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 the current locale setting are displayed.

LEFT(text; number)

Returns the first character or characters in a text string. Text is the text where the initial partial words are to be determined. Number (optional) is the number of characters for the start text. If this parameter is not defined, one character is returned.

LEN(text)

Returns the length of a string including spaces. Text is the text whose length is to be determined.

LOWER(text)

Converts all uppercase letters in a text string to lowercase. Text is the text to be converted.

MID(text; start; number)

Returns a text segment of a character string. The parameters specify the starting position and the number of characters. Text is the text containing the characters to extract. Start is the position of the first character in the text to extract. Number is the number of characters in the part of the text.

PROPER(text)

Capitalizes the first letter in all words of a text string. Text refers to the text to be converted.

REPLACE(text; position; length; new_text)

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. To perform further calculations with a number which has been replaced by text, convert it back to a number using the VALUE function. Any text containing numbers must be enclosed in quotation marks so it is not interpreted as a number and automatically converted to text. Text is text of which a part will be replaced. Position is the position within the text where the replacement will begin. Length is the number of characters in text to be replaced. New_text is the text which replaces text..

REPT(text; number)

Repeats a character string by the given number of copies. Text is the text to be repeated. Number is the number of repetitions. The result can be a maximum of 255 characters.

RIGHT(text; number)

Defines the last character or characters in a text string. 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.

ROMAN(number; mode)

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

*ROT13(text)

Encrypts a character string by moving the characters 13 positions in the alphabet. After the letter Z, the alphabet begins again (Rotation). Applying the encryption function again to the resulting code, decrypts the text. Text: Enter the character string to be encrypted. ROT13(ROT13(Text)) decrypts the code.

SEARCH(find_text; text; position)

Returns the position of a text segment within a character string. The start of the search can be set as an option. The search text can be a number or any sequence of characters. The search is not case-sensitive. The search supports regular expressions. Find_text 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.

SUBSTITUTE(text; search_text; new text; occurrence)

Substitutes new text for old text in a string. Text is the text in which text segments are to be exchanged. Search_text is the text segment that is to be replaced (a number of times). New text is the text that is to replace the text segment. Occurrence (optional) indicates how many occurrences of the search text are to be replaced. If this parameter is missing, the search text is replaced throughout.

T(value)

Converts a number to a blank text string. Value is the value to be converted. Also, a reference can be used as a parameter. If the referenced cell includes a number or a formula containing a numerical result, the result will be an empty string.

TEXT(number; format)

Converts a number into text according to a given 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.

TRIM(text)

Removes spaces that are in front of a string, or aligns cell contents to the left. Text refers to text in which leading spaces are removed, or to the cell in which the contents will be left-aligned.

UPPER(text)

Converts the string specified in the text parameter to uppercase. Text refers to the lower case letters you want to convert to upper case.

VALUE(text)

Converts a text string into a number. Text is the text to be converted to a number.

OpenOffice Calc User Guide
Previous Page Home Next Page

 
 
  Published under the terms of the Open Publication License Design by Interspire