Left function returning first word

  • Thread starter Thread starter Richard Ruda
  • Start date Start date
R

Richard Ruda

We've done a search under help for a "left" function that will return the
first word in a column (so theoretically, the funtion is searching for the
first space and returning all characters to the left of it). It's possible
that this is a combination of functions. Help yould be appreciated.
Thanks
Richard
 
Frank Kabel wrote...
=TRIM(LEFT(A1,FIND(" ",A1)-1))

Um, why bother with TRIM? If the first character in A1 is a space, the
the LEFT call would return "", so nothing for TRIM to do. If the firs
character in A1 weren't a space, then the LEFT call is guaranteed t
return a string with no space characters or a #VALUE! error if ther
were no spaces at all in A1, and in both those cases nothing for TRI
to do.

Did you mean

=LEFT(TRIM(A1),FIND(" ",TRIM(A1)&" ")-1)
 
Frank Kabel wrote...
Um, why bother with TRIM? If the first character in A1 is a space,
then the LEFT call would return "", so nothing for TRIM to do. If the
first character in A1 weren't a space, then the LEFT call is
guaranteed to return a string with no space characters or a #VALUE!
error if there were no spaces at all in A1, and in both those cases
nothing for TRIM to do.

Did you mean

=LEFT(TRIM(A1),FIND(" ",TRIM(A1)&" ")-1)

Hi Harlan
yes, screwed this formula. thanks for the correction!

Frank
 
Back
Top