+ Reply to Thread
Results 1 to 5 of 5

Distance Formula for Latitude and Longitude

  1. #1
    Registered User
    Join Date
    11-21-2006
    Posts
    2

    Red face Distance Formula for Latitude and Longitude

    I need help with the formula for computing mileage between points using latitude and longitude. I have obtained this formula:

    RadiusEarth*ACOS(COS(RADIANS(90-(Lat1*24)))*COS(RADIANS(90-(Lat2*24)))+
    SIN(RADIANS(90-(Lat1*24)))*SIN(RADIANS(90-(Lat2*24)))*
    COS(RADIANS(24*(Long1-Long2))))

    I have the figure for the radius of the Earth, 3956 miles.

    I want to caluculated the distance of several of addresses from one address.

    Can anyone assist me?

    Dan

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,475
    http://www.cpearson.com/excel/latlong.htm
    http://support.microsoft.com/default.aspx/kb/254676

  3. #3
    Registered User
    Join Date
    11-21-2006
    Posts
    2

    Smile Thanks

    Thanks Dave!

  4. #4
    Registered User
    Join Date
    11-05-2012
    Location
    Malaysia
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re-ask : Distance Formula for Latitude and Longitude

    Hi dankappa,
    have u found the solution on latitude and longitude calculation.?
    i've try and make some alteration of the coding from http://www.cpearson.com/excel/latlong.htm with the help from other excel forum user. The coding is as below :

    Please Login or Register  to view this content.
    However, when i try to run the macro, it turn to have
    compile error:
    Argument not optional

    i think it because of the

    Cells(i, 5) = GreatCircleDistance(Lat1, long1, Lat2, long2)

    does not declare all argument from the GreatCicrcleDistance function. but when i put all the arguments to the equation, nothing is happen.

    Actually how to apply the function so it can be use in the excel sheet.?

    Thank you very much in advance.

  5. #5
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Distance Formula for Latitude and Longitude

    Fazna,

    Unfortunately you need to post your question in a new thread, it's against the forum rules to post a question in the thread of another user. If you create your own thread, any advice will be tailored to your situation so you should include a description of what you've done and are trying to do. Also, if you feel that this thread is particularly relevant to what you are trying to do, you can surely include a link to it in your new thread.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ 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