Skip to content

LEFT

Returns the first characters of a piece of text, counting from the left.

Syntax

=LEFT(, )

Text

All versions of Excel.

Try it

Edit the formula in C2 or change the inputs. The sheet recalculates as you type.

C2
A
B
C
1
Staff ID
Name
Dept code
2
ENG-0412
Priya
ENG
3
FIN-0305
Marcus
4
OPS-1120
Elif
5

C2 =LEFT(A2,3) returns ENG

How LEFT works

LEFT returns the first characters of a piece of text. Use it to pull a prefix out of a code, take the first letter of a name, or read the year from the start of a reference such as 2025-0412.

The arguments

  • text is the text to look at, normally a cell reference.
  • num_chars is how many characters to keep, counted from the first character. It is optional and defaults to 1, so =LEFT(A2) returns just the first character.

If num_chars is larger than the text, LEFT returns the whole text and doesn't pad it. If num_chars is 0, you get an empty string. A negative number returns #VALUE!.

LEFT always returns text

LEFT always returns text, even when the characters are digits. =LEFT("2025-0412",4) returns the text "2025", not the number 2025. That can look fine in the cell and then fail later: a SUM ignores it, and a lookup against a real number finds nothing. To get a number back, wrap the result in VALUE, or put a double minus in front: =VALUE(LEFT(A2,4)).

LEFT also works on numbers and dates, but it reads the stored value. A date is stored as a serial number such as 45731, so =LEFT(B2,2) on a date returns "45". If you need part of a date, use YEAR, MONTH, DAY or TEXT instead.

When the length varies

=LEFT(A2,3) works when every code has a three-character prefix. If prefixes vary, as with NSW-2025-041 and WA-2025-009, find the position of the separator and take everything before it. FIND returns that position, so the formula is =LEFT(A2,FIND("-",A2)-1). The -1 stops before the dash. If the separator isn't in the text, FIND returns #VALUE!, so wrap it in IFERROR when some cells may not have one.

Excel for Microsoft 365 and Excel 2024 also have TEXTBEFORE, which does this in one step: =TEXTBEFORE(A2,"-"). LEFT and FIND work in every version.

Related functions

RIGHT takes characters from the end, and MID takes them from any position. LEN counts the characters, which helps when you need "everything except the last 4": =LEFT(A2,LEN(A2)-4).

Leading spaces count

Leading spaces are characters like any other. NSW-2025 with a leading space returns NS for =LEFT(A2,3). If the data came from another system, clean it with TRIM first: =LEFT(TRIM(A2),3).

Arguments

text
The text to take characters from. Usually a cell such as A2. A number is treated as the text it would show in a General-format cell.
num_charsoptional
How many characters to return, counted from the start. If you leave it out, LEFT returns 1 character. A value larger than the text returns all of the text. A negative value returns #VALUE!.

Examples

Each example is a live sheet. Change the inputs or the formula and watch the result.

Example 1

Take a fixed-length prefix

C2 =LEFT(A2,3)

Result: ENG

The first three characters of ENG-0412.

C2
A
B
C
1
Staff ID
Name
Dept code
2
ENG-0412
Priya
ENG
3
FIN-0305
Marcus
4
OPS-1120
Elif
5

C2 =LEFT(A2,3) returns ENG

Example 2

Leave num_chars out to get the first character

B2 =LEFT(A2)

Result: N

With one argument, LEFT returns a single character.

B2
A
B
C
1
Region
Initial
Sales
2
North
N
48,200
3
South
31,750
4
East
42,900
5

B2 =LEFT(A2) returns N

Example 3

Take text up to a separator of varying position

B3 =LEFT(A3,FIND("-",A3)-1)

Result: WA

FIND returns 3 for the dash in WA-2025-009, so LEFT takes 3 - 1 = 2 characters. The same formula in B2 returns NSW.

B3
A
B
C
1
Order ref
State
Value
2
NSW-2025-041
1,280
3
WA-2025-009
WA
940
4
QLD-2025-087
2,210
5

B3 =LEFT(A3,FIND("-",A3)-1) returns WA

Example 4

Turn the digits you extract into a number

C2 =VALUE(LEFT(A2,4))+1

Result: 2026

LEFT returns the text "2025" and VALUE turns it into a number. Plain arithmetic would also convert it here, but SUM, lookups and comparisons would not.

C2
A
B
C
1
Period
Year
Next year
2
2025-Q3
2026
3
4

C2 =VALUE(LEFT(A2,4))+1 returns 2026

Your turn.

Solve it in the sheet. Every answer is checked, with hints if you need them.

Task 1 of 2

In B2, return the first three characters of the order ref in A2.

Answer in B2.

B2
A
B
C
D
1
Order ref
State (3 letters)
State (any length)
Value
2
NSW-2025-041
1,280
3
VIC-2025-112
760
4
QLD-2025-087
2,210
5
WA-2025-009
940
6
7

Common mistakes

  • LEFT returns text, even when the characters are digits. =LEFT("2025-Q3",4) returns the text "2025". Use VALUE(LEFT(...)) if you need a number for a sum, lookup or comparison.
  • LEFT reads the stored value, not the display. On a date such as 15-Mar-2025, =LEFT(B2,2) returns "45", the start of the serial number 45731. Use YEAR, MONTH or TEXT for dates.
  • A fixed num_chars breaks when the prefix length varies. Use FIND to locate the separator, or TEXTBEFORE in Microsoft 365, instead of counting characters by eye.
  • Hidden leading spaces shift the result. If =LEFT(A2,3) shows a space at the start, wrap the cell in TRIM.
  • A negative num_chars returns #VALUE!. =LEFT(A2,LEN(A2)-4) fails this way on any cell with fewer than 4 characters, because the count goes below zero.

Questions people ask

How do I get the first 3 characters of a cell in Excel?

Use `=LEFT(A2,3)`. The first argument is the cell, and the second is the number of characters to keep.

How do I remove the last 4 characters from text?

Combine LEFT with LEN: `=LEFT(A2,LEN(A2)-4)`. LEN counts all characters, and LEFT keeps everything except the last four.

Why does LEFT return a number as text?

LEFT always returns text. To get a real number, wrap it: `=VALUE(LEFT(A2,4))`. You can also multiply by 1 or put a double minus in front.

How do I get everything before a dash or space?

Use `=LEFT(A2,FIND("-",A2)-1)`, changing the dash to your separator. In Microsoft 365 and Excel 2024, `=TEXTBEFORE(A2,"-")` does the same in one function.

What happens if num_chars is bigger than the text?

LEFT returns the whole text without padding it. `=LEFT("ENG",10)` returns "ENG".

Learn LEFT in a real sheet.

LEFT is taught in Logic and text, lesson 10: LEFT, RIGHT and LEN. Each lesson is a short, graded exercise like the one above.