Syntax
=MID(string, starting_at, extract_length)
string- The text to extract from.
starting_at- Position of the first character to take (1 = first character).
extract_length- How many characters to take.
MID extracts characters from the middle of a text string, given a starting position and a length. It's the tool for structured codes where the part you need is sandwiched in between.
=MID(string, starting_at, extract_length)
stringstarting_atextract_lengthExtract the 4-digit item number from the middle of the SKU. Answer in B2.
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.
Each example below runs against this sample sheet. The results are calculated by the same engine as the practice grid.
| A | B | C | |
|---|---|---|---|
| 1 | Raw name | SKU | Note |
| 2 | maya PATEL | ELC-0427-NY | Refund requested |
| 3 | leo rossi | FUR-1180-TX | Shipped |
| 4 | AVA KIM | OFC-0093-CA | Refund issued |
| Formula | Result | What it shows |
|---|---|---|
=MID(B2, 5, 4) | 0427 | The item number inside the SKU. |
=MID(B3, 5, 4) | 1180 | Same position, another row. |
=VALUE(MID(B2, 5, 4)) | 427 | Convert to a real number (drops the leading zero). |
Learning step by step? MID is covered in Lesson 22: LEFT, RIGHT & MID of the free course.