Postcode conundrum

Mobeedumi

New Member
Joined
Mar 6, 2023
Messages
1
Office Version
  1. 365
  2. 2021
Platform
  1. Windows
Within my spreadsheet - Column H - is where a postcode will be entered. If a postcode is entered in column H, I am wanting column I and J to automatically populate the appropriate information and wandering how best to do this. Not sure how to do this or if it will be via a partial vlookup or are there other simpler or more straightforward way to do this? Sheet 1 has a list of all the postcode in the area. Ideally if the first 4 characters of the postcode matches the postcode that is typed in column H, then column I and J will populate with list of locations created by data validation.to one of the areas (e,g, Daventry), the Cell in column I will show as Daventry and the corresponding cell in column J will state whether if this is north or south. If the postcode does not match any of the list of postcodes, then the outcome should be “out of area” in both column I and J.

Outline of excel database - the formula on display relates to column J

1678197653918.png


All the postcode for the Northamptonshire area below
1678197697389.png


Below are potential pivot tables which I would hoe would run/work with all of the above.

1678197786390.png
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
It would be a lot simpler if you restructured your postcode sheet thus (for all post codes);

Column A = Post code
Column B = Area
Column C = Site

Then it is just a simple case of using Vlookup and returning column 2 or 3

Unfortunately I could not install the mini sheet add-in so this is what I did;

Main Sheet
Patient NamePost CodeAreaSite
Joe BloggsONENorthhamptonNorth
Monty PythonTWODaventrySouth
Jane DoeTHREEOut of areaFalse

Post Code sheet
Post codeAreaSite
ONENorthhamptonNorth
TWODaventrySouth

Formulae in main sheet

Area column
=IF(ISNA(VLOOKUP(B2,Pcodes!A:C,2,0)),"Out of area",VLOOKUP(B2,Pcodes!A:C,2,0))

Site column
=IF(ISNA(VLOOKUP(B2,Pcodes!A:C,3,0)),"False",VLOOKUP(B2,Pcodes!A:C,3,0))
 
Upvote 0

Forum statistics

Threads
1,214,978
Messages
6,122,547
Members
449,089
Latest member
davidcom

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