Excel Function: MID
The Excel function MID retrieves the number of characters of your choice from a text string, starting at a position you specify.
Usage:
=MID(text, start_num, num_chars)
Example of use
The goal here is to retrieve the 4-digit number that is in the middle of the reference number:
To do this, select the MID function and enter:
- Text: the string (here, the reference number)
- Start_num: the position of the first character to extract (here, the fifth character)
- Num_chars: the number of characters to extract from the Start_num position (here, 4 characters)
=MID(A2,5,4)
The MID function successfully returns the 4 desired characters:
Now all that's left to do is drag the formula down to complete the other cells: