ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Truncate words (https://www.excelbanter.com/excel-worksheet-functions/82995-truncate-words.html)

[email protected]

Truncate words
 
Hi,
Does anyone know if there's a formula to not just count words, but to
trim the number of words in a cell to a certain number (say 5)? So, if
the previous sentence were entered, I could get back "does anyone know
if there's", and the rest would be truncated. Any help is greatly
appreciated!
-Jon R


Bob Phillips

Truncate words
 
=LEFT(A1,FIND("~",SUBSTITUTE(A1," ","~",5))-1)

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

wrote in message
ups.com...
Hi,
Does anyone know if there's a formula to not just count words, but to
trim the number of words in a cell to a certain number (say 5)? So, if
the previous sentence were entered, I could get back "does anyone know
if there's", and the rest would be truncated. Any help is greatly
appreciated!
-Jon R




[email protected]

Truncate words
 
thanks Bob!



All times are GMT +1. The time now is 06:05 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com