ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   =TRIM(LEFT(B47,FIND(" ",B47)-1)) (https://www.excelbanter.com/excel-discussion-misc-queries/254698-%3Dtrim-left-b47-find-b47-1-a.html)

Jim

=TRIM(LEFT(B47,FIND(" ",B47)-1))
 
Hello,

How do I write this formula so that the result is a blank cell if B47 is
blank? I get a #VALUE now.

=TRIM(LEFT(B47,FIND(" ",B47)-1))

Thanks so much for hte help

Eduardo

=TRIM(LEFT(B47,FIND(" ",B47)-1))
 
Hi,

=if(B47="","",TRIM(LEFT(B47,FIND(" ",B47)-1)))

"Jim" wrote:

Hello,

How do I write this formula so that the result is a blank cell if B47 is
blank? I get a #VALUE now.

=TRIM(LEFT(B47,FIND(" ",B47)-1))

Thanks so much for hte help


Dave Peterson

=TRIM(LEFT(B47,FIND(" ",B47)-1))
 
Another way:
=TRIM(LEFT(B47,FIND(" ",B47&" ")-1))

This will protect against B47 not having any space character, too.

Jim wrote:

Hello,

How do I write this formula so that the result is a blank cell if B47 is
blank? I get a #VALUE now.

=TRIM(LEFT(B47,FIND(" ",B47)-1))

Thanks so much for hte help


--

Dave Peterson

Dave Peterson

=TRIM(LEFT(B47,FIND(" ",B47)-1))
 
And if you're going to use trim, you don't need to subtract 1. The =trim() will
remove the trailing space.

=TRIM(LEFT(B47,FIND(" ",B47&" ")))



Jim wrote:

Hello,

How do I write this formula so that the result is a blank cell if B47 is
blank? I get a #VALUE now.

=TRIM(LEFT(B47,FIND(" ",B47)-1))

Thanks so much for hte help


--

Dave Peterson

Shane Devenshire[_2_]

=TRIM(LEFT(B47,FIND(" ",B47)-1))
 
Hi,

If I understand correctly you want to keep everything upto the first blank:

Select the cell or range (B47 here) and choose Data, Text to Columns,
Delimited, Next, specify Space as the delimiter and click Next. Select all
columns to the right of the first column in the preview area and choose Do
not import, Skip. Set a destination cell and click OK.

--
If this helps, please click the Yes button.

Cheers,
Shane Devenshire


"Jim" wrote:

Hello,

How do I write this formula so that the result is a blank cell if B47 is
blank? I get a #VALUE now.

=TRIM(LEFT(B47,FIND(" ",B47)-1))

Thanks so much for hte help



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

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