+ Reply to Thread
Results 1 to 7 of 7

find word(s) within text string that matches a list of keywords - variant

  1. #1
    Registered User
    Join Date
    04-05-2012
    Location
    Hamilton, NZ
    MS-Off Ver
    Excel 2003
    Posts
    6

    find word(s) within text string that matches a list of keywords - variant

    Hi,

    I've got a similar question to
    [QUOTE=ecc34_11;2540277]


    This is my first post.


    Basically, I have a column of text strings in worksheet one which I need to check for the presence of keywords which is listed in another column in worksheet two (the keyword list).

    So if any word from the keyword list is found in, say, cell A1 of sheet one, the cell to its right (B1) should have a formula to display the first match
    The list of keywords is about 50
    The problem is that these keywords are within strings of words connected by a colon
    e.g the keyword is vr200a
    but the string where it is to be found in is for instance bker20:fro33:vr200a or fro33:vr200a or as3bb:ttf200:fr033:vr200a
    the string can be of variable length with a variable number of colons in it. Generally the word is found at the end of the string though.

    I've tried to modify Haseeb's solution but to no avail.

    Hope somebody can help me out.

  2. #2
    Valued Forum Contributor
    Join Date
    03-23-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    1,093

    Re: find word(s) within text string that matches a list of keywords - variant

    Hello Cricketnz,

    I have attached a spreadsheet that contains the formulas I believe will get you the results you want.

    Please let me know if you have any questions.

    Thanks!

    RVASQUEZ

    * if this post was helpful please add to my reputation points by clicking the star. Thanks!

  3. #3
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: find word(s) within text string that matches a list of keywords - variant

    That shouldn't be too hard. Click GO ADVANCED and use the paperclip icon to post up a copy of your workbook so we can see exactly where/what you want to list these matches and we can offer a specific answer.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  4. #4
    Registered User
    Join Date
    04-05-2012
    Location
    Hamilton, NZ
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: find word(s) within text string that matches a list of keywords - variant

    Hi RVASQUEZ

    It's close but I would like to extract in column B any matches of the keyword list but I failed to say that the keywords aren't always the same size. They vary from 3 to 10 characters

    Many thanks for your help so far
    Cricketnz

  5. #5
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,728

    Re: find word(s) within text string that matches a list of keywords - variant

    Why don't you attach YOUR workbook, then we can see for ourselves what your data looks like?

    Pete

  6. #6
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: find word(s) within text string that matches a list of keywords - variant

    Quote Originally Posted by cricketnz View Post
    ......So if any word from the keyword list is found in, say, cell A1 of sheet one, the cell to its right (B1) should have a formula to display the first match
    The list of keywords is about 50
    OK, so assume list of keywords in Sheet2 B2:B50 then try this formula in sheet1 B1 copied down

    =LOOKUP(2^15,SEARCH(":"&Sheet2!B$2:B$50&":",":"&A1&":"),Sheet2!B$2:B$50)
    Audere est facere

  7. #7
    Registered User
    Join Date
    04-05-2012
    Location
    Hamilton, NZ
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: find word(s) within text string that matches a list of keywords - variant

    Spot on, daddylonglegs! A star for you.
    Can you also explain how the formula works?

    Many thanks!
    Cricketnz

+ 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