Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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" ?

like image 328
pencilCake Avatar asked Nov 11 '12 13:11

pencilCake


2 Answers

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

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

like image 197
barry houdini Avatar answered Sep 30 '22 10:09

barry houdini


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.

like image 28
Conroy Daley Avatar answered Sep 30 '22 11:09

Conroy Daley