FP

FormulaPilot

Spreadsheet formula tools

Open generator
Function reference

MID in Excel & Google Sheets

MID is used in 1 formula pattern in this library. Browse worked examples below, or use the generator to build a custom variation for your specific data.

When to use MID

  • Extract a department code embedded in the middle of a product ID, or pull the month from a date-formatted text string.

Worked examples (1)

Common errors with MID

Returns wrong characters

MID starts counting at position 1, not 0. If your result is off by one character, subtract 1 from the start position.

Returns empty string

If the start position is greater than the total length of the string, MID returns an empty string rather than an error.

Frequently asked questions

How do I use MID when the start position varies?

Combine MID with FIND to locate a delimiter dynamically — for example, =MID(A2, FIND("-",A2)+1, 3) extracts 3 characters starting right after the first hyphen.

Need a custom variation?

Describe your specific MID problem and get a formula written for your exact data.

Open generator with MID