ExcelUnpackUnpack Excel, one formula at a time.
Log inSign up

Lesson 47 · Working with text

LEFT, RIGHT, MID in Excel

LEFT takes characters from the start of a text, RIGHT from the end, and MID from the middle. They are how you split codes and IDs into their parts.

Practice this lesson →Pro lesson. The first 4 lessons are free.

What you will learn

  • Take letters from the start, end or middle of a word

How it works

LEFT(text, 2) takes 2 characters from the start.

RIGHT(text, 3) takes 3 characters from the end.

MID(text, 4, 4) starts at character 4 and takes 4 characters.

Formulas at a glance

=LEFT(A2,2)NY
=MID(A2,4,4)2041
=RIGHT(A2,3)BLU

Example

Write the formula to pull out the two-letter city code from A2.

ABCD
1SKUCityNumberColor
2NY-2041-BLU
3LA-1187-RED
4SF-3320-GRN
5TX-0915-BLK

Click B2 and type =LEFT(A2,2), then press Enter.

The answer is NY.

When to use it

  • Getting a city code from a product code
  • Taking the last 4 digits of a number
  • Splitting codes like NY-2041-BLU

Common mistakes

  • Counting from 0The first character is number 1.
  • Forgetting MID needs a start and a lengthMID(text, start, how many).
  • Getting text instead of a numberLEFT, RIGHT and MID give text. Add 0 if you need a number.

Quick check

What does =LEFT("Excel",2) give?

  1. Ex
  2. el
  3. Exc
  4. xc
Show the answer

A. Ex The first 2 letters.

Practice it on a real sheet

Reading is a start. Doing it is how it sticks. This lesson walks you through every click on a live spreadsheet and checks each answer.

LEFT, RIGHT, MID in Excel: how it works, with examples · ExcelUnpack