Splitting addresses into different cells

jawa912

New Member
Joined
Apr 13, 2016
Messages
15
I need to separate addresses that are in one cell into address,city,state,zip cells. There isn't a consistent deliminator and I can only get ad far as pulling out the state and zip. Below is a sample of the info that I need to be separated. I think I've sprouted my first grey hair from this endeavor :/

18911 NW 10TH ST PEMBROKE PINES,FL 3302915339 NW 7TH ST PEMBROKE PINES,FL 33028-1841
401 OLD DIXIE HWY STE 3655 JUPITER,FL 33469
159 MARTIN CIRCLE ROYAL PALM BEACH,FL 33411
2345 NE 4TH AVE BOCA RATON,FL 33431
9940 GARDENS E DR PALM BEACH GARDENS,FL 33410
11311 NMW 27 ST SUNRISE,FL 33323
18466 49TH ST N LOXAHATCHEE,FL 33470-2366
1057 SUMMITT TRAIL CIR APT B WEST PALM BEACH,FL 33415
730 NW 57 PL FORT LAUDERDALE,FL 33309
15775 133RD TERRACE NORTH JUPITER,FL 33478-0000
4908 PALO VERDE DR BOYNTON BEACH,FL 33436
8129 RODEO DR LAKE WORTH,FL 33467
13045 52ND CT N WEST PALM BEACH,FL 33411
2721 VISTA PKWY STE 10 WEST PALM BEACH,FL 33411-2731
12861 58TH PL N ROYAL PALM BEACH,FL 33411-8553
PO BOX 3155 LANTANA,FL 33467
4892 DELL AVE APT 1 LAKE WORTH,FL 33461
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
If you can go through the list and make sure that there is only one address per line and place a comma at the end of the street address, then the following code will do the rest. This assumes all data is in column A beginning in row 1 with no headers.
Code:
Sub t()
Dim c As Range, spl As Variant
    For Each c In Range("A1", Cells(Rows.Count, 1).End(xlUp))
        spl = Split(c.Value, ",")
        c = spl(0)
        c.Offset(, 1) = spl(1)
        c.Offset(, 2) = Left(spl(2), 2)
        c.Offset(, 3) = Mid(spl(2), 3)
    Next
Columns("A:D").Autofit
End Sub
 
Last edited:
Upvote 0
Unfortunately, this isn't an option. There are over 15,000 lines on this sheet. I currently have the address column as "B" but that's easy enough to move to A
 
Upvote 0
I don't think you will solve it any other way, but I have been wrong before.
Regards, JLG
 
Last edited:
Upvote 0
Hi jawa912

There are definite patterns in the data which mean it is likely it can be done. You're likely to have to 'process' the data a couple of times, splitting it out into its component parts, until you arrive a final data set.

Separating out the city looks like it will be the hardest, as it appears the city name could be any of 1 to 3 words long. But given some rules, it can be done. If you had a library of city names that might help (but still could give rise to difficulties if there are minor differences in format).

That said, the resultant VBA would be fairly complex, so I'm not willing to commit to attempting it. It is likely not to be 100% accurate without human intervention to review the data set, but you would get pretty close.

Cheers

pvr928
 
Upvote 0
You'd be better off using a paid online service. There are loads out there that specialise in cleaning up this sort of mess, they're reasonably priced and will likely cost you a lot less than the time required to fix this.
 
Upvote 0
You should copy the Street Suffix Abbreviations into your Workbook (Sheet2 at me, from $A$5 to $C$506). Then try this to extract the address:

Excel Workbook
AB
1401 OLD DIXIE HWY STE 3655 JUPITER,FL 33469401 OLD DIXIE HWY
2159 MARTIN CIRCLE ROYAL PALM BEACH,FL 33411159 MARTIN CIRCLE
32345 NE 4TH AVE BOCA RATON,FL 334312345 NE 4TH AVE
49940 GARDENS E DR PALM BEACH GARDENS,FL 334109940 GARDENS
511311 NMW 27 ST SUNRISE,FL 3332311311 NMW 27 ST
618466 49TH ST N LOXAHATCHEE,FL 33470-236618466 49TH ST
71057 SUMMITT TRAIL CIR APT B WEST PALM BEACH,FL 334151057 SUMMITT TRAIL
8730 NW 57 PL FORT LAUDERDALE,FL 33309730 NW 57 PL
915775 133RD TERRACE NORTH JUPITER,FL 33478-000015775 133RD TERRACE
104908 PALO VERDE DR BOYNTON BEACH,FL 334364908 PALO VERDE DR
118129 RODEO DR LAKE WORTH,FL 334678129 RODEO DR
1213045 52ND CT N WEST PALM BEACH,FL 3341113045 52ND CT
132721 VISTA PKWY STE 10 WEST PALM BEACH,FL 33411-27312721 VISTA
1412861 58TH PL N ROYAL PALM BEACH,FL 33411-855312861 58TH PL
15PO BOX 3155 LANTANA,FL 33467#VALUE!
164892 DELL AVE APT 1 LAKE WORTH,FL 334614892 DELL AVE
Sheet1
 
Upvote 0
Because of the variance of the data (the lack of "hard and fast" rules), I think you would be hard-pressed to come up with any solution that is guaranteed to be 100% every time.
Not unless it was a paid service tied in to some database of street names and zip codes.
 
Upvote 0
This shows that computers cannot think like humans. We can look at the data and know where it needs to be separated in 99.9 percent of the entries. But the computer has to be told where and how to separate the data based on something it can detect. That something is missing from the sample data.
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,323
Members
452,635
Latest member
laura12345

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