View Single Post
  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Harlan Grove Harlan Grove is offline
external usenet poster
 
Posts: 733
Default Extract Middle Initial from Name

Dave Y wrote...
I have a list of names; some of which contain the fistname, middle
initial, and last name. The other names in the list are only first
and last names. For example: John T. Doe and John Doe. I need to
extract the middle intial and the period after the MI so that I end
up with a list of names with just the first name and last name.

....

As someone who goes by his middle name, I have to question the
'logic' (or lack of same) for doing this. If you did this to my name,
my father's and my grandfather's, we'd all wind up with the same name.
None of us use generational qualifiers since all of us have different
middle names, so there'd be no other way to distinguish between our
names.

You really want to lose the ability to distinguish between possibly
(likely?) different individuals?

If so, try

=IF(COUNT(FIND(" ",TRIM(A1),FIND(" ",TRIM(A1))+1)),
LEFT(TRIM(A1),FIND(" ",TRIM(A1)))&MID(TRIM(A1),
LOOKUP(2,1/(MID(TRIM(A1),seq,1)=" "),seq)+1,255),TRIM(A1))

which uses the defined name seq referring to the formula

=ROW(INDEX(Sheet2!$1:$65536,1,1):INDEX(Sheet2!$1:$ 65536,256,1))