Part of the free Module 5: Excel Formulas and Functions · Function 52 of 105 · Full Excel course
The Excel LEFT function returns a specified number of characters from the start of a text string. With a single argument it returns the first character; with a count it returns that many characters. LEFT is one of the core text-extraction functions and is usually combined with FIND, SEARCH or LEN to pull out codes, names or prefixes from longer text.
Syntax
=LEFT(text, [num_chars])
Arguments
| Argument | Required / Optional | Meaning |
|---|---|---|
| text | Required | The text string or cell reference to extract from. Numbers are converted to text first. |
| num_chars | Optional | How many characters to return. Default is 1. Must be zero or positive; if it exceeds the text length, the whole text is returned. |
How LEFT works
LEFT counts characters, not bytes or words, and spaces count as characters. It always returns text, so =LEFT(20260904,4) returns the text “2026”, not the number 2026. Wrap the result in VALUE when you need a number. For text in double-byte languages such as Japanese, the LEFTB function counts bytes instead.
Step-by-step example: extract a country code
- Column A contains order numbers such as
UK-2026-00417. - In B2 enter
=LEFT(A2,2). Excel returnsUK. - Fill the formula down. Every row now shows its two-letter country code.
- If the code length varies, replace 2 with the position of the first hyphen:
=LEFT(A2,FIND("-",A2)-1).
Practical use cases
1. First name from a full name
=LEFT(A2,FIND(" ",A2)-1)
FIND locates the first space and LEFT returns everything before it.
2. Remove the last n characters
=LEFT(A2,LEN(A2)-4)
Strips a four-character suffix such as “.xlsx” from a file name.
3. Year from a text date
=VALUE(LEFT(A2,4))
For ISO-style strings like 2026-09-04, this returns the numeric year 2026.
4. Group items by the first letter
=UPPER(LEFT(TRIM(A2),1))
TRIM removes leading spaces so the first real letter is used; UPPER standardises the case for grouping in a PivotTable.
Common mistakes and tips
- #VALUE! error: num_chars is negative. Check any subtraction such as FIND(…)-1 when the separator is missing, and wrap in IFERROR.
- Result is text: extracted digits will not sum until you convert them with VALUE or by adding 0.
- Leading spaces: LEFT returns the space as the first character. Clean the source with TRIM first.
- Formatted numbers: LEFT works on the stored value, not the displayed one. A date shows as its serial number; use TEXT(A2,”dd-mm-yyyy”) first.
- Excel 365 shortcut: TEXTBEFORE(A2,”-“) does the same as LEFT with FIND in a single readable function.
LEFT, LEFTB and the newer TEXTBEFORE function
Excel has three related ways to take characters from the start of a string. LEFT counts characters and is the right choice for almost every language. LEFTB counts bytes and matters only when a workbook uses a double-byte character set language such as Japanese, Chinese or Korean, where one character can occupy two bytes; in other languages LEFTB behaves exactly like LEFT. TEXTBEFORE, available in Excel 365 and Excel 2024, removes the need for FIND: =TEXTBEFORE(A2,"-") returns the text before the first hyphen and =TEXTBEFORE(A2,"-",-1) returns the text before the last one. It also accepts an argument that controls what happens when the delimiter is missing, which replaces the IFERROR wrapper that LEFT with FIND normally needs. For workbooks shared with older versions, keep using LEFT.
Related functions
- RIGHT: extracts characters from the end of a string.
- MID: extracts characters from any position.
- FIND: returns the position of a separator to feed into LEFT.
- LEN: returns the total length, used to remove trailing characters.
- See all lessons in the Excel Formulas course.
Frequently asked questions
How do I extract text before a specific character with LEFT?
Combine LEFT with FIND: =LEFT(A2,FIND(“-“,A2)-1) returns everything before the first hyphen.
Why does LEFT return a number as text?
LEFT always returns a text string. Wrap it in VALUE, or add 0 to the result, to get a numeric value that SUM can use.
What happens if num_chars is larger than the text length?
LEFT returns the entire text without an error. Only a negative num_chars produces #VALUE!.
Need a ready-made template? Browse 7,000+ Excel, Power BI and Google Sheets templates at NextGenTemplates.com.