+ Reply to Thread
Results 1 to 4 of 4

Extracting text from string between delimiter X & Y

  1. #1
    Registered User
    Join Date
    03-31-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    84

    Extracting text from string between delimiter X & Y

    I have a text string and i need to extract between a specific number of delimiters:

    A_B_C_D_E_F_G_H_I_J

    For example, how can i extract "C_D_E" i.e. the text between the 2nd and 5th underscore.

    Note: the letters here denote words that could be of any length.

    Previously I have used this formula to extract one delimited value =TRIM(MID(SUBSTITUTE($A2,"_",REPT(" ",LEN($A2))),((2)*LEN($A2))+1,LEN($A2)))

    Not sure how to adapt this though

    help appreciated.

  2. #2
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2024
    Posts
    6,175

    Re: Extracting text from string between delimiter X & Y

    Try this ...

    =TRIM(MID(SUBSTITUTE(SUBSTITUTE(A2,"_",REPT(" ",500),5),"_",REPT(" ",500),2),500,500))

  3. #3
    Registered User
    Join Date
    03-31-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    84

    Re: Extracting text from string between delimiter X & Y

    Love it!

    Thank you!

  4. #4
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2024
    Posts
    6,175

    Re: Extracting text from string between delimiter X & Y

    You are welcome!

+ 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. [SOLVED] Extracting text value from string
    By dchubbock in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-20-2015, 07:56 AM
  2. [SOLVED] extracting data without using delimiter
    By sfoll in forum Excel General
    Replies: 3
    Last Post: 07-30-2015, 02:09 PM
  3. Extracting text from a string
    By simonelvin in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 10-10-2014, 06:58 AM
  4. Extracting numbers and text from inconsistent text/number formatted string
    By Brandivil in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-25-2013, 01:46 PM
  5. [SOLVED] Extracting Text from a string of Text & Digits of variable length
    By hastex in forum Excel General
    Replies: 6
    Last Post: 06-06-2012, 09:11 AM
  6. Edit text string using delimiter?
    By 508 in forum Excel General
    Replies: 3
    Last Post: 03-14-2009, 06:03 PM
  7. Extracting from a text string
    By AmyTaylor in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-24-2005, 08:34 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