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

J

Jim

Hello,

Thanks for the help. How would I write this formula so that it avoids
errors if the referenced cell is blank?

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

Thanks
Jim
 
G

Gord Dibben

There are two conditions that would give you an error.

1. Blank cell

2. Non-blank cell but no spaces.

If you sure there will only be a blank cell or text string containing a
space then

=IF(B50="","",TRIM(LEFT(B50,FIND(" ",B50)-1)))

Elsewise

=IF(ISERROR(TRIM(LEFT(B50,FIND(" ",B50)-1))),"",TRIM(LEFT(B50,FIND("
",B50)-1)))


Gord Dibben MS Excel MVP
 
G

Gord Dibben

Looking good Biff

Why can't I do things like that?

If I had to build a house I would de-forest the country<g>


Gord
 
T

T. Valko

If I had to build a house I would de-forest the country<g>

Yeah, but I'll bet you'd have a very sturdy house!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top