Return leftmost word in cell

ljtong

Board Regular
Joined
May 23, 2005
Messages
71
Hello All,

I need to get the leftmost word in a cell.

I have used =LEFT(D34,FIND(" ",D34))

But if it is a 1 word cell (no spaces), I get #Value - I would like to return the single word

Is there any other method besides putting in ISERROR into all the formulas?

Thanks
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
Hello LJTong,

Or try this one: =IF(LEN(D34)-LEN(SUBSTITUTE(D34," ",""))=0,D34,LEFT(D34,FIND(" ",D34)-1)).

You have to make sure you have no trailing spaces. Cheers !

Romulus.
 
Upvote 0
i think you're going to have to include an IF statement and a FIND statement in there. Use the FIND in conjunction with the IF to return the position of a blank space (""), then if there is one, use the LEFT function like you have, to get the all the characters to the left of the blank that it found.
If it did NOT find a blank space, just get the whole cell.

hope this helps

-dk
 
Upvote 0
Hi ljtong:

I will take the nice formula from barry houdini and also use the TRIM function ...

=TRIM(LEFT(D34,FIND(" ",D34&" ")))
 
Upvote 0

Forum statistics

Threads
1,223,757
Messages
6,174,331
Members
452,555
Latest member
colc007

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top