+ Reply to Thread
Results 1 to 3 of 3

Try to find the closest of two postcode lists

  1. #1
    Registered User
    Join Date
    09-14-2017
    Location
    Lincoln, UK
    MS-Off Ver
    MICROSOFT 365 APP FOR BUSINESS
    Posts
    36

    Try to find the closest of two postcode lists

    Hello Clever People!!
    I have sample data where I have a list of sites that we work on (postcodes only) and a list of Hospitals with A&E departments (postcodes only). To cut a very long and painful story short, to work on a site we need to provide a big pack up of information that includes the nearest A&E department. So I have gathered the information but I have no idea how to identify which hospital postcode is closest to which site.

    Is there any way around this? I know excel has to use latitudes and longitudes and have seen an example given previously. I'm just trying to avoid going through every possible combination between the two lists.

    Would be very grateful for any help available.

    Thank you in advance.
    Attached Files Attached Files

  2. #2
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,786

    Re: Try to find the closest of two postcode lists

    I used this link to convert some of your postcodes (I can't vouch for it's accuracy)

    https://www.freemaptools.com/convert...to-lat-lng.htm

    Then I used a version of the formula I found here:

    https://stackoverflow.com/questions/...nates-in-excel

    So see the attached where the formula in E4 copied down is

    =LOOKUP(1,1/FREQUENCY(0,MMULT((H$4:I$16-C4:D4)^2,{1;1})),F$4:F$16)

    [you'll have to extend the ranges in the formula once you have more conversions]

    Because I only converted hospitals in the Birmingham postcodes they are all roughly equal distances, but obviously if you convert all of the data you will be able to do some sort of "sanity check" to see if the results make sense
    Attached Files Attached Files
    Audere est facere

  3. #3
    Registered User
    Join Date
    09-14-2017
    Location
    Lincoln, UK
    MS-Off Ver
    MICROSOFT 365 APP FOR BUSINESS
    Posts
    36

    Re: Try to find the closest of two postcode lists

    Thank you so much, I will have a look. Hopefully that will work.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Find / Extract UK Postcode Using VBA
    By Skins11 in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 11-02-2021, 05:57 AM
  2. Finding the closest match from 3 corresponding lists
    By simonpreston in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 10-31-2018, 01:13 PM
  3. [SOLVED] Postcode check and return of value in column title and cell adjacent to postcode
    By BigTP in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-26-2018, 05:04 AM
  4. I want the the drop down lists to start with the closest entry as the user types.
    By Gr8ful in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 08-01-2017, 03:49 PM
  5. [SOLVED] Compare two lists of words to find closest matches
    By elise.benjamin in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-10-2015, 10:02 AM
  6. [SOLVED] Help needed trimming full postcode address to postcode sector.
    By Mikey7346 in forum Excel - New Users/Basics
    Replies: 5
    Last Post: 08-10-2012, 05:11 PM
  7. 2 lists of coordinates. I wanna find the closest
    By 008 in forum Excel General
    Replies: 1
    Last Post: 04-28-2011, 01:09 AM

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