# Convert the order the first and last name is written via formula

#### polska2180

##### Active Member
Hi assuming I have

"Driver Name: Donald Williams Jr" in Cell A1 in B1 I am looking formula that will show "Williams Jr, Donald"

...not sure if that is possible so the other option is in B1 have just "Donald Williams Jr" then in C1 "Williams Jr, Donald"

thanks for the help.

#### jasonb75

##### Well-known Member
=MID(B1,FIND(" ",B1)+1,LEN(B1))&", "&LEFT(B1,FIND(" ",B1)-1)

edit:- think I might have misread it, I didn't notice that the text, "Driver Name" was in the same cell.

Last edited:

#### kweaver

##### Well-known Member
Along the same lines:

#### kweaver

##### Well-known Member
If you combine those two formulas in B1, you'd have this mess:

Code:
``=MID(MID(A1,FIND(": ",A1)+2,50),FIND(" ",MID(A1,FIND(": ",A1)+2,50))+1,50)&", "&LEFT(MID(A1,FIND(": ",A1)+2,50),FIND(" ",MID(A1,FIND(": ",A1)+2,50))-1)``

#### jasonb75

##### Well-known Member
Correcting my previous error, slighly shorter than the combined version above, but not by much.

=MID(A1,FIND("|",SUBSTITUTE(A1," ","|",3))+1,LEN(A1))&", "&TRIM(MID(SUBSTITUTE(A1," ",REPT(" ",LEN(A1))),LEN(A1)*2,LEN(A1)))

#### jasonb75

##### Well-known Member
Taking a different approach to the combined formula, this one looks like it works.

=SUBSTITUTE(MID(A1&", "&A1,FIND(" ",A1,14)+1,LEN(A1)+1),"Driver Name: ","")

#### kweaver

##### Well-known Member
That's a good one, Jasonb75 !!

##### Active Member
Let me put in my option:

=RIGHT(A1,LEN(A1)-SEARCH(" ",A1,14))&", "&MID(A1,14,SEARCH(" ",A1,14)-14)

So I assume it always starts "Driver Name: " so I know the first name starts at position 14.

The challenge is with people who use a middle name or honorifics.

 A B 1 Driver Name: Donald Williams Jr Williams Jr, Donald 2 Driver Name: Donald Williams Williams, Donald 3 Driver Name: Donny Boy Williams Boy Williams, Donny 4 Driver Name: Mary Lou Williams Lou Williams, Mary 5 Driver Name: Mr Williams Williams, Mr 6 Driver Name: Donald Arthur Williams III Arthur Williams III, Donald 7 Driver Name: Sir Donald Williams, Esq Donald Williams, Esq, Sir

<tbody>
</tbody>
Sheet3

Worksheet Formulas
CellFormula
B1=RIGHT(A1,LEN(A1)-SEARCH(" ",A1,14))&", "&MID(A1,14,SEARCH(" ",A1,14)-14)

<tbody>
</tbody>

<tbody>
</tbody>

Last edited:

#### jasonb75

##### Well-known Member
The challenge is with people who use a middle name or honorifics.
Such exceptions are going to ruin any practical formula.

#### DanteAmor

##### Well-known Member
Another option

=REPLACE(A1,1,FIND(" ",A1,14),"")&", "&MID(A1,14,FIND(" ",A1,14)-14)

1,078,500
Messages
5,340,743
Members
399,393
Latest member
farlow

### This Week's Hot Topics

• Problem with Radio Button's format control
I am creating an employee evaluation template (a sample is below) Column A is the category Column B, C D, E and F will be ratings (unacceptable...
• Last Display on userform to a Listbox
[CODE=vba] lstdisplay.ColumnCount = 15 lstdisplay.RowSource = "A1:O600000" [/CODE] So when i do this it Displays everything on the sheet i am...
• Rename and move files to a new location
Dear all, I have an excel file with the following information. The actual file name is at column A but i want to rename it using the following...
• Help with True/False Formula
Hello! Am stumped how to fix this formula, in which my result returns 'True', but it should return False. =IF(AG2=True...
• Clear extra characters from a provided range of cells
Dear All, I have following code which gives me desired output to remove extra characters from a provided range. But it takes too much time when...
• Help with Current and highest streaks
Hi there, I've just joined the forum and this is my first post. I've already spent quite a bit of time searching the net and this forum for a...