Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
XP XP is offline
external usenet poster
 
Posts: 389
Default Reverse name order

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!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 320
Default Reverse name order

=MID(A1,FIND(",",A1)+2,255)&" "&LEFT(A1,FIND(",",A1)-1)
and fill down.

"xp" wrote in message
...
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!



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default Reverse name order

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
---------------
Jacob Skaria


"xp" wrote:

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!

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default Reverse name order

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
---------------
Jacob Skaria


"Jacob Skaria" wrote:

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
---------------
Jacob Skaria


"xp" wrote:

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!

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Reverse name order

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)))

--
Rick (MVP - Excel)


"xp" wrote in message
...
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!




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Reverse Row Order? trvlnmny New Users to Excel 3 May 30th 10 08:22 AM
Reverse Order PL Excel Discussion (Misc queries) 3 July 1st 09 05:01 AM
Reverse Order PL Excel Discussion (Misc queries) 1 June 17th 09 02:47 AM
reverse order Lamb Chop Excel Discussion (Misc queries) 2 June 20th 06 03:37 PM
Reverse the order? davegb Excel Programming 2 July 7th 05 09:18 PM


All times are GMT +1. The time now is 03:18 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"