Excel Text Functions

Excel's text functions let you extract, join, and clean up pieces of text stored in cells without retyping anything by hand.

Extracting Part of a Text String

LEFT, RIGHT, and MID pull out a specific portion of a text value. LEFT and RIGHT count characters from the start or end of the string, while MID lets you start anywhere in the middle.

FunctionSyntaxWhat It Returns
LEFTLEFT(text, num_chars)The first num_chars characters, counting from the left.
RIGHTRIGHT(text, num_chars)The last num_chars characters, counting from the right.
MIDMID(text, start_num, num_chars)num_chars characters starting at position start_num.

Example

' If A2 contains "INV-2024-0456"
=LEFT(A2,3)      ' returns "INV"
=MID(A2,5,4)     ' returns "2024"
=RIGHT(A2,4)     ' returns "0456"

Joining Text Together

CONCAT combines several text values, cell references, or strings into one. The older CONCATENATE function does the same thing, and the & operator can also join text directly inside a formula.

Example

=CONCAT(A2," ",B2)
Note: CONCATENATE is kept in Excel only for compatibility with older workbooks. Microsoft recommends CONCAT for simple joins, or TEXTJOIN when you also need a delimiter repeated between many values.

Cleaning Up and Changing Case

  • TRIM(text) removes extra spaces, leaving single spaces between words and none at the start or end.
  • UPPER(text) converts every letter to uppercase.
  • LOWER(text) converts every letter to lowercase.
  • PROPER(text) capitalizes the first letter of each word, useful for tidying up names.

Example

=TRIM(UPPER(A2))
Note: Text functions can be nested inside one another, as in the example above: UPPER converts the case first, and TRIM then cleans up any stray spaces in the result, all in a single formula.