MID Function in Excel

Intermediate

Returns a specific number of characters from a text string, starting at the position you specify.

Syntax

=MID(text, start_num, num_chars)

Example

Use Case

Extract the middle part of a product code.

Common Errors to Avoid

  • Start_num must be ≥ 1 (Excel counts from 1, not 0)
  • Returns #VALUE! if start_num or num_chars is negative
  • Extracting beyond text length returns available characters only

Pro Tips

Combine with FIND to make start position dynamic based on delimiters. Use LEN to calculate num_chars dynamically. Great for extracting patterns from fixed-width data.

Need help with this formula?

Our AI Formula Generator can write this for you instantly.

Try AI Formula Generator →
MID Function in Excel | Excel AI Tools