Full width home advertisement

Post Page Advertisement [Top]

Excel Formula

How To Split First And Last Name

 LEFT(cell, SEARCH(" ", cell) - 1)

RIGHT(cell, LEN(cell) - SEARCH(" ", cell))



LEFT(cell, SEARCH(" ", cell) - 1)

This formula extracts the left portion of a text in a given cell, stopping one character before the first occurrence of a space character in that text.

The LEFT function is used to extract a specified number of characters from the left side of a text string. The function takes two arguments: the text string to extract from and the number of characters to extract.

The SEARCH function is used to find the position of a specified text string within another text string. In this case, the specified text string is a space character " ", and the text string to search within is the cell that we are referencing.

The result of the SEARCH function is then subtracted by 1, which gives us the position of the character just before the first occurrence of a space character in the cell.

By using this position value as the second argument for the LEFT function, we can extract the left portion of the text in the cell up to, but not including, the first space character.

RIGHT(cell, LEN(cell) - SEARCH(" ", cell))

This formula extracts the right portion of a text in a given cell, starting from the first occurrence of a space character in that text and going all the way to the end of the text.

The RIGHT function is used to extract a specified number of characters from the right side of a text string. The function takes two arguments: the text string to extract from and the number of characters to extract.

The LEN function is used to determine the length of a text string. In this case, it is used to determine the length of the cell that we are referencing.

The SEARCH function is used to find the position of a specified text string within another text string. In this case, the specified text string is a space character " ", and the text string to search within is the cell that we are referencing.

The result of the SEARCH function is then subtracted from the length of the cell, which gives us the number of characters from the first occurrence of a space character to the end of the text in the cell.

By using this value as the second argument for the RIGHT function, we can extract the right portion of the text in the cell starting from the first occurrence of a space character and going all the way to the end of the text.

No comments:

Post a Comment

Bottom Ad [Post Page]

| Designed by Colorlib
Youtube Channel Image
ExcelVba DIY SUBSCRIBE for Excel Tutorials
Subscribe