Skip to content

Lessons in your language are coming soon. Formulas already work in your Excel language.

This page isn't translated yet, so its text is in English. Function names and formulas are shown in your Excel language.

Excel function · Finding text

MID

Returns characters from the middle of a text.

What it does

MID takes characters from inside a text: you give the position to start at and how many characters to take.

Syntax

=MID(text, start_num, num_chars)

Arguments in square brackets are optional, and … means you can add more of the same. In this Excel language, arguments are separated by ,

Arguments

text
The text to take characters from.
start_num
The position of the first character to take. The first character of the text is 1.
num_chars
How many characters to take from there.

Example

Order codes have a prefix, a number and a region. What is the number part of ORD-7731-EU?

AB
1Order no.Number part
2ORD-7731-EU7731

The formula in B2:

=MID(A2,5,4)

Result: 7731

ORD- takes up four characters, so the number starts at character 5. Taking four characters from there gives 7731.

Common mistakes

  • Starting one character too early or too late. Count the separator too: the hyphen is character 4 here.
  • Leaving out the number of characters. Unlike LEFT and RIGHT, MID needs all three arguments.

In other Excel languages

Excel translates function names, and in some languages the argument separator too. Type the name your Excel shows.

Excel languageFunction nameSeparator
EnglishMID,
DeutschTEIL;
FrançaisSTXT;
Español (España)EXTRAE;
Español (México)EXTRAE,
日本語MID,
한국어MID,
繁體中文MID,
ไทยMID,
ខ្មែរMID,
Tiếng ViệtMID;

Practise it

More from this module

All functions