name last name order

huorsa

Board Regular
Joined
Feb 15, 2002
Messages
101
I have a column with a list of namen, starting by the person's name then last name and I want to order them by last name.

I have
Peter Wilson
Mark A. Church
Arnold Parker
Benjamin Tompson

I want this:
Church Mark A.
Parker Arnold
Tompson Benjamin
Wilson Peter

Any ideas????
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
It works, just have a little problem, some people have two last name, per example.

John Smith Tuggle

and when I apply your formula it appears
Tuggle Jonh Smith
and it should be
Smith Tuggle John

How can nI fix this
 
Upvote 0
On 2002-11-06 12:20, huorsa wrote:
It works, just have a little problem, some people have two last name, per example.

John Smith Tuggle

and when I apply your formula it appears
Tuggle Jonh Smith
and it should be
Smith Tuggle John

How can nI fix this

That's difficult, unless there is some reularity by which middle names can be distinguished from the two last name cases, such as: all middle names consist of a letter followed by a period and last names are fully written out.
 
Upvote 0
I don't know if this makes it easier, suppose all names have 4 words and the last two words are the last name.

Peter John Smith tuggle
 
Upvote 0
On 2002-11-06 12:55, huorsa wrote:
I don't know if this makes it easier, suppose all names have 4 words and the last two words are the last name.

Peter John Smith tuggle

=WMID(A1,3,2)&" "&WMID(A1,1,2)

or

=WMID(A1,3,2)&", "&WMID(A1,1,2)

if your entries that regular.
 
Upvote 0
Hi huorsa:

In addition to the formulations suggested by Aladin, try

=IF(ISERROR(FIND(".",A1,1)),RIGHT(A1,LEN(A1)-FIND(" ",A1,1))&" "&LEFT(A1,FIND(" ",A1,1)-1),RIGHT(A1,LEN(A1)-FIND(".",A1,1)-1)&" "&LEFT(A1,FIND(".",A1,1)))

This proposed formulation will handle, double last names, single last names, as well as middle initial in the name. See the worksheet simulation ...
Book1
ABCD
1PeterWilsonWilsonPeter
2MarkA.ChurchChurchMarkA.
3ArnoldParkerParkerArnold
4BenjaminThompsonThompsonBenjamin
5JohnSmithTuggleSmithTuggleJohn
Sheet4
</SPAN>

Regards!
Yogi Anand
 
Upvote 0

Forum statistics

Threads
1,214,967
Messages
6,122,503
Members
449,090
Latest member
RandomExceller01

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top