# Excel 2007 : Distance Formula with Lat/Long

1. ## Distance Formula with Lat/Long

Hello,
I've red some previous thread's, but didn't help.
I'm trying Make things a bit easier by calculating distance using the "Spherical Law of Cosines" formula using Lat and Long between two points on the Earth (Sphere).

My Formula is: cos C = (cos A) (cos B) + (sin A) (sin B) cos c
therefore: =ACOS(SIN(lat1)*SIN(lat2)+COS(lat1)*COS(lat2)*COS(lon2-lon1))*6371 which gives the distance in km's (not a big deal to be in kilometers, I can change later to Nautical Miles)

However, I get a #VALUE in the distance field because, I've formatted my cells to this: Lat: 00"°"00.0"' N" and Long: 000"°"00.0"' W"
All I have to enter for Lat is: 4914.4 and show's Latitude 49°14.4' N and Longitude: 5344.5 for 053"°"44.5' W

I've tried to re-format the cells to DDMM.m and it wants to put it in Date format How can I enter and format the cells so that they will display in coordinates and also calculate distance?

I'm already dealing with DD:MM.m or DD:MM:SS as I'm using a Navigation Chart to get Lat and Long, and trying to get my distance in Nautical Miles.  Register To Reply

2. ## Re: Distance Formula with Lat/Long

I think you have to use radians: so Pi/180 times the latitude or longitude converted to decimal
(degrees would be the same) but Minutes must be divided by 60 and Seconds by 3600)  Register To Reply

3. ## Re: Distance Formula with Lat/Long

http://www.cpearson.com/excel/LatLong.aspx  Register To Reply

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