Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Insert X if cell contains a value 1

Status
Not open for further replies.

jh3016

Programmer
Jun 6, 2003
148
US
In cell K2, there are five words "apples pears strawberries watermelon grapes". I want to put an X in cell L2 if the word grapes appears in cell K2. Is there a way to do this?
 
Thanks for the quick response. I did not explain properly.

What I'm trying to do is say if K2 CONTAINS "grapes", then put an X in L2. I just don't know how to do a CONTAIN.
 
duhhhh!!!! oh my goodness. I'm so embarrassed. You are a genius. Thanks!!!!
 
Hi jh3016,

Try this in L2: IF(ISERR(SEARCH("grapes",K1)),"","x")

You can use FIND in place of SEARCH, but it is case sensitive and will not find "Grapes" if you are looking for "grapes"
 
OK, this works just great. One more question. How about if I want to say if K2 contains grapes or apples or oranges, put an "X" in L2.
 
You'll have to excuse Skip. It's 105 degrees where he is. I think his brain is fried. [LOL]

[blue]
Code:
=IF(AND(ISERR(SEARCH("grapes",K1)),ISERR(SEARCH("apples",K1)),ISERR(SEARCH("oranges",K1))),"","x")
[/color]


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top