View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
PapaDos PapaDos is offline
external usenet poster
 
Posts: 208
Default extract word function

Thanks, Roger.
I should have thought of that problem.

I used the double space because it is a combinatioin that is sure not to
exist in the searched string (TRIMmed). I could have used CHAR(160) but,
being lazy I used the "shortest to type" route...
;-]

--
Regards,
Luc.

"Festina Lente"


"Roger Govier" wrote:

Hi Luc

An excellent solution, but because of text wrapping in the posting,
anybody copying and pasting the formula may get a problem.

In both of the Substitute terms,
it is a single space " " that is substituted by a double space " "

When I copied and pasted, it somehow dropped one of the double spaces in
the first term, and of course this returned the whole of the text from
cell A1.

--
Regards

Roger Govier


"PapaDos" wrote in message
...
=LEFT( TRIM( A1 ), IF( ISERR( SEARCH( " ", SUBSTITUTE( TRIM( A1 ), "
", "
", 3 ) ) ), LEN( A1 ), SEARCH( " ", SUBSTITUTE( TRIM( A1 ), " ", "
", 3 ) )
- 1 ) )
--
Regards,
Luc.

"Festina Lente"


"Dinesh" wrote:

Is their a function to extract first 3 words from a text string?

Thanks.

Dinesh Shah