Syntax
| Parameter | Description |
|---|---|
| text | Parameter of the MID function. |
| start_num | Parameter of the MID function. |
| num_chars | Parameter of the MID function. |
Examples
Extract middle portion of a product code
=MID(A2, 4, 3)
Get month from a date string
=MID(A2, 6, 2)
Extract area code from formatted phone
=MID(A2, 2, 3)
Common Errors
Start position or num_chars is negative or zero. Start must be >= 1 and num_chars >= 0.
The cell is a number, not text. Convert first: =MID(TEXT(A1, "0"), 3, 2).
Tips
=MID(A1, FIND("-",A1)+1, 3) extracts 3 characters after the first hyphen.
Combine FIND and MID to extract text between two markers, e.g., between parentheses or brackets.
If num_chars exceeds the remaining text length, MID just returns what is available — it does not error.
Try MID in Viztab
Import your data and use MID with 370+ other formulas. No signup required.
Open Viztab