Extracting First, Middle, and Last Names in Excel 2010
Extracting First, Middle, and Last Names in Excel 2010. To extract the first, middle, and last names from a full name in Excel, we can use various formulas such as “LEFT,” “RIGHT,” “MID,” “LEN,” and “SEARCH.”
Extracting First, Middle, and Last Names in Excel 2010
LEFT: This formula returns the specified number of characters from the beginning of a text string.
Syntax: =LEFT(text, [num_chars])
- Example: If cell A2 contains the text “Mahesh Kumar Gupta,” =LEFT(A2, 6) will return “Mahesh.”
RIGHT: This formula returns the specified number of characters from the end of a text string.
Syntax: =RIGHT(text, [num_chars])
- Example: If cell A2 contains the text “Mahesh Kumar Gupta,” =RIGHT(A2, 5) will return “Gupta.”
MID: This formula returns a specific number of characters from a text string, starting at the specified position.
Syntax: =MID(text, start_num, num_chars)
- Example: If cell A2 contains the text “Mahesh Kumar Gupta,” =MID(A2, 8, 5) will return “Kumar.”
LEN: This formula returns the number of characters in a text string.
Syntax: =LEN(text)
- Example: If cell A2 contains the text “Mahesh Kumar Gupta,” =LEN(A2) will return 18.
SEARCH: This formula returns the starting position of a text string within another text string.
Syntax: =SEARCH(find_text, within_text, [start_num])
- Example: If cell A2 contains the text “Mahesh Kumar Gupta,” =SEARCH(“Kumar”, A2, 1) will return 8.
To separate the names using these formulas, follow these steps:
Example 1: Extracting the First Name
In cell B2, enter the formula: =LEFT(A2, SEARCH(” “, A2))
- This formula extracts the characters from the beginning of the text string in cell A2 up to the first space character.
- Copy the formula from cell B2 and paste it into cells B3 to B6.
Example 2: Extracting the Middle Name
In cell C2, enter the formula: =MID(A2, SEARCH(” “, A2, 1) + 1, SEARCH(” “, A2, SEARCH(” “, A2, 1) + 1) – SEARCH(” “, A2, 1))
- This formula extracts the characters between the first and second space characters in cell A2, representing the middle name.
- Copy the formula from cell C2 and paste it into cells C3 to C6.
Example 3: Extracting the Last Name
In cell D2, enter the formula: =RIGHT(A2, LEN(A2) – SEARCH(” “, A2, SEARCH(” “, A2, SEARCH(” “, A2) + 1)))
- This formula extracts the characters after the last space character in cell A2, representing the last name.
- Copy the formula from cell D2 and paste it into cells D3 to D6.
By using these formulas, you can split names into first, middle, and last names in Microsoft Excel.
(Note: These examples assume the full names are in column A, and the extracted names will be placed in columns B, C, and D, respectively.)