LEFT / RIGHT
How to extract part of a text in Excel: LEFT, RIGHT, MID and LEN
LEFT takes characters from the left, RIGHT from the right, MID from the middle; LEN returns the length of the text.
Syntax
=LEFT(text, [num_chars])
- text — Text or a cell containing text.
- num_chars — The number of characters to extract (default is 1).
Example
Formula:
=LEFT(A2,2)→ result: AB
RIGHT and MID
=RIGHT(A2,7) → 1234567. =MID(A2,3,4) → 1234 (4 characters starting from the 3rd).
LEN
=LEN(A2) returns the total number of characters in the text, including spaces. Useful for validating data: =LEN(A2)=9.
Put it into practice
Frequently asked questions
For 998901234567: =MID(A2,4,2) → 90.
Text functions always return text. To convert it to a number, use =VALUE(RIGHT(A2,7)) or =--RIGHT(A2,7).