Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Move last names to front

With James William Ravenswood in A1

=RIGHT(A1,LEN(A1)-FIND(" ",A1,FIND(" ",A1,1)+1)) & ", " & LEFT(A1,FIND("
",A1,FIND(" ",A1,1)+1))

will display
Ravenswood, James William

--
Gary''s Student - gsnu200853


"John" wrote:

I have a large sheet of rows of names and addresses that lists names in the
order:
firstname middlename lastname
What is a quick way to change all entries in the names column to
lastname, firstname middlename
so I can sort the list by last name.

I appreciate your help, -John

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,069
Default Move last names to front

This only works w/ 2 word names. Turns out I have serveral in list who have
multiple middle names. What I need to do is pick off the last name and move
it to the front followed by the comma and the remaining string w/ the last
name removed.

How do I extract the last word in a character string?

I appreciate your help, -John

"Gary''s Student" wrote:

With James William Ravenswood in A1

=RIGHT(A1,LEN(A1)-FIND(" ",A1,FIND(" ",A1,1)+1)) & ", " & LEFT(A1,FIND("
",A1,FIND(" ",A1,1)+1))

will display
Ravenswood, James William

--
Gary''s Student - gsnu200853


"John" wrote:

I have a large sheet of rows of names and addresses that lists names in the
order:
firstname middlename lastname
What is a quick way to change all entries in the names column to
lastname, firstname middlename
so I can sort the list by last name.

I appreciate your help, -John

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Move last names to front

In B1 enter:
=SEARCH("|",SUBSTITUTE(A1," ","|",(LEN(A1)-LEN(SUBSTITUTE(A1," ","")))))
In C1 enter:
=RIGHT(A1,LEN(A1)-B1) & ", " & LEFT(A1,B1-1)

If A1 contains:
Juan Carlos De Borbon Y Borbon
Then B1 displays:
24
and C1 displays:
Borbon, Juan Carlos De Borbon Y

--
Gary''s Student - gsnu200853


"John" wrote:

This only works w/ 2 word names. Turns out I have serveral in list who have
multiple middle names. What I need to do is pick off the last name and move
it to the front followed by the comma and the remaining string w/ the last
name removed.

How do I extract the last word in a character string?

I appreciate your help, -John

"Gary''s Student" wrote:

With James William Ravenswood in A1

=RIGHT(A1,LEN(A1)-FIND(" ",A1,FIND(" ",A1,1)+1)) & ", " & LEFT(A1,FIND("
",A1,FIND(" ",A1,1)+1))

will display
Ravenswood, James William

--
Gary''s Student - gsnu200853


"John" wrote:

I have a large sheet of rows of names and addresses that lists names in the
order:
firstname middlename lastname
What is a quick way to change all entries in the names column to
lastname, firstname middlename
so I can sort the list by last name.

I appreciate your help, -John

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,069
Default Move last names to front

This works much better:
=TRIM(RIGHT(SUBSTITUTE(B6," ",REPT(" ",99)),99)) & ", " &
TRIM(SUBSTITUTE(B6,TRIM(RIGHT(SUBSTITUTE(B6," ",REPT(" ",99)),99)),""))

"Gary''s Student" wrote:

In B1 enter:
=SEARCH("|",SUBSTITUTE(A1," ","|",(LEN(A1)-LEN(SUBSTITUTE(A1," ","")))))
In C1 enter:
=RIGHT(A1,LEN(A1)-B1) & ", " & LEFT(A1,B1-1)

If A1 contains:
Juan Carlos De Borbon Y Borbon
Then B1 displays:
24
and C1 displays:
Borbon, Juan Carlos De Borbon Y

--
Gary''s Student - gsnu200853


"John" wrote:

This only works w/ 2 word names. Turns out I have serveral in list who have
multiple middle names. What I need to do is pick off the last name and move
it to the front followed by the comma and the remaining string w/ the last
name removed.

How do I extract the last word in a character string?

I appreciate your help, -John

"Gary''s Student" wrote:

With James William Ravenswood in A1

=RIGHT(A1,LEN(A1)-FIND(" ",A1,FIND(" ",A1,1)+1)) & ", " & LEFT(A1,FIND("
",A1,FIND(" ",A1,1)+1))

will display
Ravenswood, James William

--
Gary''s Student - gsnu200853


"John" wrote:

I have a large sheet of rows of names and addresses that lists names in the
order:
firstname middlename lastname
What is a quick way to change all entries in the names column to
lastname, firstname middlename
so I can sort the list by last name.

I appreciate your help, -John

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
Move line to front Electric Julie[_2_] Charts and Charting in Excel 1 December 30th 09 12:38 PM
Move line to front Electric Julie[_2_] Charts and Charting in Excel 2 January 13th 09 04:42 AM
How do I swap a group of surnames to the front of first names? Wendy Excel Discussion (Misc queries) 1 June 1st 07 05:07 AM
How do I move a hidden bubble to the front in a bubble chart in E. Scott Excel Discussion (Misc queries) 0 February 20th 05 07:55 PM
move '-' from back to front??? jack27[_2_] Excel Programming 4 December 7th 03 04:01 PM


All times are GMT +1. The time now is 01:42 PM.

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

About Us

"It's about Microsoft Excel"