Excel help puhlease

babs

Can't get enough of FH
Joined
Dec 30, 2003
Messages
1,595
I'm having a spaz moment. I have 2 worksheets. One has a column of postcodes, the other has a column of postcodes next to a column of respective towns.

I want to create a formula to take each postcode in turn on the 1st worksheet, compare it to the list on the 2nd and return the corresponding town name from the matching postcode.

Can I get my head around it? Can I flip.

Anyone?
 

Vae

Resident Freddy
Joined
Dec 23, 2003
Messages
1,182
=VLOOKUP(A8,E8:F17,2)

Where A8 contains the postcode you want to look up the town for, E8:F17 is the table (or range array) containing postcodes in the first column and towns in the second column, 2 is the column in the table (or range array) to return the result from.
 

Jupitus

Old and short, no wonder I'm grumpy!
Staff member
Moderator
FH Subscriber
Joined
Dec 14, 2003
Messages
3,362
... though better would be =VLOOKUP(A8,E8:F17,false) which will only return a value if it is an exact match. Please also note that for the vlookup to work well the table (in this case E8:F17) needs to be sorted on the first column ;)

Edit:

http://www.dippyworld.demon.co.uk/Files/Babs.xls

Should give you the idea... note the use of $A$1 type addressing which means the lookup array wont change if you copy and paste the formula down your list of postcodes ;)
 

babs

Can't get enough of FH
Joined
Dec 30, 2003
Messages
1,595
Heh I was then replying that I had a bit of a fiddle and sorted by the first column and changed range_lookup to FALSE. Thanks people :)
 

Users who are viewing this thread

Top Bottom