Text
MID function playground
Returns characters from the middle of text, starting at a position you choose.
The playground runs in your browser. Nothing you type is sent anywhere.
How MID works
MID starts at character start_num and returns num_chars characters. In PRD-2026-0042, the year starts at character 5.
If you ask for more characters than are left, MID simply returns the rest of the text.
Syntax
=MID(text, start_num, num_chars)| Argument | What it means |
|---|---|
textrequired | The text or cell. |
start_numrequired | The position of the first character to take. The first character is 1. |
num_charsrequired | How many characters to take. |
Examples
| Formula | What it does | Result |
|---|---|---|
=MID(A2,5,4) | The year in the middle of the code. | 2026 · 2025 · 2026 · 2024 … |
=MID(A2,10,4) | The serial number part. | 0042 · 0187 · 0005 · 1120 … |
=MID(E2,FIND("@",E2)+1,100) | Everything after the @. | example.com · example.com · example.org · example.net … |
Common mistakes
Counting from 0The first character is position 1, not 0.
Text resultWrap in VALUE to calculate with the digits.
Related functions
Learn more
Download the example workbook (.xlsx)
The workbook has the same sample data and formulas, plus a practice sheet.