+ Reply to Thread
Results 1 to 5 of 5

Search for Text within Text

  1. #1
    Forum Contributor
    Join Date
    07-02-2008
    Location
    Utah
    Posts
    171

    Search for Text within Text

    Hi Fellow Excel'rs,

    I am looking for a formula to search within a cell for text that matches the text I have in a list. If it matches, then I want it to return the value in my list offset by to columns. In the attached spreadsheet, If cell B4 contains text that matches any of the values in column K, then return the country in column M. I then want to drag this formula down column C.

    Thanks so much!
    John
    Attached Files Attached Files
    Last edited by John Bates; 09-03-2009 at 05:44 PM. Reason: Solved

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,057

    Re: Search for Text within Text

    How about this?

    Book1(1).xls

    This assume that your code is 2 characters before :
    Never use Merged Cells in Excel

  3. #3
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,057

    Re: Search for Text within Text

    Another approach (with more correct answers) would be to find first zero and look 2 characters after it:

    =INDEX($M$4:$M$270;MATCH(MID(B4;FIND("0";B4;1)+1;2);LEFT($L$4:$L$270;2);0); )

    (confirmed with ctrl+shift+enter

    (difference only in FIND("0";B4;1)+1;2 part)
    Last edited by zbor; 09-03-2009 at 05:38 PM.

  4. #4
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,057

    Re: Search for Text within Text

    Book1(1)(2).xls

    But I see error in last row wich from word %22%20style% style consider as sao tome and principe...

  5. #5
    Forum Contributor
    Join Date
    07-02-2008
    Location
    Utah
    Posts
    171

    Thumbs up Re: Search for Text within Text

    That works great!!! Thank you so much!!

+ 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