Formula to Extract text in Postal Address

RetroMe

New Member
Joined
Oct 2, 2009
Messages
48
I have a cell that contains a full address e.g. Flat 10, 1 London Road, Bromley, Kent, BR1 1AA. I would like to be able to extract each of the parts of the address that are seperated by a comma.

I have managed to get the first line with:
Code:
=LEFT(A1,FIND(", ",A1-1)

And the second with:
Code:
=SUBSTITUTE(MID(SUBSTITUTE("," & A1&REPT(" ",6),",",REPT(",",255)),2*255,255),",","")

But I don't know how to get the third, fourth and fifth.

Any help would be greatly appreciated.

Many thanks.
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
This works going across:

=TRIM(MID(SUBSTITUTE($A1,",",REPT(" ",99)),(COLUMNS($A$1:A1)-1)*99+1,99))
 
Upvote 0
As addresses can get quite long this is more bulletproof:

=TRIM(MID(SUBSTITUTE($A1,",",REPT(" ",LEN($A1))),(COLUMNS($A$1:A1)-1)*LEN($A1)+1,LEN($A1)))
 
Upvote 0
Thanks Steve. That works for the first part of the address. What would I need to add to make it work for the 2,3,4,5 lines etc? Thanks.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,177
Members
453,021
Latest member
Justyna P

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