Link to home
Start Free TrialLog in
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?
Avatar of Alan
Alan
Flag of New Zealand image

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
Avatar of barry houdini
barry houdini
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial