Function · Text

Excel LEFT function

The Excel LEFT function returns the first characters of a text value. The area code of 512-555-0148 is 512.

All current Excel versions. Also in Excel for the web and Google Sheets.

Syntax =LEFT(text, [num_chars])

LEFT
=LEFT("512-555-0148",3)

Arguments

NameRequiredWhat to pass
textRequiredThe text, or a cell that holds it.
num_charsOptionalHow many characters to take from the left. The default is 1.

Examples

Area code from a US phone number written with hyphens

=LEFT(B1,3)

Result 512

=LEFT(B1,3)B2
Phone
AB
1Phone512-555-0148
2Area code512
A picture of the sheet, not a live calculator. The first three characters are the digits 512. The hyphen is the fourth character.

LEFT takes characters from the start of a text value. In 512-555-0148 the first three characters are 512, the Austin area code. The hyphen is character 4, so it is not included. Parentheses, spaces, and hyphens all count. (512) 555-0148 does not start with 512. It starts with an opening parenthesis.

If you omit the second argument, LEFT returns one character. num_chars larger than the text returns the whole text, not an error. MID is what you want when the piece you need is not at the start.