MID Function
MID extracts characters from the middle of a text string at a specified starting position.
Syntax
Parameters
| Parameter | Description | Required |
|---|---|---|
| text | The text string from which to extract characters. | Required |
| start_num | The starting position of the extraction (1-based). | Required |
| num_chars | The number of characters to extract. | Required |
Basic Example
Extract 5 characters starting at position 7
=MID("Hello World", 7, 5)Extracts 5 characters starting from position 7 in "Hello World".
Advanced Examples
Example 1: Extract middle initial from name
Name parsingGet the middle initial from "John D. Smith"
=MID(A1, FIND(" ", A1)+1, 1)Example 2: Extract substring between two delimiters
Data extractionGet text between two dashes
=MID(A1, FIND("-", A1)+1, FIND("-", A1, FIND("-", A1)+1)-FIND("-", A1)-1)How MID Works
MID starts at the specified position (1-based) and extracts the specified number of characters. Position 1 is the first character.
Important Notes & Limitations
start_num must be at least 1.
If start_num + num_chars exceeds the text length, MID returns as many characters as available.
Common Errors & Fixes
#VALUE!start_num is less than 1Fix: Ensure start_num is at least 1.
Download Practice File
MID
midPractice MID with Real Data
Download a sample CSV file with pre-populated data and practice exercises for the MID function. Works in both Excel and Google Sheets.
File format: CSV (comma-separated values) - opens in Excel, Google Sheets, and all spreadsheet apps