Menu
Coddy logo textTech

LEFT, RIGHT and MID

Part of the Fundamentals section of Coddy's Excel journey — lesson 32 of 42.

Sometimes you only want a piece of a text. Three slicing functions cover every case:

=LEFT(A2,3)     first 3 characters
=RIGHT(A2,3)    last 3 characters
=MID(A2,5,4)    4 characters, starting at position 5

Take the product code EXL-2026-PRO in A2. =LEFT(A2,3) grabs EXL; =RIGHT(A2,3) grabs PRO.

MID is the flexible one, it takes two numbers: where to start and how many to take. Positions are counted from 1: the E is position 1, the X position 2, and the first 2 of the year sits at position 5. So =MID(A2,5,4) returns 2026.

Count carefully, dashes and spaces occupy positions too, exactly like LEN taught you. Slicing never changes the original: A2 keeps the full code, the piece lands where the formula lives.

challenge icon

Challenge

Easy

Product codes follow the shape XXX-YYYY-ZZZ: a 3-letter line, a 4-digit year, a 3-letter tier. The full code sits in A2.

Split it into the labeled columns:

  1. B2, the line: first 3 characters
  2. C2, the year: 4 characters starting at position 5
  3. D2, the tier: last 3 characters

A different code (same shape) is tested too, slice with functions, don't retype the pieces.

Try it yourself

Sheet1
ABCDEFG
1CodeLineYearTier
2EXL-2026-PRO
3
4
5
6
7
8
9
10
11
12
13
14
quiz iconTest yourself

This lesson includes a short quiz. Start the lesson to answer it and track your progress.

All lessons in Fundamentals