Parsing Full Names of varying lenths and parts

D

Dan

I am attempting to parse a Full name that includes First,
Middle, Last and some times PHD, MR or MRS.

I have the first name that was a left with a nested search
but search only works from left to right. I would like to
use right and some function that counts number of chactors
until reaching the space to the left of the last name.

Any Idea?s
 
T

Tom Ogilvy

If you using excel 2000 or later, you can use the split command to put each
part of the name into an array

varr = split("John Winston Smith PHD")
? varr(0)
John
? varr(1)
Winston
? varr(2)
Smith
? varr(3)
PHD

so you could always check the last element of the array

titlecandidate = varr(ubound(varr))

If you don't want to use that, look at instrRev
sStr = "John Winston Smith PHD"
? Right(sStr,len(sStr)-instrRev(sStr," "))
PHD

Again, this requires xl2000 or later.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top