FormulaCamp
Completed
← Google Sheets functions
Google Sheets function

MID in Google Sheets

MID with worked examples you can test in the live grid. The argument details are in the Excel guide.

In Google Sheets

The arguments and common errors are covered in the MID Excel guide; check the function help in Google Sheets for its own argument list.

Worked examples in Google Sheets

Area code from a phone number

A
1Phone
2(415) 555-0100

Formula: C2: =MID(A2,2,3)

Result: 415

The area code starts at character 2 and is 3 characters long.

First name after a comma

A
1Name
2Smith, Jane

Formula: C2: =MID(A2,FIND(", ",A2)+2,50)

Result: Jane

FIND locates the comma, +2 skips the comma and the space, and 50 is simply a generous length.

Year from a code, as a number

A
1Code
2EU-2024-0087

Formula: C2: =VALUE(MID(A2,4,4))+1

Result: 2025

MID always returns text; VALUE turns "2024" into a number so +1 works.

Try it

A tiny spreadsheet with example data. Edit the formula or any number and see the result.

Formula in D2: =MID(A5,5,4)

Example spreadsheet for MID
ABCD
1TextOtherResult
2Alice Johnsonalice johnson2026
3[email protected][email protected]
4 extra spaces
5SKU-2026-0415
6iced coffee, tea, sugar
7Order 417 shipped
Result in D2: 2026
Practice this in a lesson: Splitting Strings

Google Sheets is used here only as a descriptive product name. FormulaCamp is not affiliated with Google.