This page describes various methods for working with Latitude and Longitude data in
Excel. You can download an example workbook
here.
North, South, East, And West
You will find it useful to treat Northern latitudes and Western longitudes as positive,
and Southern latitudes and Eastern longitudes as negative. You may reverse this, if
desired, but be sure to be consistent with all coordinates.
Entering Degrees, Minutes, And Seconds
You should enter degrees, minutes, and seconds in time format:
DD:MM:SS
Format the cell as [hh]:mm:ss to properly
display values such as 107:30:45. This
works only if you are working with positive coordinates. If you're working with
negative coordinates, you must manually convert them to decimal degrees.
Converting Degrees, Minutes, And Seconds To Decimal Degrees
While it may be useful to enter degrees, minutes, and seconds in the time format, these
values are not useful for computation. To convert DMS values to decimal degrees
(e.g., 45:30:30 to 45.50833),
multiply the DD:MM:SS value by 24, and format the cell as
General. For example,
=A1*24
Excel's trigonometric functions work only with Radians, not Degrees, so be sure to convert
angular values to radians with the
function.
Converting Decimal Degrees To Degrees, Minutes, And Second
When you do arithmetic with decimal degrees, you should use the =ABS function to ensure
that your final result is positive, so that Excel can reformat the result back into a
displayable time. (If Excel is using the 1900-Date system, the default, it cannot display
"negative" times. ) Once you have computed your result, divide it by
24 and format the cell as "[h]:mm:ss" to display
the result as DD:MM:SS .
Displaying Values as Deg° Min' Sec"
You may find it useful to display coordinates as Deg° Min'
Sec". You can do this with a custom number format. Select the cell
or cells to format, open the Cell Format dialog box from the Format menu, and add a new
custom format of
[hh]°mm'ss\"
To insert the degree symbol °, hold down the ALT key, and enter 0176 on the numeric
keypad on your keyboard. You then enter data into these cells in the format
dd:mm:ss, including the colons. You can't c
Great Circle Distances
I began working with Latitudes and Longitudes to create a worksheet that would allow me
to enter the latitudes and longitudes of two cities on Earth, and determine the Great
Circle Distance (this "as the crow flies" distance) between them.
The formula to compute this distance is:
=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))))
Where
Lat1 is the latitude of point 1, entered as DD:MM:SS.
Long1 is the longitude of point 1, entered as DD:MM:SS.
Lat2 is the latitude of point 2, entered as DD:MM:SS.
Long2 is the longitude of point 2, entered as DD:MM:SS.
RadiusEarth is the radius of the earth in
nautical miles (3443.917 nm or 6378.135 kilometers)
You can download an example file
here.