ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   How can I get Excel (2003) to return just the first 4 words (of another cell)? (https://www.excelbanter.com/excel-worksheet-functions/157417-how-can-i-get-excel-2003-return-just-first-4-words-another-cell.html)

ship

How can I get Excel (2003) to return just the first 4 words (of another cell)?
 
Hi

How can I get Excel (2003) to return just the first 4 words of another
cell?
With thanks


Ship
Shiperton Henethe


Ron Rosenfeld

How can I get Excel (2003) to return just the first 4 words (of another cell)?
 
On Fri, 07 Sep 2007 03:37:37 -0700, ship wrote:

Hi

How can I get Excel (2003) to return just the first 4 words of another
cell?
With thanks


Ship
Shiperton Henethe


What do you want to do if there are less than four words in the cell?

This should get you started. Substitute what you want for less than four words
for the string in the formula below.

=IF((LEN(TRIM(A1))-LEN(SUBSTITUTE(TRIM(A1)," ","")))<4,
"LESS THAN FOUR WORDS",
LEFT(TRIM(A1),FIND(CHAR(1),SUBSTITUTE(TRIM(A1)," ",CHAR(1),4))-1))


--ron

Duke Carey

How can I get Excel (2003) to return just the first 4 words (of an
 
Assuming you have no carets (^) in your cell, and assuming the cell with the
string you want to act on is A1, try

=LEFT(A1,FIND("^",SUBSTITUTE(A1," ","^",4))-1)


"ship" wrote:

Hi

How can I get Excel (2003) to return just the first 4 words of another
cell?
With thanks


Ship
Shiperton Henethe



Mike H

How can I get Excel (2003) to return just the first 4 words (of an
 
try this with your string in A1

=LEFT(A1,FIND(" ",A1,FIND(" ",A1,FIND(" ",A1,FIND(" ",A1,FIND("
",A1,1)+1)+1)+1)))

Mike

"ship" wrote:

Hi

How can I get Excel (2003) to return just the first 4 words of another
cell?
With thanks


Ship
Shiperton Henethe




All times are GMT +1. The time now is 11:05 PM.

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