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

If your text is coming from web pages, this one is a bit better:

=LEFT( TRIM( SUBSTITUTE( CLEAN( A1 ), CHAR( 160 ), " " ) ), IF( ISERR(
SEARCH( " ", SUBSTITUTE( TRIM( SUBSTITUTE( CLEAN( A1 ), CHAR( 160 ), " " )
), " ", " ", 3 ) ) ), LEN( A1 ), SEARCH( " ", SUBSTITUTE( TRIM( SUBSTITUTE(
CLEAN( A1 ), CHAR( 160 ), " " ) ), " ", " ", 3 ) ) - 1 ) )
--
Regards,
Luc.

"Festina Lente"


"PapaDos" wrote:

=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