The Excel MID function returns a specified number of characters from the middle of a text string.
This function is useful for extracting text from a concatenated string of text.
=MID(text, start_num, num_chars)
text = the text string
start_num = the position of the first character in the text string
num_chars = the number of characters to return from the start (left) of the string (if blank, the default is 1 character)
The MID function returns a text string from a specified location within a text strong for a specified length, as defined by the start_num and num_chars arguments.
Example: Extract text from middle of string
In the example above the MID function returns two characters from the middle of the product ID. This function is useful for extracting text from the middle of a text string. In this example this function is used to extract the two characters in between the two dashes in the example data set.
=MID(E6, 5, 2)
In this example the MID function will return the two characters beginning at the 5th position in the text string “FUR-BO-10001798”. The result returned is “BO”.