sort names by last name

dshafique

Board Regular
Joined
Jun 19, 2017
Messages
171
Hi guys, i have a set of data where the whole name is one cell, including the middle name. I want a formula which will organize it by last name, first name middle name. I have one formula which does something similar, but it gives me an error for cells that contain one word, like vacant, or something/guest

here's the formula i have

Code:
=MID(A2&", "&A2,FIND(" ",A2,FIND(" ",A2)+COUNTIF(A2,"* * *"))+1,LEN(A2)+1)
 
Sorry . . . .
Most Last names are singular, occasionally we the the hyphenated name but the formula seems to work on those as well.
I will try your formula. I think that is going to be the best one.
Our PDF form sends a blank space when there is not a MI in the field . . . I could probably fix that in the form, but don't know how.

Thank you so much for helping, I do appreciate you.
 
Upvote 0

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
.. occasionally we the the hyphenated name but the formula seems to work on those as well.
Yes, hyphenated names will be fine. It is only if there are spaces in the last name like the examples I gave there will be a problem. Let's hope you don't have any of those. :cool:
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,327
Members
452,635
Latest member
laura12345

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