View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Pete_UK Pete_UK is offline
external usenet poster
 
Posts: 8,856
Default How to extract right-most word?

Do a Google search on this group for "extract last name" - you'll get
plenty of solutions to this problem.

Hope this helps.

Pete


On Jul 4, 7:32 pm, "
wrote:
How can I extract the right-most "word" from a cell without knowing
its length, how many words are in the cell, or what the word is and
how many times it might occur in the cell?

I define a "word" to be a string of characters delimited by blanks.
To keep things simple, assume that there is always at least one blank
to the left of the last word.

For example, if A1 contains "now is the time", I want a formula in B1
whose result is "time".

I would be content with the following paradigm (which does not work):

=right(A1, len(A1) - find(A1, " ", -len(A1))

In other words, I want a use of FIND() or other function that searches
from the right instead of the left. (Specifying a negative starting
position might be one way to design it, in theory.)

The following paradigm is __not__ acceptable for my purposes, even
though it works in this particular example:

=right(A1, len(A1) - find(A1, "time") + 1)

"It cannot be done otherwise" is an acceptable, albeit undesirable
answer.