The MID function can help you to extract a specified number of characters from a text, starting from a specified position.
In simple words, you can specify that how many characters you want to extract, starting from a particular position.
In the below example, we have used mid to extract “Champs” from “ExcelChamps.com” by the specifying position of the first letter of the required text string and the number of characters required.
- text A text or number from which you want to extract some characters.
- start_char Position of character from where you want to extract characters.
- num_chars Number of characters you want to extract from the start_char.
In the below example, we have used different values in function arguments for your better understanding.
- From 6th character to next 6 characters extracted.
- From 6th character to next 10 characters extracted.
- We have used starting character in negative and it has returned an error.
- By using 0 for the number of characters to extract & it has returned a blank.
- With negative number for the number of characters to extract & it has returned an error.
- Starting number is zero and it has returned an error.
- Text string directly into the function.