The Excel MID function extracts a given number of characters from the middle of a supplied text string. For example, =MID(“apple”,2,3) returns “ppl”.
Purpose:
Extract text from inside a string.
Return Value:
The characters extracted.
Syntax:=MID (text, start_num, num_chars)

Examples:
The formula below returns 3 characters starting at the 5th character:
=MID(“The cat in the hat”,5,3) // returns “cat”
This formula will extract 3 characters starting at character 16:
=MID(“The cat in the hat”,16,3) // returns “hat”
If num_chars is greater than remaining characters, MID will all remaining characters:
=MID(“apple”,3,100) // returns “ple”
MID can extract text from numbers, but the result is text:
=MID(12348,3,4) // returns “348” as text
num_chars is optional and defaults to 1.
Tips:
MID will extract text from numeric values, but the result is text
Number formatting is not counted or extracted.