+ Reply to Thread
Results 1 to 7 of 7

Address Parsing

  1. #1
    Registered User
    Join Date
    01-02-2013
    Location
    Toronto, ON, Canada
    MS-Off Ver
    Excel 2010
    Posts
    21

    Address Parsing

    I though about using a complicated title like "Extract Phrase Z after Phrase X and Y that may also appear before Phrase Y" but that is just confusing.

    I have nearly 5000 data entries of addresses. Many different types of addresses as they are all businesses. Very inconsistent data to work with. No commas to work with. Examples:
    Could be as simple as: 123 MAIN STREET
    Or as complicated as: 45-123 KINGS BAY RD SW BAY F
    Which might be alternatively written as: BAY F SUITE 45 123 KINGS BAY ROAD SW
    Or: 123 KINGS BAY ROAD SW BAY F SUITE 45

    The Unit/Suite number is sometimes just a number separated from the street number by a space or hyphen, or at the end or somewhere in the middle of the string immediately following the word UNIT, SUITE, or STE
    There are also addresses in French which can often have STE in the street name, eg: RUE STE CATHERINE
    There are also rural addresses like NW QUARTER RR18-W3
    Note: the word "BAY" can indicate an area on a large warehouse (which might be numbered or lettered), can be a part of a street name (like BAY ST or BAYVIEW AVE), or can be a type of street (like WOOD VALLEY BAY)
    There is a trailing space on every address (not sure if this could be useful)

    I need to parse the string into different columns. I need: Unit/Suite/Ste#, Bay#, Street#, Street Name, Street Type, Street Direction. Type and Direction would be fine to include in the Street Name.

    Any help is appreciated.

    Here are some formulas I have already (the addresses are in column C):
    Bay# parsing:
    =IFERROR(IF(AND(ISNUMBER(--MID($C1,SEARCH("BAY ?",$C1)+4,1)),MID($C1,SEARCH("BAY ?",$C1)+4,1)<>"S",MID($C1,SEARCH("BAY ?",$C1)+4,1)<>"A",MID($C1,SEARCH("BAY ?",$C1)+4,1)<>"R",MID($C1,SEARCH("BAY ?",$C1)+4,1)<>"V",MID($C1,SEARCH("BAY ?",$C1)+4,1)<>"H"),MID($C1,SEARCH("BAY ?",$C1)+4,(SEARCH(" ",$C1,SEARCH("BAY ?",$C1)+4))-(SEARCH("BAY ?",$C1)+4)),""),"")

  2. #2
    Registered User
    Join Date
    01-02-2013
    Location
    Toronto, ON, Canada
    MS-Off Ver
    Excel 2010
    Posts
    21

    Re: Address Parsing

    Ok, these are the formulas that are working so far:
    Bay#:
    =IFERROR(IF(AND(MID($C1,SEARCH("BAY ?",$C1)+4,1)<>"S",MID($C1,SEARCH("BAY ?",$C1)+4,1)<>"A",MID($C1,SEARCH("BAY ?",$C1)+4,1)<>"R",MID($C1,SEARCH("BAY ?",$C1)+4,1)<>"V",MID($C1,SEARCH("BAY ?",$C1)+4,1)<>"H"),MID($C1,SEARCH("BAY ?",$C1)+4,(SEARCH(" ",$C1,SEARCH("BAY ?",$C1)+4))-(SEARCH("BAY ?",$C1)+4)),""),"")
    Suite#:
    =IFERROR(MID($C3,SEARCH("SUITE ?",$C3)+6,(SEARCH(" ",$C3,SEARCH("SUITE ?",$C3)+6))-(SEARCH("SUITE ?",$C3)+6)),"")
    Unit#:
    =IFERROR(MID($C1,SEARCH("UNIT ?",$C1)+5,(SEARCH(" ",$C1,SEARCH("UNIT ?",$C1)+5))-(SEARCH("UNIT ?",$C1)+5)),"")

    I'm working on a formula to pull the STE where it stands for SUITE (not Saint in french). then we can easily combine SUITE, STE, and UNIT into one column (since it doesn't make a difference what we call it).

  3. #3
    Registered User
    Join Date
    01-02-2013
    Location
    Toronto, ON, Canada
    MS-Off Ver
    Excel 2010
    Posts
    21

    Re: Address Parsing

    This seems to work for STE (ignoring where the STE stands for Saint in French):
    =IFERROR(IF(AND(ISNUMBER(--MID($C3,SEARCH("STE ?",$C3)+4,1)),MID($C3,SEARCH("STE ?",$C3)+4,1)<>"S",MID($C3,SEARCH("STE ?",$C3)+4,1)<>"A",MID($C3,SEARCH("STE ?",$C3)+4,1)<>"R",MID($C3,SEARCH("STE ?",$C3)+4,1)<>"V",MID($C3,SEARCH("STE ?",$C3)+4,1)<>"H"),MID($C3,SEARCH("STE ?",$C3)+4,(SEARCH(" ",$C3,SEARCH("STE ?",$C3)+4))-(SEARCH("STE ?",$C3)+4)),""),"")

    I'm just trying to figure out how to pull the unit numbers that are not indicated by a word and instead in any of the below formats. I'm not sure that it's possible (or at least perhaps not possible with my skill level):
    B45-123 KING ST
    45A 123 KING ST
    45-123 67 AVE
    45 123 67 AVE
    17-19 123 KING ST
    17 19 123 KING ST
    17-19 123 67 AVE
    17 19 123 67 AVE

  4. #4
    Valued Forum Contributor
    Join Date
    07-07-2014
    Location
    Washington DC
    MS-Off Ver
    2007
    Posts
    1,047

    Re: Address Parsing

    What are the unit numbers in your example? B45/45A/45 etc.?

  5. #5
    Registered User
    Join Date
    01-02-2013
    Location
    Toronto, ON, Canada
    MS-Off Ver
    Excel 2010
    Posts
    21

    Re: Address Parsing

    Yes those are the unit numbers.

  6. #6
    Valued Forum Contributor
    Join Date
    07-07-2014
    Location
    Washington DC
    MS-Off Ver
    2007
    Posts
    1,047

    Re: Address Parsing

    If the unit numbers are never more than 3 characters, as it seems from your examples, then you could use the formula below (assuming addresses are in A1):

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    01-02-2013
    Location
    Toronto, ON, Canada
    MS-Off Ver
    Excel 2010
    Posts
    21

    Re: Address Parsing

    Yeah the unit number can be more than three. My main roadblock is that the unit number can consist of two number numbers separated by a hyphen separated from the street number by a hyphen. This could indicate a range of unit numbers (like 17-19-200 ABC ST where 17-19 is the unit number), or a single two-part unit number (2105-12-354 ABC ST). But of course, it's not always a two-part unit number.

    Further to that, there are many rural addresses that barely follow a format. For instance NW QUARTER 540-2-W3, or SE 5-43-23-W2, or even SE CORNER 17832 W OF THE 5TH, NW 7TH 29-3 WEST THE 5TH. Those addresses aren't considered to have a unit number.

    Man, it might be easier to just go through all the data manually... this is turning out to be more complicated than I thought. Thank you for your help so far though hoyasaxa215.

+ 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. Postal Address Parsing
    By sakari in forum Excel General
    Replies: 0
    Last Post: 01-13-2014, 02:25 PM
  2. Address parsing
    By aus10fek in forum Excel General
    Replies: 14
    Last Post: 01-13-2014, 02:15 AM
  3. Parsing an html address ?
    By mariom in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 05-24-2010, 07:53 AM
  4. Parsing Address/ZipCode
    By scotfitz in forum Excel General
    Replies: 4
    Last Post: 12-22-2009, 04:06 PM
  5. parsing address data
    By rowing190 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-09-2009, 07:16 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