"contains" function

G

Guest

I am looking for a function that will look for a value in a cell with several
values and if that particular value is present then put an asterix in the
corresponding cell in the next column. example:
I have a list of names in column A, in cloumn B i have a list of each
person's 4 favorite sports ( so if I have Bob in A1 then in B1, I have
Footabll (Alt+ enter) Baseball (Alt + Enter) Basketball (Alt+enter) golf(Alt
+enter)), in column C i want to return an "*" only if B contains "Golf"

I attemped =IF(ISERROR(SEARCH("Golf",B1)),"*","") ... but it retunred * even
for the ones that do not contain "Golf".

Can anyone please help?!?
 
G

Guest

Use Find instead.

FIND("Text to Find", "Text to Search", Start Position)

=if(ISERROR(FIND("Golf",A1,1),"","*")
 
S

SteveG

Try this instead.

=IF(ISNUMBER(SEARCH("Golf",B1,1)),"*","")

Your OP formula says to put an asterik if the search returns an error
so if it is not there then it will return the * but it shouldn't if it
is there.

Does that help?

Steve
 
R

Ron Coderre

I like this approach....

For a value in A1

B1: =IF(COUNTIF(A1,"*golf*"),"*","")

Does that help?

Regards,
Ro
 

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