Excel MID Function
The excel MID Function is used to return a specific number of characters from a text string, starting at the position users specify, based on the number of characters they specify. For example, =MID(“amazon”, 2,2) returns “ma”.
In this section:
- Syntax of MID Function
- Extract First Name from Full Name
- Extract last name from full name
- Extract text from bracket using MID function
- Extract middle names from full names separated by commas
- Extract middle names from list of names separated by spaces
1. Syntax of MID Function:
Notes:
- 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.
- If num_chars is negative, MID returns the #VALUE! error value.
2. Extract First Name from Full Name:
To extract the first name from full name, the formula is =MID(C6, 1, SEARCH(” “, C6, 1)), which returns the first name.
3. Extract last name from full name:
To extract the last name from full name, the formula is =MID(C6, FIND(” “, C6), 100), which returns the last names from the full names.
4. Extract text from bracket using MID function:
To extract text from bracket, the formula is =MID(C6, FIND(“(“, C6)+1, FIND(“)”, C6)-FIND(“(“, C6)-1)+0, which returns the number within brackets ( ).
5. Extract middle names from full names separated by commas using MID Function:
To extract the middle names from full names, the formula is =MID(C6,FIND(“,”,C6)+1,FIND(“,”,C6,FIND(“,”,C6)+1)-1-FIND(“,”, C6)), which returns the middle names from the full names.
6. Extract middle names from list of names separated by spaces:
To extract the middle Names, the formula is =MID(C6,FIND(” “,C6)+1,FIND(” “,C6,FIND(” “,C6)+1)-1-FIND(” “, C6)), which returns the middle names.
More related readings:
- MS Office Post on MID Function
- Excel LEN Function
- Excel IFS Function with practical examples
- How to extract first names from list of names
- Excel FIND Function
- Excel FIXED Function
- Excel ARRAYTOTEXT Function
- Excel CLEAN Function with practical examples
- Excel CONCAT Function to join text
- Excel REPLACE Function to replace text
- Excel TRIM Function with Practical Examples
You can definitely see your expertise within the work you write. The world hopes for more passionate writers such as you who aren’t afraid to mention how they believe. All the time go after your heart.