Extract Address and City from String

vraman0513

New Member
Joined
Oct 17, 2016
Messages
5
Hello - I am trying to extract the address and city from the following addresses. Could anyone help?

[TABLE="width: 425"]
<colgroup><col></colgroup><tbody>[TR]
[TD]2718 WEST BUCKNER ROAD DALLAS, TX 75237[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
[TABLE="width: 334"]
<colgroup><col></colgroup><tbody>[TR]
[TD]2718 WEST BUCKNER ROAD DALLAS, TX 75237[/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD]2718 WEST BUCKNER ROAD DALLAS[/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD]=LEFT(A1,SEARCH(",",A1)-1)[/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0
I can already extract the zip and state to seperate cells....just need to extract the address and city seperately.
 
Upvote 0
Thanks -- however, is there a way to just extract the city and the address seperately and not together in one cell?
 
Upvote 0
Hi,

try this one :

=RIGHT(SUBSTITUTE(A1,RIGHT(A1,LEN(A1)-FIND(",",A1)+1),""),LEN(SUBSTITUTE(A1,RIGHT(A1,LEN(A1)-FIND(",",A1)+1),""))-FIND("*",SUBSTITUTE(SUBSTITUTE(A1,RIGHT(A1,LEN(A1)-FIND(",",A1)+1),"")," ","*",LEN(SUBSTITUTE(A1,RIGHT(A1,LEN(A1)-FIND(",",A1)+1),""))-LEN(SUBSTITUTE(SUBSTITUTE(A1,RIGHT(A1,LEN(A1)-FIND(",",A1)+1),"")," ","")))))
 
Upvote 0
Thank you!!

How about for something like this without a comma seperating the city and state?

[TABLE="width: 444"]
<tbody>[TR]
[TD="class: xl64, width: 444"]456 N LAWNDALE AVE MOUNTAIN VIEW CA 94043-1716[/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0
Thank you!!

How about for something like this without a comma seperating the city and state?

[TABLE="width: 444"]
<tbody>[TR]
[TD="class: xl64, width: 444"]456 N LAWNDALE AVE MOUNTAIN VIEW CA 94043-1716[/TD]
[/TR]
</tbody>[/TABLE]
Actually, the missing comma is the least of your troubles with that one... put the comma in and tell me how you know that city consists of two name as compared to your first example (DALLAS) which only has one word? And if you think you solve that one, does you solution handle cities with three name like SALT LAKE CITY, UTAH
 
Upvote 0
Correct - doesn't work for cities with multiple names, this is one of the additional challenges I was facing.
The only possible way around this dilemma that I can think of is for you to create a list of all possible street designations (Road, Street, Lane, Circle, etc., etc.) and all of their possible abbreviations (for example, Ave, Av, Ave., Av. for Avenue) and then locate whichever one there is within the text as the break point between the address and the city. But you cannot look for the first one of these that match, rather, you need to find the last one of them (otherwise you will get fooled by STREET ROAD which is a major street name in Philadelphia, Pennsylvania). If you construct that list, we can probably drum up a solution of some kind for you.
 
Upvote 0

Forum statistics

Threads
1,223,230
Messages
6,170,883
Members
452,364
Latest member
springate

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top