# 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,082,073
Messages
5,363,032
Members
400,708
Latest member
AW76

### This Week's Hot Topics

• populate from drop list with multiple tables
Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
• Find list of words from sheet2 in sheet1 before a comma and extract text vba
Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
• Dynamic Formula entry - VBA code sought
Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...