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.
| A | B | C | D | |
|---|---|---|---|---|
| 1 | SKU | City | Number | Color |
| 2 | NY-2041-BLU | |||
| 3 | LA-1187-RED | |||
| 4 | SF-3320-GRN | |||
| 5 | TX-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?
- Ex
- el
- Exc
- 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.