+ Reply to Thread
Results 1 to 8 of 8

Extracting string between two specific delimiters among many of the same character.

  1. #1
    Registered User
    Join Date
    05-18-2016
    Location
    United States
    MS-Off Ver
    Excel 2016
    Posts
    8

    Extracting string between two specific delimiters among many of the same character.

    I have a database that is the document control for many drawing numbers. What I would like to be able to do is extract just a portion of the drawing number that is between two delimiters ("-") but there are multiple of the same delimiters in the drawing name. For examples, I would like only the bold text to be the string that is extracted:

    1_DC-1446-AH-POW.001
    2_N2-2356-G-POW.001
    2_N2-2356-G-POW.002
    2_SC-4128-UFWC-POW.001

    I would just do an =Right( formula, but as you can see from the examples, the string I am trying to return isn't always the same number of characters.

    Any help on this will save me a world of time and be GREATLY appreciated.


    -Separate Issue-
    If anyone could also help me with a formula to isolate just the number(s) before the "_" character, that would help too! Sometimes this number is double digits.
    Last edited by DaniLucas; 05-18-2016 at 10:15 AM.

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,209

    Re: Extracting string between two specific delimiters among many of the same character.

    Try

    =TRIM(MID(SUBSTITUTE($A1,"-",REPT(" ",100)),201,100))

  3. #3
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Extracting string between two specific delimiters among many of the same character.

    Try this...

    Data Range
    A
    B
    C
    1
    1_DC-1446-AH-POW.001
    AH
    1
    2
    2_N2-2356-G-POW.001
    G
    2
    3
    2_N2-2356-G-POW.002
    G
    2
    4
    2_SC-4128-UFWC-POW.001
    UFWC
    2
    5
    ------
    ------
    ------


    This formula entered in B1:

    =TRIM(MID(SUBSTITUTE(A1,"-",REPT(" ",100)),200,100))

    This formula entered in C1:

    =--LEFT(A1,FIND("_",A1)-1)

    Select B1:C1 and copy down as needed.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  4. #4
    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: Extracting string between two specific delimiters among many of the same character.

    Hi and welcome to the forum.

    Assuming the text required is always between the 2nd & 3rd - signs then

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    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.

  5. #5
    Registered User
    Join Date
    05-18-2016
    Location
    United States
    MS-Off Ver
    Excel 2016
    Posts
    8

    Re: Extracting string between two specific delimiters among many of the same character.

    THANK YOU!!

    Thank you all so much. All three work beautifully and is going to literally save me hours of time each week!

  6. #6
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Extracting string between two specific delimiters among many of the same character.

    You're welcome. Thanks for the feedback!

  7. #7
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Extracting string between two specific delimiters among many of the same character.

    Here is with one formula
    Enter in B1 and copy across and down
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    v A B C
    1 1_DC-1446-AH-POW.001 1 AH
    2 2_N2-2356-G-POW.001 2 G
    3 2_N2-2356-G-POW.002 2 G
    4 2_SC-4128-UFWC-POW.001 2 UFWC
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  8. #8
    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: Extracting string between two specific delimiters among many of the same character.

    Hi,

    Just noticed a simpler solution if the required string always starts in the 11th position.
    Formula: copy to clipboard
    Please Login or Register  to view this content.

+ 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] Retrieving String after specific character
    By TicklyTigger in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 04-20-2016, 10:08 AM
  2. [SOLVED] Extracting data from a string which uses the same character as separator
    By isabelle.r in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 07-07-2015, 08:16 AM
  3. [SOLVED] Extracting end of string based on qualifying character
    By mosesthetank in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-29-2014, 11:11 AM
  4. [SOLVED] deleting a specific character in a string
    By FieldHaven in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-10-2014, 12:18 PM
  5. [SOLVED] Extracting a Substring Between Second and Third Delimiters
    By MrGadget6977 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 09-18-2013, 05:54 PM
  6. Replies: 3
    Last Post: 04-17-2010, 05:02 AM
  7. [SOLVED] Extracting a character from a string of characters
    By Sue in forum Excel General
    Replies: 6
    Last Post: 10-29-2005, 09:05 PM

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