+ Reply to Thread
Results 1 to 5 of 5

Thread: Get the nearest address according to zipcode

  1. #1
    Registered User
    Join Date
    02-19-2011
    Location
    Cairo
    MS-Off Ver
    Excel 2003
    Posts
    4

    Thumbs up Get the nearest address according to zipcode

    Hello All,

    Please help me with this case ,I need a formula or macro to find the nearest & 2nd_nearest (SITE_id ) according to the entered zipcode in Column (J). as expailned in the attached example.
    For further info please let me know .
    thanks a lot, Wellous
    Attached Files Attached Files
    Last edited by wellous; 11-24-2011 at 09:11 AM.

  2. #2
    Forum Guru darkyam's Avatar
    Join Date
    03-05-2008
    Location
    Colorado, US
    MS-Off Ver
    2007
    Posts
    2,170

    Re: Get the nearest address according to zipcode

    Your spreadsheet doesn't seem to have enough information. How are we to determine which areas are closest without knowing all mileages? Is it based on lowest numerical difference between zip codes (which doesn't seem foolproof to me)?
    Life is about perseverance. Remember: today's mighty oak tree is just yesterday's nut that held its ground.

    If you like a post, please rate it with the scales icon (top right).
    If you feel really indebted, please consider a donation to charity, such as Feed the Children or Habitat for Humanity.

  3. #3
    Registered User
    Join Date
    02-19-2011
    Location
    Cairo
    MS-Off Ver
    Excel 2003
    Posts
    4

    Red face Re: Get the nearest address according to zipcode

    Yes, it's based on difference bewteen zipcodes ..
    i found a solution but still not very accurate... due to zipcode format.

    Pls check the new example , range J6 & J7
    Can you correct my formula to reflect the nearest site correclty?

    Many thanks in advance
    Attached Files Attached Files

  4. #4
    Forum Guru darkyam's Avatar
    Join Date
    03-05-2008
    Location
    Colorado, US
    MS-Off Ver
    2007
    Posts
    2,170

    Re: Get the nearest address according to zipcode

    I had to create a helper column in A. You can hide it if you see fit, but it will have to be expanded if you add more to column B. I named this new range Zip2. I also fixed the problem of finding the true closest zip code, since before it thought that the closest zip to 74135 was 75201, rather than 74134.
    Attached Files Attached Files
    Life is about perseverance. Remember: today's mighty oak tree is just yesterday's nut that held its ground.

    If you like a post, please rate it with the scales icon (top right).
    If you feel really indebted, please consider a donation to charity, such as Feed the Children or Habitat for Humanity.

  5. #5
    Registered User
    Join Date
    02-19-2011
    Location
    Cairo
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Get the nearest address according to zipcode

    This is perfect, thank you very much

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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.2.0