+ Reply to Thread
Results 1 to 4 of 4

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
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166
    Hello bharath99,

    Welcome to Excelforum. Be a part of large Excel community. Enjoy Learning.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

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

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

    Thanks arlu1201

  4. #4
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,863

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

    Hi,

    As you may be read description of this sub-forum - this one is solely to introduce yourself.

    So here I'd also (like arlu1201) say: welcome to the forum. And that's it.

    With your merit question, please go to appropriate sub-forum. Look what sub-forums we have: http://www.excelforum.com/microsoft-...el-help-forum/ and post a new thread in one of them (the most appropriate one).
    Best Regards,

    Kaper

+ 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. Replies: 8
    Last Post: 11-29-2021, 05:28 AM
  2. Replies: 15
    Last Post: 10-12-2014, 08:53 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