MID
Pull characters from the middle of a text string with MID, starting at any position you choose.
Spreadsheet editor
Spreadsheet editor
Syntax
=MID(Text, Start_num, Num_chars)
Returns: Text Arguments
| Argument | Required | Description |
|---|---|---|
| Text | Yes | The text string you want to pull characters from. |
| Start_num | Yes | The position of the first character to extract. The first character in the text is position 1. |
| Num_chars | Yes | How many characters to return, starting at Start_num. |
About
Use MID when the part you need sits in the middle of a value, like a region code buried in a product ID or the month inside a date stamp. For text at the very start or end, LEFT and RIGHT are simpler. MID really shines when you pair it with FIND or SEARCH to locate a delimiter, then pull out the text between two markers.
MID always returns text, even when the result looks like a number. If you plan to do math with the output, wrap it in VALUE to convert it back to a number first.
Exercises using MID
Parse full address
IntermediateExtract city from a full address string (assume consistent format).
Open exerciseComplex text parsing
AdvancedParse inconsistently formatted addresses into separate columns (street, city, state, zip).
Open exerciseExtract data from mixed format
AdvancedExtract product codes from descriptions with mixed labels and positions.
Open exerciseSee a MID formula step by step
Watch each part of the formula with live results of every step in a formula walkthrough.
Explain your own formula →Examples
Grab the rest of a string
Spreadsheet editor
Why the result will not do math
Spreadsheet editor
Extract a domain with MID and FIND
Spreadsheet editor
Watch out for
Counting from zero instead of one
MID starts counting at 1, not 0. Using a Start_num of 0 (or any value below 1) returns a #VALUE! error.
→ Always treat the first character as position 1. The space counts as a character too, so include spaces when you count.
Treating the result as a number
MID always returns text, so a result like "06" or "2024" will not behave as a number in calculations.
→ Wrap the formula in VALUE to convert the text to a real number you can do math with.