+ Reply to Thread
Results 1 to 5 of 5

Mid with no set length

  1. #1
    Registered User
    Join Date
    09-12-2012
    Location
    Fort Worth, TX
    MS-Off Ver
    Excel 2007
    Posts
    30

    Mid with no set length

    I need your assistance please on a formula which will extract all the 'mid' characters of a string. An example of the data is below:

    0000359Russell Ln
    0002313W Arkansas Ln # 111
    0000615Stadium Dr
    0002025S Cooper St
    0001001Waldrop Dr # 702
    0003132Matlock Rd # 307
    0000915W Mitchell St
    0000925E Mitchell St
    0001863W Division St # B


    I am looking for the data to be returned as:
    Russell Ln
    Arkansas Ln
    Stadium Dr
    Cooper St
    Waldrop Dr
    Matlock Rd
    Mitchell St
    Mitchell St
    Division St

    Thank you very much!

  2. #2
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Mid with no set length

    Can we trust the # to precede the part at the end that is removed?

    =TRIM(MID(SUBSTITUTE(A1,"#",REPT(" ",255)), 8,255))
    Last edited by mikerickson; 09-14-2012 at 01:58 AM.
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  3. #3
    Registered User
    Join Date
    09-12-2012
    Location
    Fort Worth, TX
    MS-Off Ver
    Excel 2007
    Posts
    30

    Re: Mid with no set length

    To answer your question, one of the four values will precede the part at the end that is removed:
    #
    APT
    FLR
    STE

  4. #4
    Valued Forum Contributor
    Join Date
    02-08-2012
    Location
    wales
    MS-Off Ver
    Excel 2007
    Posts
    964

    Re: Mid with no set length

    is it always 8 charicters at the start you need removed?
    The Importance of INDEX - A GUIDE TO INDEX'S OTHER USES
    <--- If a post helps hit the star

  5. #5
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,710

    Re: Mid with no set length

    Pl see attached file with macro.
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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