Closed Thread
Results 1 to 2 of 2

SELECT one, two, three, n words before and after a keyword in a string

  1. #1
    Registered User
    Join Date
    01-21-2022
    Location
    Australia
    MS-Off Ver
    Microsoft Office
    Posts
    3

    SELECT one, two, three, n words before and after a keyword in a string

    I have data in an excel sheet as below:

    id Text
    ------------
    1 There is a need to go for a PCR covid test if you have symptoms
    2 No need to go for a covid test if you don't have symptoms
    3 government increased test centres to conduct covid test to decrease the waiting time.

    Question: I need to search for 'covid test'(keyword: 'covid test') in each row and fetch the data as below:



    Result
    ----------------
    PCR covid test if you have
    a covid test if you don't
    conduct covid test to decrease the


    Logic: Need to search for the string 'covid test' in each row and display one word before 'covid test' and three words after 'covid test'.

    I'm not sure on making up the formula. Can any one please suggest?

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,936

    Re: SELECT one, two, three, n words before and after a keyword in a string

    Administrative Note:

    Welcome to the forum.

    Unfortunately, this is a duplicate thread, and you are allowed only ONE thread per issue here.

    Please see Forum Rule #5 about thread duplication.

    I am closing this thread, but you may continue here in the original thread: link to be added here

    https://www.excelforum.com/excel-pro...ml#post5623575
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

Closed Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. SELECT one, two, three, n words before and after a keyword in a string
    By bharath99 in forum Hello..Introduce yourself
    Replies: 3
    Last Post: 01-21-2022, 03:41 PM
  2. Replies: 8
    Last Post: 11-29-2021, 05:28 AM
  3. Replies: 1
    Last Post: 07-02-2014, 12:02 PM
  4. [SOLVED] Sum Only Whole Words for Word Matrix Based on a Keyword List
    By sweetrevelation in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-17-2014, 11:24 AM
  5. Return words before and after a keyword in excel
    By boriherter in forum Excel General
    Replies: 2
    Last Post: 01-09-2013, 09:23 PM
  6. [SOLVED] Need to chck if a keyword is present in a text string and return keyword if yes
    By Jekaterina in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 12-16-2012, 05:55 PM
  7. Replies: 8
    Last Post: 09-27-2012, 10:46 PM

Tags for this Thread

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