+ Reply to Thread
Results 1 to 8 of 8

Extract Specific word from the String

  1. #1
    Forum Contributor
    Join Date
    07-18-2012
    Location
    Australia
    MS-Off Ver
    Excel 2016
    Posts
    192

    Extract Specific word from the String

    Hi Friends

    I have attached the example file. I want to extract specific text from the value in cell.

    For example, I want to extract G001 from cell A2, G005A from cell A3 etc.

    Is there any way someone can assist?

    Many thanks in advance
    Attached Files Attached Files

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,398

    Re: Extract Specific word from the String

    Is it always the last but one item in the string?
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Extract Specific word from the String

    Please try at B2

    =TRIM(LEFT(RIGHT(SUBSTITUTE(A2,"-",REPT(" ",20)),40),20))

  4. #4
    Forum Contributor
    Join Date
    07-18-2012
    Location
    Australia
    MS-Off Ver
    Excel 2016
    Posts
    192

    Re: Extract Specific word from the String

    Thanks but this doesnt work with my actual text string which is "Shop 1 - G001 - Moonview Shopping Centre".

  5. #5
    Forum Contributor
    Join Date
    07-18-2012
    Location
    Australia
    MS-Off Ver
    Excel 2016
    Posts
    192

    Re: Extract Specific word from the String

    Yes it will be there in the text string as per my example file attached.

  6. #6
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Extract Specific word from the String

    Just increse the number
    =TRIM(LEFT(RIGHT(SUBSTITUTE(A2,"-",REPT(" ",100)),200),100))

  7. #7
    Forum Expert
    Join Date
    09-30-2019
    Location
    Chiangmai, Thailand
    MS-Off Ver
    Office 2016, Excel 2019
    Posts
    1,234

    Re: Extract Specific word from the String

    Did your text have any more pattern explaination ?

    Like

    prefix - XXXX - suffix

    while prefix and suffix can contain a "-" (or not)

    By the way, Bo_Ry's formula can already extract your desired text form your sample file.


    Regards.

  8. #8
    Forum Contributor
    Join Date
    07-18-2012
    Location
    Australia
    MS-Off Ver
    Excel 2016
    Posts
    192

    Re: Extract Specific word from the String

    This is perfect. Thanks a lot. It works perfectly.

+ 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. How to extract one word after another specific word in excel
    By Benlj79az in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-15-2019, 02:16 PM
  2. Find / Extract Word & Words after a Specific Word
    By roseuz in forum Excel General
    Replies: 8
    Last Post: 07-05-2017, 01:07 PM
  3. Replies: 4
    Last Post: 10-25-2016, 04:45 PM
  4. [SOLVED] Function to extract specific word from alphanumeric string
    By Karnik in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-29-2015, 02:27 AM
  5. Extract string based on specific string
    By YasserKhalil in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 12-15-2014, 12:16 AM
  6. Extract specific word from a text string
    By krjoshi in forum Excel General
    Replies: 10
    Last Post: 01-19-2012, 02:00 PM
  7. Extract String After Specific Word
    By Gingeiko in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 12-03-2011, 09:05 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