+ Reply to Thread
Results 1 to 6 of 6

Searching for Specific Text in a Row

  1. #1
    Forum Contributor
    Join Date
    10-04-2006
    Posts
    151

    Searching for Specific Text in a Row

    Hi again,

    I think this ought to be pretty easy, but I just don't know how to do it!

    I have this text in different cells in a row. In this example, the cells are separated with a "-"

    Row1: apples - oranges - bananas - peaches - plums - pears - tomatoes

    Row2: candy - clothes - jacket - pants - sweater - oranges - socks

    What I would like to do is search for the text "oranges" in row one and IF FOUND put the found text into a different cell all together. I would like the same thing to happen with row 2, 3 , 4 and so on.

    Thank you for your time! I appreciate everyones help

  2. #2
    Forum Contributor
    Join Date
    03-13-2005
    Posts
    6,195
    Quote Originally Posted by NewExcelUser
    Hi again,

    I think this ought to be pretty easy, but I just don't know how to do it!

    I have this text in different cells in a row. In this example, the cells are separated with a "-"

    Row1: apples - oranges - bananas - peaches - plums - pears - tomatoes

    Row2: candy - clothes - jacket - pants - sweater - oranges - socks

    What I would like to do is search for the text "oranges" in row one and IF FOUND put the found text into a different cell all together. I would like the same thing to happen with row 2, 3 , 4 and so on.

    Thank you for your time! I appreciate everyones help
    Hi,

    you could use two sheets, otherwise start at row 3 - 4 - 5 etc to avoid using row 2 twice.

    With the required words in A3, A4, A5 etc, in B3 put

    =HLOOKUP(A3,A1:H2,2,FALSE)

    or

    =HLOOKUP(A1,Sheet2!A1:H2,2,FALSE)

    and formula fill that downwards.

    hth
    ---
    Si fractum non sit, noli id reficere.

  3. #3
    Forum Contributor
    Join Date
    10-04-2006
    Posts
    151
    Hi Bryan,

    Thanks for your reply. What I failed to mention was that the list is imported from a consistently changing text file. The words are not in the same location (cells, rows) very often, if they are there at all.

    I appreciate your time looking at this.

  4. #4
    Banned User!
    Join Date
    10-14-2006
    Posts
    1,211
    Quote Originally Posted by NewExcelUser
    Hi again,

    I think this ought to be pretty easy, but I just don't know how to do it!

    I have this text in different cells in a row. In this example, the cells are separated with a "-"

    Row1: apples - oranges - bananas - peaches - plums - pears - tomatoes

    Row2: candy - clothes - jacket - pants - sweater - oranges - socks

    What I would like to do is search for the text "oranges" in row one and IF FOUND put the found text into a different cell all together. I would like the same thing to happen with row 2, 3 , 4 and so on.

    Thank you for your time! I appreciate everyones help
    =IF(COUNTIF(1:1,"oranges"),"found","not found")
    or
    =IF(ISNUMBER(MATCH("oranges",1:1,0)),"found","not found")

    copy down

  5. #5
    Forum Contributor
    Join Date
    10-04-2006
    Posts
    151

    Ok Ok! Almost!

    Thank you so much for the help! Almost there. This is what I am looking for:

    Instead of displaying "found," or "not found," can the found criteria be displayed?

    Also, I would need the code to be modified to a four multiple criteria search

    Lets say, search the row for "oranges", "apples", "pears", and "bananas." and if one of the words were found, the found word displayed?

    Thank you sooo much. Your help is invaluable.

  6. #6
    Forum Contributor
    Join Date
    10-04-2006
    Posts
    151

    Figured It Out!

    Thanks to all that have responded!! I have modified the code posted by teethless mama and it seems to work!

    Please Login or Register  to view this content.
    Thanks a million.

+ 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