Friday, February 3, 2023

Split Name Using LEFT, RIGHT, MID, LEN, Formula in MS Excel

 Split Name Using LEFT, RIGHT, MID, LEN, Formula

In MS Excel, you can split a name into first name, middle name, and last name using the LEFT, RIGHT, MID, and LEN formulas.

For example, let's say you have a column with names in the format "First Last" in cells A1 to A10. To extract the first name, you could use the following formula:

=LEFT(A1,FIND(" ",A1)-1)

The formula uses the FIND function to locate the space character in the name and subtracts 1 to exclude the space from the result.

To extract the last name, you could use the following formula:

=RIGHT(A1,LEN(A1)-FIND(" ",A1))

The formula uses the LEN function to determine the length of the name and subtracts the position of the space character from it to find the length of the last name.

To extract the middle name, you could use the following formula:

=MID(A1,FIND(" ",A1)+1,FIND(" ",A1,FIND(" ",A1)+1)-FIND(" ",A1)-1)

The formula uses nested FIND functions to locate the first and second spaces in the name, and the MID function to extract the characters in between the two spaces.

Note that this method assumes that the names are in the format "First Last", and may not work correctly for names in different formats or with multiple middle names. In these cases, you may need to use more complex formulas or use a combination of different text manipulation functions.

No comments:

Post a Comment

यह तन विष की बेलरी, गुरु अमृत की खान। शीश दियो जो गुरु मिले, तो भी सस्ता जान।। इसका अर्थ?

 यह दोहा संत कबीरदास जी का है और इसका अर्थ बहुत ही गहरा और प्रेरणादायक है: दोहा: "यह तन विष की बेलरी, गुरु अमृत की खान। शीश दियो जो...