Excel Text Functions
Excel is not just about numbers. A large portion of real-world data consists of text — names, addresses, product codes, email addresses, and more. Excel's text functions allow manipulation, extraction, cleaning, and combining of text data automatically. This topic covers the most essential text functions every Excel user should know.
LEFT Function
What It Does
Extracts a specified number of characters from the left (beginning) of a text string.
Syntax
=LEFT(text, num_chars)
Example
Cell A2: "PRODUCT-2024" =LEFT(A2, 7) Result: "PRODUCT" Cell B2: "Excel Tutorial" =LEFT(B2, 5) Result: "Excel"
RIGHT Function
What It Does
Extracts a specified number of characters from the right (end) of a text string.
Syntax
=RIGHT(text, num_chars)
Example
Cell A2: "ORDER-4521" =RIGHT(A2, 4) Result: "4521" (the last 4 characters) Cell B2: "Hello World" =RIGHT(B2, 5) Result: "World"
MID Function
What It Does
Extracts characters from the middle of a text string, starting at a specified position and for a specified number of characters.
Syntax
=MID(text, start_num, num_chars)
- start_num: The position of the first character to extract (counting from 1).
- num_chars: How many characters to extract.
Example
Cell A2: "INV-2024-005" =MID(A2, 5, 4) → Starts at position 5, takes 4 characters Result: "2024" Cell B2: "AB-123-CD" =MID(B2, 4, 3) Result: "123"
LEN Function
What It Does
Returns the total number of characters in a text string, including spaces and punctuation.
Syntax
=LEN(text)
Example
Cell A2: "Hello" =LEN(A2) Result: 5 Cell B2: "Good Morning" =LEN(B2) Result: 12 (including the space)
Practical Use
LEN is useful for validating data — for example, checking that a phone number is exactly 10 digits, or that a password meets a minimum length requirement.
TRIM Function
What It Does
Removes all extra spaces from text — leading spaces (before the text), trailing spaces (after the text), and multiple spaces between words. It keeps single spaces between words intact.
Syntax
=TRIM(text)
Example
Cell A2: " John Smith " (spaces before, after, and in the middle) =TRIM(A2) Result: "John Smith"
Why It Matters
When importing data from other systems, text often arrives with extra spaces that cause issues with lookups and comparisons. TRIM cleans this up automatically.
UPPER Function
What It Does
Converts all characters in a text string to UPPERCASE.
Syntax
=UPPER(text)
Example
Cell A2: "hello world" =UPPER(A2) Result: "HELLO WORLD"
LOWER Function
What It Does
Converts all characters in a text string to lowercase.
Syntax
=LOWER(text)
Example
Cell A2: "MICROSOFT EXCEL" =LOWER(A2) Result: "microsoft excel"
PROPER Function
What It Does
Converts text to Title Case — the first letter of each word is capitalized.
Syntax
=PROPER(text)
Example
Cell A2: "john michael smith" =PROPER(A2) Result: "John Michael Smith"
CONCATENATE Function (and the & Operator)
What It Does
Joins (combines) two or more text strings into one.
Syntax
=CONCATENATE(text1, text2, ...) Or use the ampersand (&) operator: =text1 & text2
Example
Cell A2: "John" Cell B2: "Smith" =CONCATENATE(A2, " ", B2) → "John Smith" =A2 & " " & B2 → "John Smith" (same result, shorter formula)
Practical Use: Building Email Addresses
Cell A2: "john" Cell B2: "company.com" =A2 & "@" & B2 Result: "john@company.com"
TEXTJOIN Function (Excel 2019+)
What It Does
Joins multiple values with a specified delimiter (separator) and can optionally skip empty cells.
Syntax
=TEXTJOIN(delimiter, ignore_empty, text1, text2, ...)
Example
Cells A2:A5 contain: "Red", "", "Blue", "Green"
=TEXTJOIN(", ", TRUE, A2:A5)
Result: "Red, Blue, Green" (empty cell ignored)
Combining Text Functions
Practical Example: Extracting First Name from Full Name
Cell A2: "Alice Johnson"
First, find the position of the space:
=FIND(" ", A2) → 6 (space is at position 6)
Then extract text to the left of the space:
=LEFT(A2, FIND(" ", A2)-1)
Result: "Alice"
Summary
- LEFT(text, n): Extracts n characters from the start of text.
- RIGHT(text, n): Extracts n characters from the end of text.
- MID(text, start, n): Extracts n characters starting from a specified position.
- LEN(text): Returns the total number of characters in text.
- TRIM(text): Removes extra spaces from text.
- UPPER(text) / LOWER(text) / PROPER(text): Change the case of text.
- CONCATENATE or &: Joins multiple text strings into one.
- Text functions can be nested together to perform complex text manipulations.
