# Removing specific data from within a field

#### tmcleod

##### New Member
I have the following data and other similar data (around 3000 rows in total) each with an address as outlined below in each row

And I want to extract the postcode data and put into a seperate field.

How can I do this?

### Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).

#### footej

##### New Member
You may have to modify this formula for a distinct list of cities in your range, but it'll work for London

=MID(A1,FIND("London",A1)+7,8)

the +7 starts after the space following london, so if your city length varies, the 7 will have to be modifies, as will the 8 if it's a varying lenght of postal codes.

#### tmcleod

##### New Member
Thanks a lot! That worked well for London.

Wanted to know if it possible to use V-LOOKUP to enter more cities and adjust appropriately to give me results for more cities and if so how?

#### njimack

##### Well-known Member
The following isn't city-dependent, and seems to work for postcodes of 7 characters as well...

=MID(A1,FIND(" ",A1,FIND(" ",A1,LEN(A1)-10))+1,8)

#### facethegod

##### Well-known Member
try this in A1 assuning the postal code is SW16 3QG

Code:
``=RIGHT(A1,LEN(A1)-FIND("#",SUBSTITUTE(A1," ","#",LEN(A1)-1-LEN(SUBSTITUTE(A1," ","")))))``

HTH

#### footej

##### New Member
Sure, but to do that you'll need to pull out the city to build a table for your vlookup to reference, which is essentially the same process as pulling out the postal code. Here is another option.

You can copy your addresses into notepad, ctrl + H Find " " with "|" (omit quotes) and import this file into Excel using delimited and in the Other box type in |

Your postal code will always be the last 1 or 2 colums depending on if there is a space in the code as in your example.

At this point I would write a macro that starts in column N or something far away from your results, turn on relative reference and type in "=" then ctrl + Left Arrow twice, then in the next colums do the same thing

ctrl + Left Arrow takes you to the next cell with a value. then you can do while or just F5 3000 times.

Enjoy

Replies
2
Views
508
Replies
4
Views
834
Replies
4
Views
2K
Replies
17
Views
681
Replies
7
Views
1K

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

1,163,777
Messages
5,833,643
Members
430,221
Latest member
jmmccormick

### 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.

### Which adblocker are you using?

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

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