+ Reply to Thread
Results 1 to 3 of 3

Extract 1-2 characters from a string

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

    Extract 1-2 characters from a string

    I'm trying to separate the pre and post directions of a street address. An example of the data is below:
    0000711Sw Loop 820
    0004200Bryant Irvin Rd # 101
    0000320E Broadway Ave
    0002201E Loop 820 S
    0006700Snowden Rd
    0003104E Rosedale St


    Expected output:
    1. PreDirection:
    SW
    (null)
    E
    E
    (null)
    E

    2. PostDirection:
    (null)
    (null)
    (null)
    S
    (null)
    (null)

    Your assistance is greatly appreciated.
    Kelly

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,359

    Re: Extract 1-2 characters from a string

    Hi sweetkel23,

    Doesn't the pre and post directions depend on where you start, relative to the destination?
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,887

    Re: Extract 1-2 characters from a string

    Marvin - I doubt it. It appears Kelly is just trying to extract parts of the physical address, but I'm not sure there's going to be a great (or simple) solution. Any time you try to work with addresses it gets ugly very quickly as there is typically no uniformity.

    I suppose if all of the street number lengths are the same (7 digits padded with zeros, based on your sample data) then it wouldn't be as bad to get the Pre list. Just search for any directional abbreviation followed by a space from the 8th through 10th characters. ("E ", "N ", "W ", "S ", "NW ", "SW ", "NE ", "SE ").

    I think the Post identification (directional abbreviations after the main address) could be more difficult, as you never know how many words are in a street name, and there are so many street types (e.g. Ave/Blvd/Way/Square/etc. - even none) that you wouldn't want to search for all possibilities. And what if there was one between the end of the street name and the apartment #?

    It gets confusing for sure.

+ 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