Reverse name order

X

xp

Hi,

I have a program that will be supplying a list of names (from another
source) that are in last, first, middle order. See example below (they are
exactly as shown - no periods, etc.):

Brown, Charles
Johnson, Larry M
Wilson III, Tommy William
Johnson Jr, Phil E

I need a function that will loop through and reverse the order so they read
like:

Charles Brown
Larry M Johnson
Tommy William Wilson III
Phil E Johnson Jr

Can anyone help me out here?

Thanks!
 
J

Jacob Skaria

With your name in cell A1 try the below formula

=TRIM(MID(A1,FIND(",",A1)+1,99)) & " " & LEFT(A1,FIND(",",A1)-1)


If this post helps click Yes
 
J

Jacob Skaria

If you are looking for a UDF try the below


=ReverseName(A2)

Function ReverseName(strData As String)
arrData = Split(strData, ",")
ReverseName = Trim(arrData(1)) & " " & Trim(arrData(0))
End Function

If this post helps click Yes
 
R

Rick Rothstein

Assuming there is always a space after the comma...

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

otherwise...

=TRIM(MID(A1&" "&A1,FIND(",",A1)+1,LEN(A1)))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top