ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   spaces2 (https://www.excelbanter.com/excel-programming/389102-spaces2.html)

delmac

spaces2
 
Hi all, how do I find the first space from the right or the last space from
the left in a string of 30 chars e.g. "the rainfall is very heavy thi"

Thanks as always
PS Ishould have added that the string is only one of several hundred, i.e
its a column of cells c1:c800. and they are all different

thanks again.
--
delmac

Mike H

spaces2
 
Try:-

=FIND("^^",SUBSTITUTE(" "&A1," ","^^",LEN(" "&A1)-LEN(SUBSTITUTE(" "&A1,"
",""))))-1

Mike

"delmac" wrote:

Hi all, how do I find the first space from the right or the last space from
the left in a string of 30 chars e.g. "the rainfall is very heavy thi"

Thanks as always
PS Ishould have added that the string is only one of several hundred, i.e
its a column of cells c1:c800. and they are all different

thanks again.
--
delmac



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

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