Town/City to lookup county

[Closed]
Report
Posts
2
Registration date
Tuesday March 15, 2016
Status
Member
Last seen
March 15, 2016
-
Posts
2779
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
July 29, 2021
-
Hello,

I have a spreadsheet that what i am trying to accomplish is that when an address is typed into a column it will look up and match the town and will come back with the county it is in. I have two pages Master and Town & City. Master contains the address (B) and county (C) column. Town & City has the table that contains a list of towns and cities (A) and the corresponding county (B). I have tried various if then statements and lookups and can't quite seem to get it. Any help would be amazing.

1 reply

Posts
2779
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
July 29, 2021
468
Hi Mohalloran,

Try the VLOOKUP formula:
=VLOOKUP(The address you want to lookup, the matrix addresses and countries are located, 2, 0)

Best regards,
Trowa
Posts
2
Registration date
Tuesday March 15, 2016
Status
Member
Last seen
March 15, 2016

The formula I have typed in is =vlookup([@[Address]],'Town &City'!A:B, 'Town & City'!B:B,2) and it just keeps returning #REF
Posts
2779
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
July 29, 2021
468
Hi Mohalloran,

Let's say the address you want to look up is in sheet 'Town &City' C2.
The matrix with addresses and countries are located in sheet 'Master' B:C.
Then the formula in sheet 'Town &City' D2 will look like:

=VLOOKUP(C2,'Master'!B:C,2,0)

The value in C2 will be looked up in column B of Master sheet. The corresponding value in column C of Master sheet will be returned, hence the 2 (second column in the matrix) after the 2nd comma. The final zero means that the addresses in column B of Master sheet don't have to be in alphabetical order.

Best regards,
Trowa

Subscribe To Our Newsletter!

The Best of CCM in Your Inbox

Subscribe To Our Newsletter!