Need formula help to separate address from one cell to multiple cells

steve5740

New Member
Joined
Jan 10, 2016
Messages
14
Address Examples:
GREENBRIAR MALL 1712 RING RD CHESAPEAKE VA 23320
101 N. HIGHWAY 274 HWY 175 @ HWY 274 KEMP TX 75143-0000
229 NORTH SEVEN POINTS RT. #8 - BOX 925 SEVEN POINTS TX 75143-0000
3223 LEMMON AVE #100 DALLAS TX 75204
8001 WESTERN HILLS BLVD FORT WORTH TX 76108


Hello -

I have a spreadsheet with addresses in one cell/column, and need to separate the data by address, city, state and zip code. Because the data is different lengths, including 2 word cities, it has been difficult to develop a successful formula and text to column does not help. Any suggestions would be helpful.


I have tried the following formulas and it does work except for 2 word cities. How do I adjust the formula?

Cell B2 =TRIM(SUBSTITUTE(A2,D2&" "&E2,""))
Cell C2 =TRIM(RIGHT(SUBSTITUTE(SUBSTITUTE(A2," "&E2,"")," ",REPT(" ",50)),50))
Cell D2 =TRIM(RIGHT(SUBSTITUTE(A2," ",REPT(" ",50)),99))
 
Parsing out addresses is one of the toughest things to do, just because there are so many exceptions. I found a set of formulas that works for this test set. In order to handle 2-word cities, I had to create a table of city names with more than 1 word. Whenever you find such a city in your data, you'll need to add it to the table. You should be able to see how to adapt that. You do need to put the xxxxx in any unused fields in the city table.


Excel 2012
ABCDEFG
1GREENBRIAR MALL 1712 RING RD CHESAPEAKE VA 23320GREENBRIAR MALL 1712 RING RDCHESAPEAKEVA23320SEVEN POINTS
2101 N. HIGHWAY 274 HWY 175 @ HWY 274 KEMP TX 75143-0000101 N. HIGHWAY 274 HWY 175 @ HWY 274KEMPTX75143-0000FORT WORTH
3229 NORTH SEVEN POINTS RT. #8 - BOX 925 SEVEN POINTS TX 75143-0000229 NORTH SEVEN POINTS RT. #8 - BOX 925SEVEN POINTSTX75143-0000xxxxx
43223 LEMMON AVE #100 DALLAS TX 752043223 LEMMON AVE #100DALLASTX75204xxxxx
58001 WESTERN HILLS BLVD FORT WORTH TX 761088001 WESTERN HILLS BLVDFORT WORTHTX76108xxxxx
6xxxxx
7xxxxx
8xxxxx
9xxxxx
10xxxxx
Sheet1
Cell Formulas
RangeFormula
B1=TRIM(LEFT(A1,LEN(A1)-LEN(E1)-LEN(D1)-LEN(C1)-3))
D1=TRIM(RIGHT(SUBSTITUTE(LEFT(A1,LEN(A1)-LEN(E1)-1)," ",REPT(" ",255)),255))
E1=TRIM(RIGHT(SUBSTITUTE(A1," ",REPT(" ",255)),255))
C1{=IFERROR(INDEX($G$1:$G$10,MAX(IF(ISNUMBER(FIND($G$1:$G$10,A1)),ROW($G$1:$G$10),-1))),TRIM(RIGHT(SUBSTITUTE(LEFT(A1,LEN(A1)-LEN(E1)-LEN(D1)-2)," ",REPT(" ",255)),255)))}
Press CTRL+SHIFT+ENTER to enter array formulas.

Let me know if this helps.
 
Last edited:
Upvote 0
Thank you Eric.

It worked except for some minor manual adjustments I had to make. Perhaps there is a fix for these and I will send examples asap.

Thank you!
 
Upvote 0

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