Google Sheets function
MID function in Google Sheets
MID in Google Sheets returns a chosen number of characters from the middle of a text string, beginning at a specified position. Use MID when a code, date segment, or other useful part starts at a consistent character position within each value.
Source: Google Docs Editors HelpLast verified Nov 5, 2026
Syntax
=MID(string, starting_at, extract_length)Arguments
| Argument | Required | What it means |
|---|---|---|
string | Yes | The text containing the characters to return. |
starting_at | Yes | The one-based character position where extraction begins. |
extract_length | Yes | The number of characters to return. |
Examples
Extract a product number
| A | |
|---|---|
| 1 | Product code |
| 2 | SKU-482-NY |
=MID(A2,5,3)Result: 482
Starting at the fifth character, MID returns the next three characters.
Common mistakes
Counting the first character as position zero.
Count the first character as position 1.
Using MID when the desired text always begins at the first character.
Use LEFT for a fixed number of characters from the beginning.