+ Reply to Thread
Results 1 to 8 of 8

How do I search a cell for keywords and add text

  1. #1
    Registered User
    Join Date
    03-07-2014
    Location
    U.S.
    MS-Off Ver
    excel 2010
    Posts
    3

    How do I search a cell for keywords and add text

    Hi,
    How do I add a phrase to an existing cell if that cell contains keywords that are in a separate list.

    a column contains keywords
    b column contains corresponding phrases for those keywords
    c column contains product descriptions

    I would like a formula in d1 to search cell c1 for keywords listed in column a. If the keyword is present, I would like d1 to return the product description in c1 and the corresponding phrase(s) for that keyword located in column b.

    example:

    if a1 contains "red" and a2 contains "green" and a3 contains "blue"
    b1 contains "Makes a great gift for Valentines Day" and b2 contains "Makes a great gift for St. Patricks Day" and b3 contains "Makes a great gift for men"
    c1 contains the following product description "This product is a red box with green sides."
    d1-need a formula to return "This product is a red box with green sides. Makes a great gift for Valentines Day. Makes a great gift for men."

    Any help would be appreciated!

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: How do I search a cell for keywords and add text

    Please upload an example with all your various phrases and manually add typical results so that we can see the end goal.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    03-07-2014
    Location
    U.S.
    MS-Off Ver
    excel 2010
    Posts
    3

    Re: How do I search a cell for keywords and add text

    As requested, please see attached example.
    Attached Files Attached Files

  4. #4
    Valued Forum Contributor
    Join Date
    09-25-2011
    Location
    Eastbourne, England
    MS-Off Ver
    Excel 2010
    Posts
    1,089

    Re: How do I search a cell for keywords and add text

    Hi sealsseals06

    Welcome to the forum.

    I believe the attached file meets your requirements. Note the use ** helper columns E-G. You will need 1 helper column for each keyword.

    To enhance the display, I have put a full stop and space at the end ** each phrase and product description.

    Let me know if you have any questions.

    Regards
    Alastair
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    03-07-2014
    Location
    U.S.
    MS-Off Ver
    excel 2010
    Posts
    3

    Re: How do I search a cell for keywords and add text

    Thank you for the reply, unfortunately, a helper column for each keyword is not practical since the keyword list and corresponding phrases are extremely long (100plus).

    Any other ideas would be helpful.

  6. #6
    Valued Forum Contributor
    Join Date
    09-25-2011
    Location
    Eastbourne, England
    MS-Off Ver
    Excel 2010
    Posts
    1,089

    Re: How do I search a cell for keywords and add text

    Hi sealsseals06

    So what's wrong with 100+ helper columns?

    My original plan was to use a macro, but I know some people have a problem with this. I will get to work on it, but may not get opportunity for a few days, so anyone else should feel free to contribute.

    Regards
    Alastair

  7. #7
    Valued Forum Contributor
    Join Date
    09-25-2011
    Location
    Eastbourne, England
    MS-Off Ver
    Excel 2010
    Posts
    1,089

    Re: How do I search a cell for keywords and add text

    Hi sealsseals06

    Here's a solution that requires no helper columns.

    If you have not run macros, you may need to adjust your security settings.

    I have not tried it with 100+ keywords, but it seems to work OK with a small sample.

    Let me know how you get on.

    Regards
    Alastair
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    03-07-2014
    Location
    U.S.
    MS-Off Ver
    excel 2010
    Posts
    3

    Re: How do I search a cell for keywords and add text

    Thank you for the reply, I'm most appreciative.

  9. #9
    Valued Forum Contributor
    Join Date
    09-25-2011
    Location
    Eastbourne, England
    MS-Off Ver
    Excel 2010
    Posts
    1,089

    Re: How do I search a cell for keywords and add text

    You're welcome.

    Regards
    Alastair

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Search for multiple keywords within a single text cell
    By ndube50 in forum Excel General
    Replies: 22
    Last Post: 06-30-2020, 07:23 AM
  2. [SOLVED] Search for occurence of several keywords in a singel text cell
    By petenc in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 02-24-2014, 06:22 PM
  3. [SOLVED] Search for keywords and copy rows containing keywords to new sheet
    By lenorsk in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 10-15-2013, 06:54 AM
  4. Replies: 2
    Last Post: 11-24-2010, 05:44 PM
  5. [SOLVED] Search Excel files for text and keywords?
    By quartz in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-05-2005, 04:20 AM

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