How to use LEFT, RIGHT and MID in Excel
Learn how to extract text in Excel using LEFT, RIGHT, and MID, with clear examples and a link to hands-on practice.
Syntax
fx=LEFT(text, [num_chars]) | =RIGHT(text, [num_chars]) | =MID(text, start_num, num_chars)
Arguments
text(required)The text string or cell reference containing the characters you want to extract.
num_chars(optional)The number of characters to extract. Defaults to 1 if omitted in LEFT and RIGHT. Required in MID.
start_num(required)The position of the first character to extract in MID, starting at 1 for the first character.
Extract from the start with LEFT
LEFT pulls characters from the beginning of a text string. Give it a cell reference and the number of characters you want. If you omit the character count, Excel returns just the first character.
| Tracking Code | Hub |
| SEA-9041 |
Formula: =LEFT(A2, 3) → SEA
Extract from the end with RIGHT
RIGHT pulls characters from the end of a text string. Give it a cell reference and how many characters to return from the right side. If you omit the count, it returns only the last character.
| Employee ID | Role |
| EMP-418-MGR |
Formula: =RIGHT(A2, 3) → MGR
Extract from the middle with MID
MID returns a specific number of characters from anywhere inside a text string. You specify the text, the position where extraction starts, and how many characters to take. Unlike LEFT and RIGHT, the length is required.
| Shipment ID | Destination |
| US-CHI-940 |
Formula: =MID(A2, 4, 3) → CHI
Common mistake: numbers returned as text
Text functions always return text strings, even when the characters look like numbers. If you extract digits like 940, formulas like SUM will ignore that cell. Remember also that Excel uses 1-based indexing, so the first character is always 1, not 0. To use extracted digits in calculations, wrap your formula in VALUE, such as =VALUE(RIGHT(A2, 3)).