Text function

LEFT function

Returns a set number of characters from the start of a text string, e.g. the first 3 letters of a product code.

Available in All versions of Excel, including Microsoft 365, Excel for Mac and Excel for the web

In every Excel versionWorks in Google Sheets

Syntax

LEFT(text, [num_chars])
ArgumentWhat it means
textRequiredThe text or cell to take characters from.
num_charsOptionalHow many characters to return. Default 1. If larger than the text length, the whole text is returned.

Returns: Text: the first num_chars characters.

How LEFT works

LEFT cuts a piece off the beginning of a text. If your product codes start with a 3-letter warehouse code (NYC-1042, LON-0391), =LEFT(A2,3) pulls out the warehouse. With no second argument it returns just the first character, which is handy for initials or for reading a Y/N answer.

When the part you need has a variable length, combine LEFT with FIND or SEARCH: find the position of the delimiter (a space, hyphen or @) and take everything before it. =LEFT(A2,FIND(" ",A2)-1) returns the first word of a name. In Microsoft 365, TEXTBEFORE does the same in one step.

LEFT always returns text, even from a number: =LEFT(2026,2) gives the text "20". Wrap it in VALUE (or add +0) if you need to calculate with the result. LEFT also works on the stored value, not the display, so a date in a cell returns the first digits of its serial number.

Examples

1Warehouse code from a product code

B2fx=LEFT(A2,3)
AB
1Product codeWarehouse
2NYC-1042NYC
3LON-0391

Result: NYC

The first three characters of NYC-1042 are returned.

2First name from a full name

B2fx=LEFT(A2,FIND(" ",A2)-1)
AB
1Full name
2Maria LopezMaria

Result: Maria

FIND locates the space at position 6, so LEFT takes the 5 characters before it.

3Year as a real number

B2fx=VALUE(LEFT(A2,4))
AB
1Invoice ID
22026-INV-772026

Result: 2026

LEFT returns the text "2026"; VALUE converts it to the number 2026 so it can be compared with other years or used in DATE.

4Default of one character

B2fx=LEFT(A2)
AB
1Answer
2YesY
3No

Result: Y

Without num_chars LEFT returns one character, a quick way to turn survey answers into Y/N codes.

⬇Practice workbookExamples with live formulas + practice sheets · .xlsx · 17 KB

Common errors and how to fix them

ErrorWhy it happensFix
#VALUE!num_chars is negative.Make sure the length calculation cannot go below zero; e.g. when FIND fails or returns 1, FIND(...)-1 may be 0 or an error.
#VALUE!The FIND inside the formula did not find its delimiter.Wrap in IFERROR, e.g. =IFERROR(LEFT(A2,FIND(" ",A2)-1),A2) to return the whole name when there is no space.

Tips

  • Leading spaces count as characters. Clean the source with TRIM first if the data comes from an import.
  • LEFT on a number formatted with leading zeros (like 00742) sees only the stored value 742. Use LEFT(TEXT(A2,"00000"),2) to work with the displayed digits.
  • In Microsoft 365 LEFT accepts a range and spills: =LEFT(A2:A100,3) fills a whole column in one formula.

Questions

How do I get everything before a certain character?

Use =LEFT(A2,FIND("-",A2)-1), replacing "-" with your delimiter, or =TEXTBEFORE(A2,"-") in Microsoft 365.

How do I remove the first few characters instead of keeping them?

Keep the rest with RIGHT: =RIGHT(A2,LEN(A2)-3) drops the first 3 characters. REPLACE works too: =REPLACE(A2,1,3,"").

Why does LEFT return a number that does not add up?

LEFT always returns text. Convert it with VALUE or --LEFT(...) before using it in sums or comparisons with numbers.

Google Sheets

LEFT also exists in Google Sheets and works the same way for everyday use, so the examples above work there too.

LEFT in other languages

In a non-English version of Excel the function has a local name. Excel translates formulas automatically when a file is opened in another language.

LanguageFunction name
CzechZLEVA
DanishVENSTRE
DutchLINKS
FinnishVASEN
FrenchGAUCHE
GermanLINKS
HungarianBAL
ItalianSINISTRA
Norwegian (Bokmål)VENSTRE
PolishLEWY
Portuguese (Brazil)ESQUERDA
Portuguese (Portugal)ESQUERDA
RussianЛЕВСИМВ
SpanishIZQUIERDA
SwedishVÄNSTER
TurkishSOLDAN

Recipes that use LEFT