What is a TEXT formula in a spreadsheet?
Text formulas and functions are designed for manipulating and formatting text strings. They allow you to concatenate text, extract substrings, convert text cases, replace characters, perform string manipulations, and format text according to specific requirements.
TEXT formula usage examples.
The CLEAN function is used to remove non-printable ASCII characters from a given text. Non-printable characters include characters with ASCII codes 0-31 and 127. These characters are typically not visible and can cause issues when working with text data. The CLEAN function replaces these characters with a space character, except for line breaks, which are preserved. The function takes a single argument, the text string from which to remove the non-printable characters.
The FINDB function is used to find the position at which a string is first found within text, counting each double-character as 2. It returns the position as a number. The optional 'starting_at' argument specifies the character position at which the search should start. If not provided, the search starts from the beginning of the text.
The FIXED function is used to format a number with a fixed number of decimal places. It takes three arguments: 'number' is the number to be formatted, 'number_of_places' is the desired number of decimal places, and 'suppress_separator' is an optional argument to suppress the thousands separator. The function returns the formatted number as text.
The LEFT function returns a substring from the beginning of a specified string. It takes two arguments: the string from which to extract the substring, and the number of characters to extract. If the number of characters is not specified, it defaults to 1. The function is commonly used to extract the leftmost characters of a string or to split a string based on a delimiter.
The REGEXEXTRACT function is used to extract matching substrings from a text string based on a specified regular expression pattern. It takes two arguments: the text string to search in and the regular expression pattern to match. The function returns the first substring that matches the pattern. If no match is found, it returns an empty string. The regular expression pattern can be used to define complex matching patterns, allowing for flexible and powerful text extraction.
The REGEXMATCH function is used to determine whether a piece of text matches a regular expression. It returns TRUE if the text matches the regular expression, and FALSE otherwise. The regular expression can be a simple pattern or a more complex expression. This function is useful for tasks such as validating input data, searching for specific patterns in text, or filtering data based on a pattern match.
The REGEXREPLACE function is used to replace part of a text string with a different text string using regular expressions. It takes three arguments: the original text, the regular expression pattern to match, and the replacement text. The function searches for all occurrences of the regular expression pattern in the original text and replaces them with the replacement text.
The REPLACE function is used to replace part of a text string with a different text string. It takes four arguments: 'text' is the original text string, 'position' is the starting position of the text to be replaced, 'length' is the number of characters to be replaced, and 'new_text' is the text string to replace the specified part with.
The REPLACEB function is used to replace part of a text string, based on a number of bytes, with a different text string. It takes four arguments: 'text' is the original text string, 'position' is the starting position of the part to be replaced, 'num_bytes' is the number of bytes to be replaced, and 'new_text' is the text string to replace the specified part.
The RIGHT function returns a substring from the end of a specified string. It takes two arguments: the string from which to extract the substring, and the number of characters to extract. If the number of characters is not specified, it defaults to 1. The function starts from the rightmost character of the string and extracts the specified number of characters.
The SEARCH function is used to find the position at which a specified substring is first found within a given text. It returns the starting position of the substring within the text. The function is case-sensitive by default, but can be made case-insensitive by specifying a non-zero value for the optional 'starting_at' parameter.
The SPLIT function divides text around a specified character or string, and puts each fragment into a separate cell in the row. It takes the following parameters: - text: The text to be split. - delimiter: The character or string that specifies where to split the text. - split_by_each (optional): A logical value that determines whether to split the text by each occurrence of the delimiter. If set to TRUE, the text will be split by each occurrence of the delimiter. If set to FALSE or omitted, the text will be split by the first occurrence of the delimiter. - remove_empty_text (optional): A logical value that determines whether to remove empty text fragments from the result. If set to TRUE, empty text fragments will be removed. If set to FALSE or omitted, empty text fragments will be included in the result.
The SUBSTITUTE function is used to replace existing text with new text in a string. It takes four arguments: 'text_to_search' is the original string, 'search_for' is the text to be replaced, 'replace_with' is the new text to replace with, and 'occurrence_number' (optional) specifies which occurrence of 'search_for' to replace. If 'occurrence_number' is not provided, all occurrences of 'search_for' will be replaced.
The T function is used to return string arguments as text. It takes a single argument and returns the argument as text. If the argument is already text, it is returned as is. If the argument is a number, it is converted to text. If the argument is a boolean value, 'TRUE' or 'FALSE' is returned as text. If the argument is an error value, the error value is returned as text. If the argument is empty, an empty string is returned.
The TEXT function is used to convert a number into text according to a specified format. It allows you to customize the appearance of numbers, dates, and other values in Excel. The function takes two arguments: 'number' which is the value you want to convert, and 'format' which specifies the format you want to apply to the value. The 'format' argument uses special codes to represent different elements such as currency symbols, decimal places, and date formats.