+ Reply to Thread
Results 1 to 7 of 7

Extract string between delimiters

  1. #1
    Registered User
    Join Date
    02-16-2021
    Location
    Porto, Portugal
    MS-Off Ver
    Mac os
    Posts
    2

    Extract string between delimiters

    I would like to extract the tickets HD, SNAP, AAL1 from these formulas
    Contract Options HD/18M21P285:xcbf 2015737988
    Contract Options SNAP/18M21C60:xcbf 2014664811
    Contract Options AAL1/21K21C24:xcbf 2013413727
    I tried the formula =MID(D16,FIND(" ",D16)+1,FIND("/",D16)-FIND(" ",D16)-1) but I got
    “Options AAL1”. What is missing, and what is the meaning of +1 and -1 in the end? What is the logic of this formula?
    Thanks

  2. #2
    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,623

    Re: Extract string between delimiters

    If your sample data is representative such formula would do:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    as for +1 or -1 these are corrections not to include in found text the character you were searching for "/", " " etc.
    You got two words, because formula looks for the first space and for first slash and extracts everything between
    Last edited by Kaper; 05-18-2021 at 02:08 PM.
    Best Regards,

    Kaper

  3. #3
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Extract string between delimiters

    Hello luisj. Welcome to the forum.

    See if you can adapt the attached to your live data.

    With a lookup table in column D (or other) and inputs in column A try this formula in column B.
    Formula: copy to clipboard
    Please Login or Register  to view this content.



    A
    B
    C
    D
    1
    Contract Options HD/18M21P285:xcbf 2015737988
    HD
    HD/
    2
    Contract Options SNAP/18M21C60:xcbf 2014664811
    SNAP
    SNAP/
    3
    Contract Options AAL1/21K21C24:xcbf 2013413727
    AAL1
    AAL1/
    Attached Files Attached Files
    Dave

  4. #4
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,081

    Re: Extract string between delimiters

    Another option if all data follows the patter of those examples
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    02-16-2021
    Location
    Porto, Portugal
    MS-Off Ver
    Mac os
    Posts
    2

    Re: Extract string between delimiters

    Fluff13: Elegant solution, thank you! But I don't understand the -18 in the end...
    Kaper: Thanks.
    Flame Retired: purpose is to extract the ticket withou creating any extra column as a reference
    Last edited by luisj; 05-19-2021 at 07:07 AM.

  6. #6
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,081

    Re: Extract string between delimiters

    Glad to help & thanks for the feedback
    But I don't understand the -18 in the end...
    We need to subtract 1 from the find so that it doesn't return the / and as we're removing the 1st 17 characters from the cell we need to subtract 17 as well, hence -18

  7. #7
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Extract string between delimiters

    Quote Originally Posted by luisj View Post
    ......
    Flame Retired: purpose is to extract the ticket withou creating any extra column as a reference
    I didn't see any mention of that above. In that case do this (no extra columns)
    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. Extract text separated by delimiters into different columns
    By vedantmehta08 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-06-2019, 02:08 PM
  2. Extract string of text in the middle of 2 delimiters
    By MoldyBread in forum Excel General
    Replies: 3
    Last Post: 05-07-2018, 07:21 AM
  3. Extract text from cell with delimiters
    By GreenWheels in forum Excel General
    Replies: 8
    Last Post: 11-21-2016, 12:45 PM
  4. [SOLVED] Extract string between delimiters
    By Apexeon in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 03-27-2015, 06:23 PM
  5. Spit string without delimiters
    By jamesstorx in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 05-30-2011, 06:14 PM
  6. Working with multiple delimiters in a string
    By ammauric in forum Excel General
    Replies: 6
    Last Post: 04-13-2011, 10:12 AM
  7. Extract based on Delimiters
    By ssjody in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-26-2005, 11:30 AM

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