LEFT and RIGHT functions in Excel
LEFT returns characters from the start of a text and RIGHT returns characters from the end.
Codes, phone numbers, email addresses and names all carry several pieces of information in one cell. LEFT and RIGHT cut a piece from one end. They are the simplest of the text-splitting functions and are usually combined with FIND and LEN to decide where to cut.
Syntax
=LEFT(text, [num_chars])=RIGHT(text, [num_chars])| Argument | What it is |
|---|---|
text | The text, or a cell that holds it. |
num_chars | How many characters to take. 1 if left out. |
Examples
Each result below is what Excel itself showed for the formula on the sample sheet.
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Full name | Code | Amount as text | |
| 2 | asha verma | asha.verma@example.com | PB-10-1234 | 1,250 |
| 3 | RAVI KUMAR | ravi@example.org | DL-08-0042 | 300 |
| 4 | meena gill | meena.gill@example.com | MH-12-9876 | 45.50 |
| 5 | Kabir Khan | kabir@example.net | RJ-14-0007 | 12 kg |
=LEFT(C2,2)Result: PBThe first two characters of the code PB-10-1234: the state letters.
=RIGHT(C2,4)Result: 1234The last four characters: the serial number.
=LEFT(B2,FIND("@",B2)-1)Result: asha.vermaEverything before the @ of an email address. FIND gives the position of the @, and one less is the length of the name part.
=RIGHT(B2,LEN(B2)-FIND("@",B2))Result: example.comEverything after the @: the total length minus the position of the @.
=LEFT(A3,FIND(" ",A3)-1)Result: RAVIThe first name: everything before the first space.
=RIGHT(C3,4)+1Result: 43RIGHT returns text, but arithmetic turns "0042" into a number: 43. The leading zeros are lost.
=LEFT(C2,50)Result: PB-10-1234Asking for more characters than exist simply returns the whole text.
How they work
LEFT counts characters from the first one. RIGHT counts back from the last one. Spaces and punctuation count as characters. If you leave the number out, you get a single character, which is handy for initials: =LEFT(A2).
Fixed positions and moving positions
When every value has the same layout, as in a code like PB-10-1234, the numbers can be typed in: the first two, the last four.
When the layout varies, as with names and email addresses, let another function find the cutting point.
- Everything before a marker:
=LEFT(text, FIND(marker, text) - 1) - Everything after a marker:
=RIGHT(text, LEN(text) - FIND(marker, text))
These two patterns, shown in the third and fourth examples, split a cell at a space, a comma, a dash or an @ sign.
In Microsoft 365 there are easier functions for this, TEXTBEFORE and TEXTAFTER. Excel 2021 and earlier do not have them, so the patterns above remain worth knowing.
The result is always text
Even when the characters are digits, LEFT and RIGHT return text. It sits at the left of the cell, SUM ignores it, and a lookup against real numbers fails. To get a number, wrap the formula in VALUE, or add zero, or multiply by one. The sixth example does arithmetic on the result, which converts it and, in passing, drops the leading zeros.
If the zeros matter, as in a PIN code or an account number, keep the result as text.
Dates and formatted numbers
LEFT and RIGHT work on what is stored, not on what the cell shows. A date is stored as a number such as 46027, so =LEFT(A2,2) on a date cell returns 46, not the day. Use DAY, MONTH and YEAR for dates, or convert with TEXT first.
Other ways to split
- Flash Fill (Ctrl and E): type the first answer by hand, and Excel fills in the rest by copying the pattern. Quick, but the results do not update when the source changes.
- Text to Columns on the Data tab splits a whole column at a chosen character.
- MID takes characters from the middle.
Common mistakes
#VALUE!when FIND does not find the marker, for example a name with no space. Wrap in IFERROR to return the whole text in that case.- Hidden spaces at the start or end, so that the "first two characters" are a space and a letter. Clean with TRIM first.
- Treating the result as a number without converting it.
In Google Sheets
LEFT and RIGHT are the same in Google Sheets.
Related functions
Every result on this page was calculated in Microsoft Excel (version 16.0, build 20326) on 12 November 2026, not typed by hand.
This is an independent help site. It is not connected with or approved by Microsoft. Excel and Microsoft 365 are trademarks of Microsoft Corporation, named here only to say which program a formula is for. The people and figures in the sample sheets are made up.