Is there away to define the right function to pull all characters until it reaches a space? Like say there's a name in cell A1 that says "John Doe" can it just read the doe and then see the space and stop? Any ideas would be appreaceated.
It will return the last part of a cell's text if there is a space separating it and will return the cell's text if no space is found.
The only problem is that it looks for the first instance of a space, so if the cell's text is John Dill Doe the formula will return Dill Doe instead of just Doe
I hope this helps!!!
If you can't be "The Best", be the best at what you can!!!
If by any chance you were looking to split a bunch of names, then you should also take a look at Data / Text To Columns / Delimited / Space as delimiter
Ken,
I think you missed my point. Parsing on a full name doesn't work with people who have a space in their first or last name. That's why I signed with my full name. For example, your code parsed my last name as Buren instead of Van Buren.
Because some people have a space in their first name, and some have a space in their last, parsing a full name can't be done reliably with code alone.
I know some people with the following "endings" - Sr., Jr., II, III, Esq.
And some women with two last names, eg. Alexander Smith. (and they'll let you know if you forget one!)
So now what do you do?
Sorry, see what you mean. I tried using the code you had been given on your name, and it actually returned 'Van Buren'. Assumed from this you were pointing out that it did not pick up just the last group of characters, and was not what you wanted as it was dependent on how many names were listed. The formula I gave you would do that regardless of how many names there were. You are quite correct though, in that you will never get away from having to do a sanity check on the data afterwards. You could always code in a list of typical last name prefixes such as 'Van' etc and have it adjust to suit, but even then you still need that sanity check.
I have a similar issue that I'm struggling with.
I'm trying to find a character, "/", starting from the right, and then extract everything BEFORE that character.
Rgds, Geoff Quantum materiae materietur marmota monax si marmota monax materiam possit materiari?
Want the best answers to your questions ? faq222-2244
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.