filling other cells based on a postcode?

Dayveez

New Member
Joined
Jan 25, 2012
Messages
8
A1---------- A2------------- A3
Postcode--- County-------- Country

<table style="width: 342px; height: 49px;" border="0" cellpadding="0" cellspacing="0"><colgroup><col style="width:48pt" width="64"> <col style="mso-width-source:userset;mso-width-alt:5961;width:122pt" width="163"> <col style="mso-width-source:userset;mso-width-alt:9106;width:187pt" width="249"> </colgroup><tbody><tr style="height:21.0pt" height="28"> <td class="xl63" style="height:21.0pt;width:48pt" width="64" height="28">BT32
</td> <td class="xl63" style="width:122pt" width="163"> County Down
</td> <td class="xl63" style="width:187pt" width="249"> England
</td> </tr> <tr style="height:21.0pt" height="28"> <td class="xl63" style="height:21.0pt" height="28">BT33</td> <td class="xl63"> ?</td> <td class="xl63"> ?
</td> </tr> <tr style="height:21.0pt" height="28"> <td class="xl63" style="height:21.0pt" height="28">BT34
</td> <td class="xl63"> County Down
</td> <td class="xl63"> England
</td> </tr> </tbody></table>
I have a database of UK postcodes on a excel sheet with all the counties and countries next to them.
I want to put in a postcode in any cell for example: BT33, and want it to automatically tell me next to it in 'A2' that its 'county down' and in 'A3' that its 'England'.
..So that i dont have to keep typing 'county down' and 'england' every time someone calls me from that area and i input their details. Instead want to just type BT33 and it comes up.

Please help. :confused:
 
Last edited:

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Excel Workbook
ABC
1Postcode--- County-------- Country
2
3BT32County DownEngland
4BT33??
5BT34County DownEngland
6
7
8bt32County DownEngland
9bt33??
10bt34County DownEngland
Blad2
Cell Formulas
RangeFormula
B8=VLOOKUP($A8,$A$3:$C$5,COLUMN(),0)
B9=VLOOKUP($A9,$A$3:$C$5,COLUMN(),0)
B10=VLOOKUP($A10,$A$3:$C$5,COLUMN(),0)
C8=VLOOKUP($A8,$A$3:$C$5,COLUMN(),0)
C9=VLOOKUP($A9,$A$3:$C$5,COLUMN(),0)
C10=VLOOKUP($A10,$A$3:$C$5,COLUMN(),0)
 
Upvote 0
thats amazing how i got quick replies. thank you. it looks complicated but i'll try and study hard. a step by step process wouldn't go a miss either as vlookup is a weak spot for me.
 
Upvote 0
I use in B8 de formula column().

With that formula it's easy to copy the formula to another cells without changing the formula.

In B8 is column() = 2 (B is the second column).

In C8 is column() = 3 (C is the thirth column).

and so on.
 
Upvote 0
I used this one.

Create an Excel VLookup formula


You can also use F1 (= help) in Excel.
 
Upvote 0
Sorry, I tried the way you did it but nothing happens if i put BT33 on a random cell in the A column.
 
Upvote 0
Sorry, I tried the way you did it but nothing happens if i put BT33 on a random cell in the A column.

No matter where you place the BT33 you need to make sure that you have one of the VLOOKUP's referencing it.
 
Upvote 0
I try to explain in words.

b8
Code:
=VLOOKUP($A8,$A$3:$C$5,COLUMN(),0)

1) Lookup A8 => this is BT32

2) Look this up in the range A3:C5.

3) IF BT32 is found in de Range A3:A5

4) Then look in the 2th colum in the Range (in this example B3)
=> is the explaination of column().

5) BT32 needs to be found exactly.

Do you have questions on this item, just ask.
 
Upvote 0

Forum statistics

Threads
1,216,101
Messages
6,128,842
Members
449,471
Latest member
lachbee

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