+ Reply to Thread
Results 1 to 7 of 7

Search for multiple words in range of cells...answer in adjacent cell

  1. #1
    Registered User
    Join Date
    08-16-2010
    Location
    San Diego, CA
    MS-Off Ver
    Excel 2007
    Posts
    5

    Smile Search for multiple words in range of cells...answer in adjacent cell

    Hi,

    Please see sample spreadsheet. I'm looking for a function that would:

    A) Search the data in column A for the words, TREAS, DFAS, DCD, PAY (There are more, but I assume I could add them later)

    B) If the data in a cell in column A contains any of these words, put, "FED" in adjacent cell in B column. If the data does not contain any of those words, put, "Non-Fed", in adjacent cell in B column.

    Thanks in advance,

    - Jim
    Attached Files Attached Files
    Last edited by TheDudestMonk; 08-20-2010 at 05:04 PM.

  2. #2
    Forum Expert contaminated's Avatar
    Join Date
    05-07-2009
    Location
    Baku, Azerbaijan
    MS-Off Ver
    Excel 2013
    Posts
    1,430

    Re: Search for multiple words in range of cells...answer in adjacent cell

    Try this in B1 and copy down

    =IF(ISNUMBER(SEARCH({"REAS","DFAS","DCD","PAY"},A1)),"FED","Non-Fed")
    Люди, питающие благие намерения, как раз и становятся чудовищами.

    Regards, «Born in USSR»
    Vusal M Dadashev

    Baku, Azerbaijan

  3. #3
    Forum Guru shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,138

    Re: Search for multiple words in range of cells...answer in adjacent cell

    If you put those words in D1:D4, then in B1 and down,

    =OR(ISNUMBER(SEARCH(" " & $D$1:$D$4 & " ", " " & A1 & " ")))

    ... confirmed with Ctrl+Shift+Enter.

    You words are not well delimited in the text (i.e., not consistently separated by, for example, spaces), so the approach has limitations.
    Entia non sunt multiplicanda sine necessitate

  4. #4
    Registered User
    Join Date
    08-16-2010
    Location
    San Diego, CA
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Search for multiple words in range of cells...answer in adjacent cell

    Thanks contaminated

    It worked, but it only recognized the "REAS,"...all other cells were marked as, "Non-Fed."
    Last edited by TheDudestMonk; 08-20-2010 at 04:56 PM.

  5. #5
    Registered User
    Join Date
    08-16-2010
    Location
    San Diego, CA
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Search for multiple words in range of cells...answer in adjacent cell

    shg thanks much...worked great!

  6. #6
    Registered User
    Join Date
    08-13-2013
    Location
    Suwon
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Search for multiple words in range of cells...answer in adjacent cell

    Hi,

    Please see sample spreadsheet. I'm looking for a function that would:

    A) Search the data in column A for the words, TREAS, DFAS, DCD, PAY (There are more, but I assume I could add them later)

    B) If the data in a cell in column A contains any one or two then return same values. If 2 value found return both with separated by coma.


    Please reply ASAP.

    Thanks in advance.

  7. #7
    Administrator arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,143

    Re: Search for multiple words in range of cells...answer in adjacent cell

    krratna,

    Unfortunately you need to post your question in a new thread, it's against the forum rules to post a question in the thread of another user. If you create your own thread, any advice will be tailored to your situation so you should include a description of what you've done and are trying to do. Also, if you feel that this thread is particularly relevant to what you are trying to do, you can surely include a link to it in your new thread.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ 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