A to Z of Excel Functions: The MID Function
7 March 2022
Welcome back to our regular A to Z of Excel Functions blog. Today we look at the MID function.
The MID function
The MID function returns a specific number of characters from a text string, starting at the position you specify, based upon the number of characters you specify.
The MID function employs the following syntax to operate:
MID(text, start_number, number_of_characters)
The MID function has the following arguments:
- text: this is required and represents the text string that contains the characters you want to extract
- start_number: this is also required and specifies the position of the first character you want to extract from text. The first character in text has start_number 1, and so on
- number_of_characters: this argument is mandatory too and specifies the number of characters you want MID to return from the text.
It should be further noted that:
- if start_number is greater than the length of text, MID returns "" (empty text)
- if start_number is less than the length of text, but start_number plus number_of_characters exceeds the length of text, MID returns the characters up to the end of text
- if start_number is less than 1, MID returns the #VALUE! error value
- if number_of_characters is negative, MID returns the #VALUE! error value.
Please see my examples below:
We’ll continue our A to Z of Excel Functions soon. Keep checking back – there’s a new blog post every business day.
A full page of the function articles can be found here.