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)),""),"")
Bookmarks