How to use MID in Excel
MID takes characters from the middle of a text, starting at any position.
Syntax
=MID(text, start_num, num_chars)
text | The text or cell. |
start_num | Position of the first character (1 = first). |
num_chars | How many characters to take. |
Examples
=MID(A2, 4, 4)"BG-1024-SOF" → "1024".=MID(A2, FIND("-", A2)+1, 4)Four characters after the first hyphen.=DATE(MID(A2,1,4), MID(A2,5,2), MID(A2,7,2))"20250315" → a real date.Read a fixed-format code
Many codes have parts at fixed positions. In an IBAN like BG80BNBG96611020345678 the bank code starts at position 5 and is 4 characters long.
=MID(A2, 5, 4)The bank code: BNBG.=MID(A2, 3, 2)The two check digits after the country code: 80.The text between two separators
Start one character after the first separator and stop one before the second. FIND with a start position finds the second one.
=MID(A2, FIND("-", A2)+1, FIND("-", A2, FIND("-", A2)+1)-FIND("-", A2)-1)The middle part of NORTH-10457-2026: 10457.=MID(A2, FIND("(", A2)+1, FIND(")", A2)-FIND("(", A2)-1)The text inside brackets.Take everything after a position
If you don't know how long the rest is, ask for more characters than any text could have. MID simply stops at the end.
=MID(A2, 6, 100)Everything from the 6th character onwards.Common mistakes
- start_num off by one
- The first character is 1, not 0.
- Result is text
- Numbers taken with MID are text — convert with VALUE before calculating.
Frequently asked questions
What's the difference between MID, LEFT and RIGHT?
LEFT cuts from the start, RIGHT from the end, MID from any position. =MID(A2, 1, 3) is the same as =LEFT(A2, 3).
Why does MID return an empty cell?
The start position is beyond the end of the text. Check it with =LEN(A2), and remember extra spaces at the start shift every position: TRIM first.
How do I turn a text like 20261130 into a date?
Cut out the year, month and day and give them to DATE: =DATE(LEFT(A2, 4), MID(A2, 5, 2), RIGHT(A2, 2)).
Does MID return a number?
No, always text. Use =--MID(A2, 5, 4) or =VALUE(MID(A2, 5, 4)) when you need to calculate with the result or look it up in a list of numbers.
Available in: All versions of Excel, Excel for the web, Google Sheets