The MID guide
=MID(A2, 5, 3) takes 3 characters from A2, starting at the 5th. In BK26LDS0412W that's LDS. MID counts from 1: the first character is position 1.
Syntax
=MID(text, start_num, num_chars)
- start_num: where to start. The first character is 1.
- num_chars: how many characters to take. Unlike LEFT and RIGHT, MID needs it.
A start past the end of the text gives empty text. A count that runs past the end takes what's there.
Codes with no separators
Systems often pack several things into one reference with no gaps: BK26LDS0412W is a prefix, the year, a site, a booking number and a channel letter. With no space or hyphen to cut at, the position is the only way in, and MID is the function for it. Write the positions out once:
| Characters | 1–2 | 3–4 | 5–7 | 8–11 | 12 |
|---|---|---|---|---|---|
| Part | BK | 26 | LDS | 0412 | W |
The site is MID(A2, 5, 3) and the booking number MID(A2, 8, 4).
Count from 1
If you're used to programming languages that count from 0, you'll write 4 for the 5th character. MID then starts one early: "6LD" instead of LDS. Count B as 1.
The result is text
0412 stays 0412. Wrap MID in VALUE( ) only when you need a number to calculate with; for codes, keep the zeros.
When the position changes from row to row
If the part you want sits after a character, such as a space or a *, let FIND work out the start: MID(A2, FIND(" ", A2) + 1, 50). That's how splitting names and cleaning bank descriptions work.
Common mistakes
- Counting from 0. Every result starts one character early.
- The wrong length. A count that's one short cuts the last character off.
- RIGHT for a part that isn't at the end. RIGHT(A2,4) brings the channel letter along.
- Leaving out num_chars. Excel won't accept the formula.
FAQ
- How do I extract text from the middle of a cell in Excel?
- Use MID: =MID(A2,5,3) returns 3 characters of A2, starting at the 5th.
- Does MID start counting at 0 or 1?
- At 1. The first character of the text is position 1.
- What does MID return if the start is past the end?
- Empty text, "". If the count runs past the end, MID returns the characters up to the end.
- How do I use MID with FIND?
- Use FIND to work out where to start: =MID(A2,FIND(" ",A2)+1,50) takes everything after the first space.



































































