# Help to compare two lists to show a corrosponding value

#### clairep

##### New Member
Hi, I have a list of towns and their post codes (post code list) in an excel spreadsheet. In a seperate spreadsheet I have a long list of addresses, I need to be able to look up each town in the post code list, and return the appropriate post code in the next column in my address list. Please can someone tell me if this can be done, and if so, how to do it. Thank you.

### Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"

#### Special-K99

##### Well-known Member
A post code defines a street in a town not the town itself.
You need a list of streets and postcodes to determine the correct postcode.

Last edited:

#### bamblack

##### Board Regular
Easily achievable via a vlookup formula. Punch this into C2

Code:
``=VLOOKUP(B2,'Post codes'!A:B, 2)``

Then fill that down. That tells it to look for the value in B2 in the defined range ('Post codes!A:B) then the offset in that row to return when it finds it (2). I believe that's how it's set up at least. The formula works which is the important part!

#### clairep

##### New Member
You are awesome!!! Thank you.

Replies
7
Views
218
Replies
12
Views
714
Replies
0
Views
153
Replies
3
Views
233
Replies
9
Views
133

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,152,255
Messages
5,769,061
Members
425,515
Latest member
baltusf

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