How can I switch the string from "lastName, firstName" to "firstName LastName"?

I have a column full of names written as:

"lastName, firstName"

I want to have a column column that has this list of names written as:

"firstName LastName"

So how can I switch the string from "lastName, firstName" to "firstName LastName"?

+4
source share
4 answers

If the first name is in A2, try copying this formula in B2 down

=MID(A2&" "&A2,FIND(" ",A2)+1,LEN(A2)-1)

+13
source

Enter the data in the cells, for example.

 Brown, John Green, Bob Smith, Will 

(Note that the comma in this case is the separator that the system will use to separate the entries) Select these cells.
Go to the "Data" tab, click "Text in a column".
Choose your options.

+1
source

Worked for me = RIGHT (C3, LEN (C3) -LEN (LEFT (C3, FIND (",", C3) -1)) - 1) and "" and LEFT (C3, FIND (",", C3) -1)

0
source

Invalid answer above . In fact, for my own name, Jay Jacob Wind, the formula breaks. The correct formula is:

Assuming the latter, the first is in column A, separated by one comma and space

For the name:

 =mid(A2,find(",",A2)+2,99) 

For last name:

 =mid(A2,1,find(",",A2)-1) 

Unite, assuming column B is the first name and column C is the last name = B2 & "" & C2

or simple (but harder)

 =mid(A2,find(",",A2)+2,99)&" "&mid(A2,1,find(",",A2)-1) 

but I like to split them into two columns, then concatenate them

-3
source

Source: https://habr.com/ru/post/1445329/


All Articles