Avatar of cansevin
cansevin asked on

Pull last name out of cell

In column A I names. Some are first and last, some are first, middle and last. In Column B I want just the last name. Somehow tell Column be to take out everything up to the space bar on the left of the last name. Any way to make this happen?
Microsoft Excel

Avatar of undefined
Last Comment
barry houdini

8/22/2022 - Mon
Alan

Hi,

If the full names are in column A, then paste in this formula to another column and copy down:

=MID(A1,FIND(CHAR(1),SUBSTITUTE(A1," ",CHAR(1),LEN(A1)-LEN(SUBSTITUTE(A1," ",""))))+1,LEN(A1))

I think I got that from someone else, so I should be crediting someone - I apologise for not recalling who!

Alan.

Edit:  Found the source: Jean-François Corbett posting in StackOverflow


<<Link to competing Q&A web site omitted. Name of poster on that site added.--byundt, Microsoft Excel Topic Advisor>>
ASKER CERTIFIED SOLUTION
barry houdini

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Your help has saved me hundreds of hours of internet surfing.
fblack61