SheetsLessons
Lesson 22 · Text

LEFT, RIGHT & MID

Extract text in Google Sheets with LEFT, RIGHT and MID. Practice pulling codes out of SKUs and IDs.

Task 1 of 3

Extract the 3-letter category code from the start of the SKU in A2. Answer in B2.

B2
fx

Tip: while typing a formula, click a cell or drag across cells to insert references. Press Enter to check, and Tab to accept a function suggestion.

Pulling characters out of text

=LEFT(string, [number_of_characters])
=RIGHT(string, [number_of_characters])
=MID(string, starting_at, extract_length)

Use these when your data follows a fixed pattern. For a SKU like ELC-0427-NY:

  • =LEFT(A2, 3) → ELC
  • =RIGHT(A2, 2) → NY
  • =MID(A2, 5, 4) → 0427 (start at character 5, take 4)

The results are text. "0427" keeps its leading zero. Wrap it in VALUE() if you need to do math with it.

If the pieces vary in length, combine these with FIND to locate a separator.