Home » excel » excel – How can I switch a string from "lastName, firstName" to "firstName LastName"?

excel – How can I switch a string from "lastName, firstName" to "firstName LastName"?

Posted by: admin March 9, 2020 Leave a comment

Questions:

I have a column full of names written as:

“lastName, firstName”

I want to have a nother column that has this name list written as:

“firstName LastName”

So, how can I switch a string from “lastName, firstName” to “firstName LastName” ?

How to&Answers:

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

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

Answer:

Enter data into cells e.g.

Brown, John
Green, Bob
Smith, Will

(Note that the comma in this case is the delimiter which the system will use to separate the entries)
Highlight these cells.
Click on the “Data” tab,
click on “Text to Column”.
Choose options offered.

Answer:

The worked for me
=RIGHT(C3,LEN(C3)-LEN(LEFT(C3,FIND(“,”,C3)-1))-1) & ” ” & LEFT(C3,FIND(“,”,C3)-1)

Answer:

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

Assuming Last, First is in column A, separated by one comma and a space bar

For first name:

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

For last name:

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

Put together, assuming Column B is First Name and Column C is Last Name
=B2&” “&C2

or simply (but more complexly)

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

but I like separating them into two columns,
then concatenating them