Excel String Functions
Excel String Functions
1. LEFT
Description: Extracts a specified number of characters from the beginning (left side) of a
string.
Formula: `=LEFT(text, num_chars)`
Example:
If cell A1 contains `"Artificial Intelligence"`, `=LEFT(A1, 10)` will return `"_____"`.
2. RIGHT
Description: Extracts a specified number of characters from the end (right side) of a string.
Formula: `=RIGHT(text, num_chars)`
Example:
If cell A1 contains `" Artificial Intelligence"`, `=RIGHT(A1,12)` will return `"_____"`.
3. MID
Description: Extracts a specified number of characters from the middle of a string, starting
at a specified position.
Formula: `=MID(text, start_num, num_chars)`
Example:
If cell A1 contains `"Artificial Intelligence"`, `=MID(A1, 1, 3)` will return `"_____"`.
4. LEN
Description: Returns the number of characters in a string.
Formula: `=LEN(text)`
Example:
If cell A1 contains `"Artificial Intelligence"`, `=LEN(A1)` will return `__`.
5. CONCATENATE or `&` Operator
Description: Combines multiple text strings into one.
Formula: `=CONCATENATE(text1, text2, ...)` or `=text1 & text2 & ...`
Example:
If cell A1 contains `" Artificial"` and cell B1 contains `" Intelligence "`,
`=CONCATENATE(A1, " ", B1)` will return `"____"`.
6. UPPER
Description: Converts all characters in a string to uppercase.
Formula: `=UPPER(text)`
Example:
If cell A1 contains `"Artificial Intelligence"`, `=UPPER(A1)` will return `"___"`.
7. LOWER
Description: Converts all characters in a string to lowercase.
Formula: `=LOWER(text)`
Example:
If cell A1 contains `"Artificial Intelligence"`, `=LOWER(A1)` will return `"_____"`.
8. PROPER
Description: Capitalizes the first letter of each word in a string.
Formula: `=PROPER(text)`
Example:
If cell A1 contains `"Artificial Intelligence"`, `=PROPER(A1)` will return `"___"`.
9. TRIM
Description: Removes extra spaces from a string, leaving only single spaces between
words.
Formula: `=TRIM(text)`
Example:
If cell A1 contains `" Artificial Intelligence "`, `=TRIM(A1)` will return `" ____`.
10. FIND
Description: Finds the starting position of a specified substring within a string (case-
sensitive).
Formula: `=FIND(find_text, within_text, [start_num])`
Example:
If cell A1 contains `"Artificial Intelligence"`, `=FIND("e", A1)` will return `_`.
11. REPLACE
Description: Replaces part of a string with another string, starting at a specified position
and with a specified length.
Formula: `=REPLACE(old_text, start_num, num_chars, new_text)`
Example:
If cell A1 contains `"Artificial Intelligence"`, `=REPLACE(A1, 7, 13, "Natural")` will
return `"________"`.
12. SUBSTITUTE
Description: Substitutes all instances of a substring within a string with another substring.
Formula: `=SUBSTITUTE(text, old_text, new_text, [instance_num])`
Example:
If cell A1 contains `" Artificial Intelligence is great"`, `=SUBSTITUTE(A1, "great",
"powerful")` will return `"___________"`.
13. FIND – Find the Position of a Substring
Formula: `=FIND("text", A1, start_pos)`
Example: If `A1` has `"Find function in Excel"`, `=FIND("function", A1)` returns `_`
(position where the word "function" starts).
14. SEARCH – Find the Position of a Substring (Case-Insensitive)
Formula: `=SEARCH("text", A1, start_pos)`
Example: If `A1` contains `"Case Sensitive Search"`, `=SEARCH("sensitive", A1)` returns
`_`.
15. REPLACE – Replace Part of a Text String
Formula: `=REPLACE(A1, start, num_chars, "new_text")`
Example: If `A1` is `"Hello Excel"`, `=REPLACE(A1, 7, 5, "World")` replaces "Excel"
with "World" to give `"Hello World"`.
16. TEXTJOIN – Join Text with a Delimiter
Formula: `=TEXTJOIN(", ", TRUE, A1:A3)`
Example: If cells `A1:A3` contain `"One"`, `"Two"`, and `"Three"`, `=TEXTJOIN(", ",
TRUE, A1:A3)` returns `"_______"`.
17. VALUE – Convert Text to a Number
Formula: `=VALUE(A1)`
Example: If `A1` contains `"123"`, `=VALUE(A1)` converts it to the number `123`.
18. TEXT – Format a Number as Text
Formula: `=TEXT(A1, "format")`
Example: If `A1` contains `0.85`, `=TEXT(A1, "0%")` converts it to `"85%"`.