VLookup to display area using postcode

DanaScully

New Member
Joined
Sep 20, 2017
Messages
6
Hi

I'm a new member here, nice to meet all of you :)

I am trying to create a VLookup function which will give an area by using a postcode (UK). I have followed directions on another website by searching 'determining a state from an area code' but I am getting a #VALUE ! error when using their suggested formula.

In the spreadsheet, I have created a named table (LondonPostcodes) with one column for my postcodes and one for the area name. For example, I would like the postcode SW1A 1AA to return the area 'London' in the adjacent cell. This is my formula:

=VLOOKUP(VALUE(LEFT(L32,6)),LondonPostcodes,2,FALSE)

Can anyone see where I might be going wrong? I am a novice to intermediate user and I am using Excel 2010 on Windows.

Thanks in advance for any replies.

DS
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
Hi, welcome to the forum!

What do you have in cell L32 and what is the corresponding lookup value in column 1 of LondonPostcodes?
 
Last edited:
Upvote 0
Hi FormR, thanks for your reply :)

I have a 6 character postcode in cell L32. I have removed the space in the middle so it's formatted as SW1 1AA in case that was the issue. I've also removed the spaces from the postcodes in my corresponding table so they are all definitely the same. I just want my formula to indicate if a postcode is in London or display 'FALSE' or similar if it's outside London.

I hope I've answered your question; if not please let me know and I'll try again.

DS
 
Upvote 0
I hope I've answered your question; if not please let me know and I'll try again.

Hi, I was hoping for some actual examples of the L32 values and what you are trying to match those against in the lookup table - but it sounds like they are the same, in which case it's simply:

=VLOOKUP(L32,LondonPostcodes,2,FALSE)
 
Upvote 0
Hi, I was hoping for some actual examples of the L32 values and what you are trying to match those against in the lookup table - but it sounds like they are the same, in which case it's simply:

=VLOOKUP(L32,LondonPostcodes,2,FALSE)

=VLOOKUP(VALUE(LEFT(L32,6)),LondonPostcodes,2,FALSE)

Thank you for your reply, your formula worked perfectly! I am very pleased and this will help me so much on a daily basis. :)

DS
 
Upvote 0
Sorry, please ignore the formula in my above post. I pasted it in to see how different your formula was to the one in my original post and forgot to delete it before I submitted. :laugh:
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,287
Members
452,631
Latest member
a_potato

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