+ Reply to Thread
Results 1 to 2 of 2

Latitude and Longitude: Minimize distance

  1. #1
    Registered User
    Join Date
    12-23-2009
    Location
    Irvine, California
    MS-Off Ver
    Excel 2003
    Posts
    22

    Latitude and Longitude: Minimize distance

    I have a list of locations and people and their latitude and longitudes. I’m using this equation to calculate the distance between the two.

    =SUM(60*ACOS((SIN(Lat1*PI()/180)*SIN(Lat2*PI()/180)+COS(Lat1*PI()/180)*COS(Lat2*PI()/180)*COS((Long2-Long1)*PI()/180)))*180/PI())

    I would like to have a user form that when the person selects the location it will show them the nearest person. So basically you select a one location and the distance formula calculates all distances between it and the people and returns the closest person. Anyone have an idea of how I would do this?

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Latitude and Longitude: Minimize distance

    Put one person's lat/long at the top of the list, and compute everyone else's distance from them. Then sort ascending by distance.
    Entia non sunt multiplicanda sine necessitate

+ 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.6.0 RC 1