First word in a cell

daffy

Board Regular
Joined
Mar 18, 2009
Messages
113
Hi Guys

Is this possible?

What i would like to do is.

If the first word in a cell for example says "travel" then display the content of another cell, if it does not then just leave the other cell blank.

Its a job sheet that says travel to ???????? or travel to ******
So i need to pick out just the word "travel"

There are other line in the spreadsheet that do not say travel at all so these to will be ignored.

This may be simple but i am stuck on it.

Thanks in advanced for any help.

Don
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
in a new cell3, try: =if(left([cell1],6)="travel",[cell2],"")

where [text] are your relevant cell references
 
Upvote 0
Guys

Thanks for the quick responce.

Mike, Got yours to work no problem

Bait Master Could not seem too get your to work.

Thank you both for your help (it was much needed)

Don
 
Upvote 0
Guys

Thanks for the quick responce.

Mike, Got yours to work no problem

Bait Master Could not seem too get your to work.

Thank you both for your help (it was much needed)

Don
Mike's solution included a check to make sure the first word was "Travel" rather than something like "Travelling". A simpler way to do that would be:
=IF(LEFT(A1,7)="Travel ",B1,"")
 
Upvote 0
Peter

Thank you for your post.

Could you explain to me what the number 7 is for.

=IF(LEFT(A1,7)="Travel ",B1,"")

Thanks

Don
 
Upvote 0
LEFT(A1,7) refers to the first 7 characters in the string contained in cell A1

The idea being that "travel" is 6 letters and if the string started with "travelling" you'd still get a match, whereas comparing the first 7 characters and including the space after "travel " ensures this doesn't happen. If you want it to, go back to left(A1,6)="travel"
 
Upvote 0

Forum statistics

Threads
1,214,584
Messages
6,120,387
Members
448,956
Latest member
JPav

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