Closed Thread
Results 1 to 16 of 16

UK Postcode Distance Calculator

  1. #1
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,679

    UK Postcode Distance Calculator

    I first put the attached file together some years ago, and I've mentioned it on one post here soon after I joined and have had a few PMs asking for a copy, so I thought I might as well submit it here.

    The file works out the distance in miles between 2 UK postcodes. On the Single sheet you can enter the two postcodes in B3 and B4 (just up to the first space), and on the Multiple sheet you can enter several postcodes on different rows in columns A and B, where, for example, you might have one central location and need to know the distances to travel from other locations.

    The file uses a lookup table containing lattitudes and longitudes, and calculates the straight-line distance between the "nominal" centre of each postcode.

    Hope this is of use to some of you.

    Pete
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    07-08-2012
    Location
    Aurangabad, Maharashtra
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: UK Postcode Distance Calculator

    Good, But show more typical things like drop down list.

  3. #3
    Registered User
    Join Date
    02-14-2012
    Location
    Newcastle, England
    MS-Off Ver
    Excel 2010
    Posts
    97

    Re: UK Postcode Distance Calculator

    Hey this is prety handy, good work Pete.
    Could you get it to work with the second half of the postcode?

    Cheers
    Carl

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,679

    Re: UK Postcode Distance Calculator

    Hi Carl,

    yes, it could be adapted to the full postcode - do you have a complete list of them?

    Pete

  5. #5
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: UK Postcode Distance Calculator

    I do, but it might be a bit exhaustive - there are over 1.6m of them - I've got the lat/lng for them too - dunno if it's of any use though!!

    OS publish a free version of them with eastings and northings if you need them, it's a bit of a pain to convert them all into lat lon, but it's doable - I've got a SQL script that does it if you need, pretty accurate too from my testing

  6. #6
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,679

    Re: UK Postcode Distance Calculator

    Hi Kyle,

    I knew there was over a million of them, and I suppose new ones are added quite often (as new houses/office developments are built). I'm not sure how you could attach a file that large to the Forum.

    Pete

  7. #7
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: UK Postcode Distance Calculator

    It's one of the reasons I use a web service for distance calculations in Excel, they also go by road distance rather than as the crow flies

  8. #8
    Registered User
    Join Date
    01-08-2014
    Location
    liverpool
    MS-Off Ver
    Excel 2003
    Posts
    1

    Re: UK Postcode Distance Calculator

    Quote Originally Posted by Pete_UK View Post
    I first put the attached file together some years ago, and I've mentioned it on one post here soon after I joined and have had a few PMs asking for a copy, so I thought I might as well submit it here.

    The file works out the distance in miles between 2 UK postcodes. On the Single sheet you can enter the two postcodes in B3 and B4 (just up to the first space), and on the Multiple sheet you can enter several postcodes on different rows in columns A and B, where, for example, you might have one central location and need to know the distances to travel from other locations.

    The file uses a lookup table containing lattitudes and longitudes, and calculates the straight-line distance between the "nominal" centre of each postcode.

    Hope this is of use to some of you.

    Pete


    Thank you for the share, great job! I am trying to figure out a way where if you enter a post code and a distance it will tell you the surrounding postcodes. Do you have any ideas on how to do this?

    Thanks in advance

  9. #9
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,679

    Re: UK Postcode Distance Calculator

    I think you would need to examine every postcode in the list (there are 2,800+ of them) and determine the distance to see if that is within range, and then report that. I think it would be a bit sluggish, so maybe there are other algorithms that would speed things up (like omitting the distance calculation if the lat or long or obviously out of range from the source postcode).

    Pete

  10. #10
    Registered User
    Join Date
    10-26-2016
    Location
    London
    MS-Off Ver
    Office 2016
    Posts
    1

    Re: UK Postcode Distance Calculator

    Check the distance between any cities in England on a map of the world.

    This calculator will calculate the distance - http://distancecalculation.info/
    between the cities on a map of the world will always help anyone
    who wants to know the exact distance between the cities and countries of the world.
    Name:  road_home.jpg
Views: 26090
Size:  25.9 KB
    The calculation of the distance on the map of the world is possible!
    In a straight line - as if you were flying in an airplane.
    On the roads - always choose the most optimal route by road.
    Walking - the calculation of distance is carried out on public roads with a speed of 5km / h.
    Cycling - the distance calculation is carried out on public roads with a speed of 20km / h.

    Our calculator can calculate a route only on free roads
    then you do not have to pay for travel on the roads, as is well known in Europe
    almost all toll roads, but there are free - this route will only
    toll-free roads and you will save money

    Our calculation distance calculator will give you additional information: approximate travel time, price and quantity of fuel
    you potramite on this route, distance killometrah.

    You can also create a complex route which will pass through only those cities that you need
    You can add up to 10 intermediate cities and your route will be built through them.

    Our distance calculator for calculating have additional fields where you will be able to
    indicate how many liters of fuel your vehicle consumes on a 100km path, and specify the cost of fuel per 1 liter.

    On the map of the world will show you a detailed route where it will be able to consider in detail, also
    a geographical map of the route you will receive detailed instructions where you need to go by car and where you have to rotate the pointers to all traffic signs.

  11. #11
    Registered User
    Join Date
    05-12-2017
    Location
    London
    MS-Off Ver
    Excel 2016
    Posts
    1

    Re: UK Postcode Distance Calculator

    Pete
    I just wanted to say thanks, this postcode calculator is brilliant and was exactly what i was after particulrly the batch function, thank you.
    Mike

  12. #12
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,679

    Re: UK Postcode Distance Calculator

    Thanks for the comment, Mike, but it is probably very out of date now as it was over 8 years ago that I submitted it.

    I wonder if anyone has a more up-to-date list of postcodes?

    Pete

  13. #13
    Registered User
    Join Date
    04-08-2014
    Location
    York
    MS-Off Ver
    Excel 2013
    Posts
    24

    Re: UK Postcode Distance Calculator

    That's a great one. Thank for sharing it. Can I ask you please? I realised you entered (A4:F4,"?*")=0 in the formula. What does the "?*" do? Just curious. Have used the wild car * but haven't used the interrogation mark (another wild card I believe?) very often and if you can help to understand it please.

    Thank you

  14. #14
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,444

    Re: UK Postcode Distance Calculator

    The Net is full of surprises https://exceljet.net/glossary/wildcard

  15. #15
    Registered User
    Join Date
    10-18-2022
    Location
    Harrogate, England
    MS-Off Ver
    365
    Posts
    1

    Re: UK Postcode Distance Calculator

    I know this an old thread, however I have found it extremely useful so I am hoping someone can help me out.

    I am looking for an updated list that I can use, as I am finding that the file linked by the OP is too far out of date to make it usable for what I need. To put it simply, I have a team of over 50 people dotted around the UK, and I have used the Postcode Distance Calculator to enable me to see who lives closest to a location when I input the first half of the postcode. However if I do the same on Google and just input the first half of each postcode it is invariably a different distance, this is most likely down to road changes etc. So I was wondering if anyone knows of how to get hold of an updated list, and more importantly how I would add it to this one.

    Again many thanks for posting this Pete

  16. #16
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,239

    Re: UK Postcode Distance Calculator

    Administrative Note:

    Welcome to the forum.

    We are happy to help, however whilst you feel your request is similar to this thread, experience has shown that things soon get confusing when answers refer to particular cells/ranges/sheets which are unique to your post and not relevant to the original.

    Please see Forum Rule #4 about hijacking and start a new thread for your query.

    If you are not familiar with how to start a new thread see the FAQ: How to start a new thread
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1