Splitting Up Text in One Cell To Many
On Thu, 8 Dec 2005 15:50:02 -0800, Bert_Lady
wrote:
Thanks so much Ron. I did not do a very good job of expalining.
Just a bit more.
The title can include, not only Mr. Mrs., but also Judge, Justice, etc. So
not only titles ending with a period.
--
You will need to incorporate a list of all possible titles in the first
function.
For example:
=REGEX.MID(A1,"(Mr.)|(Mrs.)|(Ms.)|(Dr.)|(Judge)|(J ustice)")
Note that the titles are enclosed in parentheses and separated by pipes. You
can add to the list as you wish.
The following is based on the full name being in A1, and the Title (if any)
being in B1:
For the First Name, we also make a modification in the formula so that instead
of looking at the original string in A1, we process that string to remove the
Title, and then take the first word after that.
=REGEX.MID(SUBSTITUTE(A1,B1,""),"\w+\s")
The Last Name formula remains unchanged:
=REGEX.MID(A1,"\w+$")
--ron
|