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

=LEFT(text, [num_chars]) | =RIGHT(text, [num_chars]) | =MID(text, start_num, num_chars)

Arguments

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 CodeHub
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 IDRole
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 IDDestination
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)).

Related guides

SUM