Overview
Grammar | MID(text,start_num,num_chars) | Returns a user-specified number of characters from a specified position of a string. |
Parameter 1 | Text | Text string containing characters to be extracted |
Parameter 2 | Start_num | Starting position to extract characters. To extract from the first character in the text, set start_num to 1. The rules for extracting from other positions of characters are deductive. |
Parameter 3 | Num_chars | Number of characters to be extracted |
Notes
The MID function supports 3 parameters, among which the first parameter is of any type, and the second and third are numeric.
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 it plus num_chars exceeds the text length, MID returns the characters from the starting position to the end of text.
If start_num is less than 1, MID returns the error value *VALUE!.
If num_chars is less than 0, MID also returns the error value *VALUE!.
Example
Formula | Result | Notes |
---|---|---|
MID("Finemoresoftware",9,8) | software | / |