ExcelReady
CourseFunction guidesBlog
Start freeStart learning for free
ExcelReady

Be Excel-ready before the interview. Hands-on practice in your browser, with instant feedback.

Learn

  • Course
  • Function guides
  • Blog

Product

  • Certificate

Company

  • Editorial policy
  • Contact
  • Terms
  • Privacy

© 2026 ExcelReady. All rights reserved.

  1. Blog
  2. Text
  3. LEFT, RIGHT and MID in Excel: Pull Out Part of a Cell

LEFT, RIGHT and MID in Excel: Pull Out Part of a Cell

By ExcelReady Team·Updated October 30, 2026·6 min read

The short answer

LEFT, RIGHT and MID pull part of the text out of a cell. LEFT(text, num_chars) takes characters from the start, RIGHT(text, num_chars) takes them from the end, and MID(text, start_num, num_chars) takes them from any position. For TX-ELC-40512, LEFT(A2,2) gives TX, MID(A2,4,3) gives ELC and RIGHT(A2,5) gives 40512.

Key takeaways

  • LEFT and RIGHT need the text and how many characters to take; MID also needs where to start.
  • Positions count from 1 at the left, and spaces and dashes count as characters.
  • The result is always text, even when it looks like a number. Wrap it in VALUE to do math.
  • For parts of different lengths, combine RIGHT with LEN, or LEFT and MID with FIND.
On this page+
  1. What do LEFT, RIGHT and MID do?
  2. How to use LEFT to take characters from the start
  3. How to use RIGHT to take characters from the end
  4. How to use MID to take characters from the middle
  5. Why does RIGHT return a number I can't add up?
  6. How to handle text of different lengths with LEN
  7. Common mistakes with LEFT, RIGHT and MID
  8. What to use instead: TEXTBEFORE, TEXTAFTER and Flash Fill
  9. Practise it

Excel LEFT, RIGHT and MID pull out part of a cell: LEFT takes characters from the start, RIGHT from the end, and MID from the middle. They're how you split a product code, an employee ID or an account number into its parts without retyping anything. This guide is for beginners and job seekers, and it uses one set of product codes so you can see all three side by side.

What do LEFT, RIGHT and MID do?#

All three functions return part of a piece of text. Each character counts: letters, digits, spaces and symbols like the dash. Here is the syntax:

FunctionSyntaxWhat it takes
LEFT=LEFT(text, [num_chars])num_chars characters from the start
RIGHT=RIGHT(text, [num_chars])num_chars characters from the end
MID=MID(text, start_num, num_chars)num_chars characters, starting at position start_num

text is usually a cell. num_chars is how many characters to take; for LEFT and RIGHT it's optional and defaults to 1. start_num is the position of the first character you want, counting from 1 at the left. These functions work in every version of Excel.

The examples use these product codes in column A. Each one is a 2-letter region, a dash, a 3-letter category, a dash and a 5-digit item number:

ABCD
1Product CodeRegionCategoryItem No.
2TX-ELC-40512
3CA-FUR-11873
4NY-OFF-30291
5WA-ELC-52046
6FL-APP-27734
7IL-FUR-19358

How to use LEFT to take characters from the start#

LEFT takes a number of characters from the beginning of the text. The region is the first 2 characters, so in B2:

Excel formula
=LEFT(A2,2)

The result is TX. Select B2:B7 and fill down (Windows: Ctrl+D; Mac: ⌘D) to get CA, NY, WA, FL and IL. If you leave out the 2, =LEFT(A2) returns just T.

How to use RIGHT to take characters from the end#

RIGHT works the same way, counting back from the end of the text. The item number is the last 5 characters, so in D2:

Excel formula
=RIGHT(A2,5)

The result is 40512. RIGHT doesn't care how long the rest of the text is; it always counts from the right.

How to use MID to take characters from the middle#

MID needs a start position as well as a length, because the part you want isn't at either end. Count along TX-ELC-40512: T is 1, X is 2, the dash is 3, and E is 4. The category starts at 4 and is 3 characters long, so in C2:

Excel formula
=MID(A2,4,3)

The result is ELC. A common mistake is starting at 3, which gives -EL, because the dash counts.

MID is forgiving at the end of the text. If num_chars asks for more characters than are left, MID returns what's there, so =MID(A2,8,100) gives 40512. If start_num is past the end, MID returns empty text.

Why does RIGHT return a number I can't add up?#

LEFT, RIGHT and MID always return text, even when the result looks like a number. SUM skips text, and lookups won't match the text "40512" to the number 40512. You can often spot it: text sits on the left of the cell, numbers on the right.

To turn the result into a real number, wrap it in VALUE:

Excel formula
=VALUE(RIGHT(A2,5))

Excel works from the inside out: RIGHT returns the text "40512", then VALUE turns it into the number 40512. With a code like SKU-0042, =VALUE(RIGHT(A2,4)) gives 42, because a number has no leading zeros. Keep the text version if the zeros matter, as with ZIP codes or account numbers.

How to handle text of different lengths with LEN#

When the part you want changes length, use LEN to measure the text. =LEN(text) counts every character. Take these employee IDs:

ABC
1Employee IDLengthNumber
2EMP-757
3EMP-120481204
4EMP-58658
5EMP-36610936610

Every ID starts with the same 4 characters, EMP-. So the number is the last LEN(A2) minus 4 characters:

Excel formula
=RIGHT(A2,LEN(A2)-4)

For EMP-1204, LEN gives 8, minus 4 is 4, and RIGHT takes 1204. Putting one function inside another like this is called nesting.

When there's no fixed prefix, look for a marker instead, such as a space or an @. FIND returns its position, and LEFT or MID can use that. For example, =LEFT(A2,FIND(" ",A2)-1) returns everything before the first space. See how to find the position of text with FIND and SEARCH for the full method.

Common mistakes with LEFT, RIGHT and MID#

Most wrong results come from miscounting or from cells that aren't quite what they seem:

  1. Miscounting positions. Spaces, dashes and dots are characters. Count carefully, or check with LEN.
  2. Hidden spaces. A cell like " TX-ELC-40512" with a leading space shifts every position by one. Clean it first with TRIM; see how to clean messy data with TRIM, CLEAN and PROPER.
  3. Using them on dates. A date is stored as a number, so =LEFT(A2,4) on Feb 3, 2025 returns 4569, the first digits of 45691. Use =YEAR(A2) or =TEXT(A2,"yyyy") instead.
  4. Using them on numbers. =LEFT(2025,2) returns the text "20". Wrap it in VALUE if you need a number.
  5. Swapping MID's arguments. The order is text, start, length. =MID(A2,3,4) and =MID(A2,4,3) give different results.

What to use instead: TEXTBEFORE, TEXTAFTER and Flash Fill#

In Microsoft 365, TEXTBEFORE and TEXTAFTER split text at a delimiter with no counting: =TEXTBEFORE(A2,"-") gives TX. They're often simpler than LEFT with FIND, but they don't exist in Excel 2021 and older. For a one-off job, Flash Fill (Windows: Ctrl+E; Mac: Data > Flash Fill) copies a pattern you type by example, though it doesn't update when the data changes.

To put the pieces back together in a new order, use & or TEXTJOIN; see how to combine text in Excel. The LEFT function guide is a quick syntax reference.

Practise it#

Practise LEFT, RIGHT, MID and LEN in a live spreadsheet. You'll split product codes into region, category and item number, turn text digits into real numbers with VALUE, and use LEN to handle IDs of different lengths.

Try it yourself

This is a live spreadsheet. Type the formula in the green cell and press Enter.

Each code is region, category and item number, like TX-ELC-40512. Click B2 and use MID to get the 3-letter category, which starts at character 4.

fx
ABCD
1
Product Code
Category
2
TX-ELC-40512
3
CA-FUR-11873
4
NY-OFF-30291
5
WA-ELC-52046
6
FL-APP-27734
7
IL-FUR-19358
8
9
10

Tip: MID needs three parts: the cell, where to start, and how many characters to take.

Practise this in a lesson

LessonLEFT, RIGHT, MID and LENSplit product codes and IDs into their parts by taking characters from the start, end or middle of the text.Function guideLEFTPull the first characters from a cell with Excel's LEFT: prefixes, initials and first names. Examples, pitfalls and live practice.

Frequently asked questions

What is the difference between LEFT, RIGHT and MID?

+

LEFT takes characters from the start of the text, RIGHT from the end, and MID from any position you choose. MID needs a start position as well as a number of characters.

How do I extract the first 3 characters in Excel?

+

Use LEFT with 3 as the number of characters: =LEFT(A2,3). If you leave out the number, LEFT returns just the first character.

How do I remove the first 4 characters of a cell?

+

Take everything except those 4 from the right: =RIGHT(A2,LEN(A2)-4). LEN counts all the characters, so LEN(A2)-4 is what's left.

Why can't I add up the numbers from RIGHT or MID?

+

LEFT, RIGHT and MID always return text, and SUM skips text. Wrap the formula in VALUE, as in =VALUE(RIGHT(A2,5)), to get a real number.

What does MID return if the text is too short?

+

MID returns whatever is left. If start_num is past the end of the text, it returns empty text. It only errors when start_num is less than 1 or num_chars is negative.

Sources

  • LEFT, LEFTB functions - Microsoft Support
  • RIGHT, RIGHTB functions - Microsoft Support
  • MID, MIDB functions - Microsoft Support

Written and checked by the ExcelReady Team. First published October 30, 2026. The practice exercise runs in the same formula engine as our lessons. Found a mistake? Read our editorial policy or email hello@excelready.app.

On this page

  1. What do LEFT, RIGHT and MID do?
  2. How to use LEFT to take characters from the start
  3. How to use RIGHT to take characters from the end
  4. How to use MID to take characters from the middle
  5. Why does RIGHT return a number I can't add up?
  6. How to handle text of different lengths with LEN
  7. Common mistakes with LEFT, RIGHT and MID
  8. What to use instead: TEXTBEFORE, TEXTAFTER and Flash Fill
  9. Practise it

Keep reading

Text· 7 min read

Find the Position of Text in a Cell (FIND and SEARCH)

FIND and SEARCH return the position of some text inside a cell, as a number. =FIND(" ",A2) gives 5 for Dana Whitfield, because the space is the 5th character. FIND is case-sensitive; SEARCH ignores capitals and allows wildcards. Both return #VALUE! when the text isn't there, so wrap them in ISNUMBER to test whether a cell contains a word.

Text· 7 min read

How to Combine Text in Excel (&, CONCAT, TEXTJOIN)

To combine text in Excel, join the pieces with &: =A2&" "&B2 turns Nora and Delgado into Nora Delgado. CONCAT does the same with a list of pieces. TEXTJOIN puts the same separator between every piece and can skip empty cells: =TEXTJOIN(", ",TRUE,C2:E2). Type spaces and commas yourself, inside double quotes.

Text· 7 min read

Clean Messy Data in Excel With TRIM, CLEAN and PROPER

Use TRIM to remove extra spaces, CLEAN to remove hidden non-printing characters, and PROPER to put a capital at the start of each word. Nest them to fix several problems at once: =PROPER(TRIM(A2)) turns " maria gonzalez" into "Maria Gonzalez". Build the clean version in a new column, check it, then paste it as values.

Don't just read about Excel. Do it.

Practise real formulas in a live spreadsheet with instant feedback. The first lessons are free, with no download.

Start learning for free