+ Reply to Thread
Results 1 to 6 of 6

extract string between two characters

  1. #1
    Registered User
    Join Date
    05-01-2015
    Location
    Vancouver, BC
    MS-Off Ver
    2010
    Posts
    35

    extract string between two characters

    Hello All,

    I need some help with extracting a particular word between two characters.

    "010 - London - 01 Dock-Day"

    I need to extract London from the above text string.

  2. #2
    Registered User
    Join Date
    05-01-2015
    Location
    Vancouver, BC
    MS-Off Ver
    2010
    Posts
    35

    Re: extract string between two characters

    I would not like to use text-to-columns...either vba or formula.

  3. #3
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,474

    Re: extract string between two characters

    Assuming your data are in A1, use this:
    =TRIM(MID(SUBSTITUTE("-"&$A1,"-",REPT(" ",125)),125*COLUMNS($A:B),125))
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  4. #4
    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,550

    Re: extract string between two characters

    If the string ALWAYS of the form with "nnn - aaaaaaaaa - nn ......" i.e text required starts in position 7 ....


    =TRIM(MID(A1,7,FIND("-",A1,7)-7))

  5. #5
    Registered User
    Join Date
    05-01-2015
    Location
    Vancouver, BC
    MS-Off Ver
    2010
    Posts
    35

    Re: extract string between two characters

    Many thanks for your help. Both solution work.!

  6. #6
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,474

    Re: extract string between two characters

    Thanks for the reputation added. Much appreciated.

+ 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] Extract String from between 2 same characters
    By slamdunka in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-30-2014, 09:37 PM
  2. [SOLVED] Extract left characters from string with exception of 2 right characters
    By sweetkel23 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 09-16-2012, 10:45 PM
  3. [SOLVED] Extract 1-2 characters from a string
    By sweetkel23 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-14-2012, 07:53 PM
  4. EXTRACT all characters from a string
    By Blake 7 in forum Excel General
    Replies: 2
    Last Post: 03-11-2011, 07:06 AM
  5. Extract trailing string of characters from a URL
    By cmckenzie in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-28-2009, 04:39 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