Page 10 of 10 FirstFirst ... 8910
Results 91 to 95 of 95

Thread: Extract multiple keywords from text string
Thanks Thanks: 0 Likes Likes: 0

  1. #91
    New Member
    Join Date
    Jun 2012
    Posts
    50
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Extract multiple keywords from text string

    Dear Sir,

    At the outset, feel great to see your message that your fine. Have a great time. Further, Many many thanks for your updated code, its working with the sample data perfectly, superbly, you are really Genius Sir. I will check with the main data and update you Sir.

    Great to have you on Mr. Excel. Once again many thanks Sir. I remain.

    Best regards,

  2. #92
    Board Regular
    Join Date
    Feb 2012
    Location
    Malta
    Posts
    160
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Extract multiple keywords from text string

    In C1 =TEXTJOIN(" ",,IFERROR(MID(B1,IFERROR(SEARCH(A1:A4,B1,1),0),LEN($A$1:$A$4)),""))

  3. #93
    MrExcel MVP
    Moderator
    Peter_SSs's Avatar
    Join Date
    May 2005
    Location
    Macksville, Australia
    Posts
    40,976
    Post Thanks / Like
    Mentioned
    90 Post(s)
    Tagged
    21 Thread(s)

    Default Re: Extract multiple keywords from text string

    Quote Originally Posted by Jborg View Post
    In C1 =TEXTJOIN(" ",,IFERROR(MID(B1,IFERROR(SEARCH(A1:A4,B1,1),0),LEN($A$1:$A$4)),""))
    Hi John, hope you are well.

    Are you answering the original question from 2015 or the current take on it which started at post 32?
    Hope this helps, good luck.
    Peter
    Excel 365 - Windows 10
    - Want to help your helpers by posting a small, copyable, screen shot directly in your post? Look here
    - If posting vba code, please use Code Tags - like this [code]Paste code here[/code] - or use the # key in the Reply window
    - Read: Forum Rules, Forum Use Guidelines, & FAQ

  4. #94
    Board Regular
    Join Date
    Feb 2012
    Location
    Malta
    Posts
    160
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Extract multiple keywords from text string

    Hi Pete, hope you are all well. I was answering the original post.

  5. #95
    MrExcel MVP
    Moderator
    Peter_SSs's Avatar
    Join Date
    May 2005
    Location
    Macksville, Australia
    Posts
    40,976
    Post Thanks / Like
    Mentioned
    90 Post(s)
    Tagged
    21 Thread(s)

    Default Re: Extract multiple keywords from text string

    Quote Originally Posted by Jborg View Post
    I was answering the original post.
    OK. I guess TEXTJOIN didn't exist back then so a good idea to include the possibility for current readers of the thread. So in that case I make the following comments.

    1. You didn't mention that your suggested formula needs to be confirmed with Ctrl+Shift+Enter, not just Enter.

    2. It also suffers the same issue I raised in post 7 of the thread and demonstrated in cell C2 below where it returns "apple" when that 'word' does not appear in B2.

    3. I have suggested an alternative TEXTJOIN function (also requiring Ctrl+Shift+Enter confirmation) in column C. My function also has some drawbacks related to punctuation. I have dealt with "." and "," in the column B text but if there could be other punctuation (eg ?;: ) then further SUBSTITUTE functions would be needed.

    Extract

    ABCD
    1AppleToday I ate a burger with fries, and had an apple afterwards.apple fries burgerApple Fries Burger
    2FriesI like pineapples & saladapple saladSalad
    3Salad
    4Burger

    Spreadsheet Formulas
    CellFormula
    C1{=TEXTJOIN(" ",,IFERROR(MID(B1,IFERROR(SEARCH($A$1:$A$4,B1,1),0),LEN($A$1:$A$4)),""))}
    D1{=TEXTJOIN(" ",1,IF(ISNUMBER(SEARCH(" "&$A$1:$A$4&" "," "&SUBSTITUTE(SUBSTITUTE(B1,"."," "),","," ")&" ")),$A$1:$A$4,""))}
    Formula Array:
    Produce enclosing
    { } by entering
    formula with CTRL+SHIFT+ENTER!


    Excel tables to the web >> Excel Jeanie HTML 4
    Last edited by Peter_SSs; Sep 19th, 2019 at 02:55 AM.
    Hope this helps, good luck.
    Peter
    Excel 365 - Windows 10
    - Want to help your helpers by posting a small, copyable, screen shot directly in your post? Look here
    - If posting vba code, please use Code Tags - like this [code]Paste code here[/code] - or use the # key in the Reply window
    - Read: Forum Rules, Forum Use Guidelines, & FAQ

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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