+ Reply to Thread
Results 1 to 4 of 4

[SOLVED] "contains" function

  1. #1
    Xhawk57
    Guest

    [SOLVED] "contains" function

    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?!?

  2. #2
    Valued Forum Contributor
    Join Date
    03-25-2004
    Location
    Boston, MA US
    Posts
    1,094
    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

  3. #3
    Kevin B
    Guest

    Contains Function

    Use Find instead.

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

    =if(ISERROR(FIND("Golf",A1,1),"","*")
    --
    Kevin Backmann

  4. #4
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996
    I like this approach....

    For a value in A1

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

    Does that help?

    Regards,
    Ron

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1