View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ron Rosenfeld
 
Posts: n/a
Default Parse from the Right

On Sun, 11 Jun 2006 06:24:01 -0700, PA wrote:

Thanks Ron, that does it for us. It even works if there are four name.


You're welcome. Thanks for the feedback. Yes, it will always return the
characters after the last <space, no matter how many words/names there are.
It will give an error if there is one or zero words. Also, if there are any
trailing spaces, the formula will return a <blank.

In order to eliminate both of those problems, one could change the formula to:

=IF(ISERR(FIND(" ",TRIM(A1))),"",MID(TRIM(A1),FIND(
CHAR(1),SUBSTITUTE(TRIM(A1)," ",CHAR(1),LEN(
TRIM(A1))-LEN(SUBSTITUTE(TRIM(A1)," ",""))))+1,255))


--ron