Example 1
Take a fixed-length prefix
C2 =LEFT(A2,3)
Result: ENG
The first three characters of ENG-0412.
C2 =LEFT(A2,3) returns ENG
Returns the first characters of a piece of text, counting from the left.
Syntax
=LEFT(, )
All versions of Excel.
Try it
Edit the formula in C2 or change the inputs. The sheet recalculates as you type.
C2 =LEFT(A2,3) returns ENG
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.
=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, 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.
=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.
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 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).
A2. A number is treated as the text it would show in a General-format cell.#VALUE!.Each example is a live sheet. Change the inputs or the formula and watch the result.
Example 1
C2 =LEFT(A2,3)
Result: ENG
The first three characters of ENG-0412.
C2 =LEFT(A2,3) returns ENG
Example 2
B2 =LEFT(A2)
Result: N
With one argument, LEFT returns a single character.
B2 =LEFT(A2) returns N
Example 3
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 =LEFT(A3,FIND("-",A3)-1) returns WA
Example 4
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 =VALUE(LEFT(A2,4))+1 returns 2026
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.
=LEFT("2025-Q3",4) returns the text "2025". Use VALUE(LEFT(...)) if you need a number for a sum, lookup or comparison.=LEFT(B2,2) returns "45", the start of the serial number 45731. Use YEAR, MONTH or TEXT for dates.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.=LEFT(A2,3) shows a space at the start, wrap the cell in TRIM.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.Use `=LEFT(A2,3)`. The first argument is the cell, and the second is the number of characters to keep.
Combine LEFT with LEN: `=LEFT(A2,LEN(A2)-4)`. LEN counts all characters, and LEFT keeps everything except the last four.
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.
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.
LEFT returns the whole text without padding it. `=LEFT("ENG",10)` returns "ENG".
LEFT is taught in Logic and text, lesson 10: LEFT, RIGHT and LEN. Each lesson is a short, graded exercise like the one above.