What it does
LEFT, RIGHT and MID extract characters from the start, end or middle of text.
Syntax or pattern
=LEFT(text, num_chars) / =RIGHT(text, num_chars) / =MID(text, start_num, num_chars)5 practical examples
Get first three characters
Extract a code prefix.
=LEFT(A2,3)Useful when product codes start with a category.
Get last four characters
Extract the last four digits of an ID.
=RIGHT(A2,4)Common for masked IDs.
Get characters from the middle
Extract a segment from a fixed code.
=MID(A2,4,3)Use when text has a predictable layout.
Combine with FIND
Extract text before a dash.
=LEFT(A2,FIND("-",A2)-1)FIND makes the formula more flexible.
Clean code pieces
Build a short label from parts of a text string.
=LEFT(A2,2)&"-"&RIGHT(A2,4)Concatenation creates readable labels.
Common mistakes to avoid
- Not handling missing delimiters.
- Forgetting that some text functions return text, not numbers.
- Using fixed positions when the text layout is not consistent.
Related Excel examples
FAQ
Can text formulas work with Excel Tables?
Yes. Table references can make text-cleaning formulas easier to understand.