It can be done but you need to convert the post codes into Eastings and Northings. You would need to obtain a lookup table to do this. Then you can calculate distances using Pythagoras' Theorem like this http://www.mrexcel.com/forum/showthread.php?t=329669
has a database of approximate lat/long for all the UK high level post codes like SW1 TA2 WA10 etc. I have used this to work out approximate distances. If you can find one of Ordnance Survey grid references it would make the maths a bit simpler - you need to account for the fact that the earth gets smaller and the lines of lattitude and longitude get closer togetehr as you go north.
Not sure how the location of the post code is defined though and some of the post codes in Scotland are HUGE so you may have problems
If you want to get more precise the Ordnance Survey give locations for each full post code here:
But there are 1.7 million of them and the file is 20MB. I dont know of anything inbetween that woudl take you closer than the first but not be as big as the second - it may be out there somewhere!
1. Find data that ties postcode to latitude & longitude
one example at http://www.zipinfo.com/products/z5ll/z5ll.htm - this is about a $40 download, may be some free data if you search
Sample Records
City Name State Zip ... Latitude (deg) Longitude (deg)
Aurora CO 80010 ... 39.7403 -104.8598
Denver CO 80203 ... 39.7318 -104.9825
etc
2. Figure out the distance between the two points
- look up how to map lat/long data to actual distance* and **
- fiddle around / backcheck against actual published distance data (driving distances) for a few known pairs
Where R is the radius (typically 6371km for the Earth)
Dont forget you will have E and W longitudes in the UK so you need to take that into account by converting them into angles that mean something in the above formula
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.