Thread: Last initial
View Single Post
  #13   Report Post  
Posted to microsoft.public.excel.misc
daddylonglegs
 
Posts: n/a
Default Last initial


If all your names follow the format

firstname space singleinitial space lastname

then you can use this formula which will return a blank if A1 is blank

=UPPER(MID(A1,SEARCH(" ? ",A1&" x ")+3,1))

More generally if you want to return the first letter (in upper case)
of the last word in a text string (as in your case) irrespective of
what goes before you could use

=UPPER(LEFT(TRIM(RIGHT(SUBSTITUTE(TRIM(A1)," ",REPT(" ",99)),99))))

which also returns blank if A1 is blank


--
daddylonglegs
------------------------------------------------------------------------
daddylonglegs's Profile: http://www.excelforum.com/member.php...o&userid=30486
View this thread: http://www.excelforum.com/showthread...hreadid=505962