MID
Returns a specific number of characters from a text string, starting at the position you specify.
Syntax
MID(text,start_num,num_chars)
Text is the text string containing the characters you want to extract.
Start_num is the position of the first character you want to extract in text. The first character in text has start_num 1, and so on.
- If start_num is greater than the length of text, MID returns "" (empty text).
- If start_num is less than the length of text, but start_num plus num_chars exceeds the length of text, MID returns the characters up to the end of text.
- If start_num is less than 1, MID returns the #VALUE! error value.
Num_chars specifies how many characters to return from text. If num_chars is negative, MID returns the #VALUE! error value.
Examples
MID("Fluid Flow", 1, 5)
equals "Fluid"
MID("Fluid Flow", 7, 20)
equals "Flow"
MID("1234", 5, 5)
equals "" (empty text)
Also see the examples for CODE and FIND.