Excel Text Functions
Excel Text Functions
Example:
=CONCATENATE(A1, " ", B1) // Concatenates the contents of cells A1 and B1 with a space in between.
LEFT
Example:
=LEFT(A1, 3) // Returns the leftmost 3 characters from the text in cell A1.
RIGHT
Example:
=RIGHT(A1, 6) // Returns the rightmost 6 characters from the text in cell A1.
MID
Example:
LEN
Syntax: LEN(text)
Example:
Example:
=FIND("apple", A1, 2) // Searches for "apple" in cell A1 starting at the 2nd position.
REPLACE
Example:
=REPLACE(A1, 2, 3, "New") // Replaces characters in cell A1 starting at the 2nd position with "New."
TRIM
Syntax: TRIM(text)
Example:
=TRIM(" Excel ") // Removes leading and trailing spaces, resulting in "Excel"
SUBSTITUTE
Example:
=SUBSTITUTE(A1, "apple", "orange", 2) // Replaces the second occurrence of "apple" with "orange" in cell A1.
TEXT
Syntax: TEXT(value, format_text)
Example:
=TEXT(A1, "0.00") // Formats the number in cell A1 with two decimal places.
CONVERT
Example:
=CONVERT(A1, "km", "mi") // Converts the value in cell A1 from kilometers to miles.
EXACT
Example:
=EXACT("Excel", "excel") // Returns FALSE because the two strings are not exactly the same case-sensitive.
=EXACT(A1, B1) // Checks if the text in cells A1 and B1 are exactly the same.
SEARCH
Example:
=SEARCH("Excel", "Microsoft Excel is powerful") // Returns 11, as "Excel" starts at the 11th position.
=SEARCH("dog", A1, 3) // Searches for "dog" in cell A1 starting at the 3rd position.
CLEAN
Syntax: CLEAN(text)
Example:
=CLEAN("This is a" & CHAR(7) & "test.") // Removes non-printable characters and returns "This is a test."
CHAR
Syntax: CHAR(number)
Example:
=CHAR(65) // Returns "A" because the character code 65 corresponds to the letter "A" in the ASCII character set.
Syntax: UNICODE(text)
=UNICODE("こんにちは") // Returns 12371 because it represents the Unicode value of the first character "こ" in
the Japanese greeting.