Split unformatted addresses into separate columns

palaniappan0212

New Member
Joined
Aug 13, 2015
Messages
5
Hello Excel experts,

This is my first post here.

I need your help in solving an issue with separating out addresses into address, city, state and pin code.

This is how my data looks now.

[TABLE="width: 500"]
<tbody>[TR]
[TD][TABLE="width: 1036"]
<colgroup><col></colgroup><tbody>[TR]
[TD]503, LEVEL 5 , BLOCK A KELANA CENTRE POINT 3, JALAN SS 7/19, KELANA JAYA 47301 SELANGOR[/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD]1 ,JALAN PHASE INTAN, PHARSE NU3A1 NILAI UTAMA ENTERPRISE PARK NILAI 71800 NEGERI SEMBILAN[/TD]
[/TR]
[TR]
[TD]H-8-3 BAY AVENUE LORONG BAYAN INDAH 2 BAYAN LEPAS 11900 PULAU PINANG[/TD]
[/TR]
[TR]
[TD]2062 TAMAN DESA JAYA 2 CHENDERING 21080 TERENGGANU[/TD]
[/TR]
[TR]
[TD]5 USJ 6 JALAN USJ6/2J TAIPAN SUBANG JAYA 47610 SELANGOR[/TD]
[/TR]
</tbody>[/TABLE]


These are Malaysian addresses. The text after the pin code is the state and the text before it is the city.

I need to figure out a way to do so for 2000+ addressess. I tried using "RIGHT" and "FIND" functions and "Text to Columns" functions. All attempts were unsuccessful.

I would be very thankful if you could help me out here.

Thanks,
Palaniappan
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
1] Row 1, Heading >>
A1 : Addresses Data
B1 : City Address
C1 : Pin Code
D1 : State

2] A2 to A2000+, enter you addresses data

3] B2, formula copy down :

=SUBSTITUTE(A2," "&C2&" "&D2,)

4] C2, formula copy down :

=-LOOKUP(1,-RIGHT(LEFT(A2,LOOKUP(1,-MID(A2,ROW($1:$99),1),ROW($1:$99))),ROW($1:$99)))

5] D2, formula copy down :

=MID(A2,LOOKUP(1,-MID(A2,ROW($1:$99),1),ROW($1:$99))+2,250)

Regards
 
Upvote 0
Hi Palaniappan
Welcome to the board

Parsing addresses can be a difficult task.

You must analyse your addresses and derive clear rules of how to split them.

From what you posted, I understand that

1 - the last sequence of digits is the pin code
2 - the text after the pin code until the end of the address is the state

If this is correct, it will be easy to get them.

For the rest of the text, before the pin code, you'd need to post clear rules of how to get the city, etc.
For ex., in most countries cities names can have more than 1 word. If that's also the case for Malaysian cities, you'll have to tell us how excel can know where the city name starts.
 
Upvote 0
@bosco_yip: You are just awesome !!!! I am mindblown right now. Pincodes and states are extracted out like a charm. Thanks a million. Thank you !!!!!
 
Upvote 0
@pgc01.

Hi PGC,

You are right. The sequence is that the pin code is followed by the state name. bosco_yip's solution just did that.

Thank you for taking your precious time to analyse my problem.

Mr. Excel is awesome !!!

Thank you !
 
Upvote 0

Forum statistics

Threads
1,223,246
Messages
6,170,996
Members
452,373
Latest member
TimReeks

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