Convert degrees minutes seconds to decimal degrees
How to Convert Decimal Degrees to Degree Minute Second (DMS)? Or do computations in the DMS format?
LPT: To Convert DMS to Decimal Minutes Just Divide Seconds by 60.
Good calculators which include a DMS and DMS<>DD hard buttons?
What is the formula for converting decimal degrees to DMS?
How accurate should my DMS conversion be?
What is a decimal degrees to DMS converter?
Videos
Hi all,
I've got a dataset with about 7000 rows. All of the coordinates are in a degrees minutes seconds format like this:
30 5 17
Literally that. Not even commas or quotes or anything. I need to convert them to decimal degrees so I can use ArcGIS to put them on a map:
30.08805556
I know the formula for this too! Degrees + Minutes/60 + Seconds/3600. So for this that would look like 30+(5/60)+(17/3600). Just not sure how to tell excel that it needs to use the spaces as a delimiter between the numbers. Any help would be awesome!!
I am using the code provided in this website for the conversion, but there's some bugs with it.
It works mostly fine until you get degrees (in either formats) starting with 0, or degrees (in either formats) in the negative.
Example:
Conversion from decial to dd°mm'ss"The correct answer (and correctly formatted), should be -0°00'24", and not -1°59'36". The calculation is wrong due to the INT() function taking the the "integer" -0 as -1, then using -1 in the addition/subtraction and the display of final results when it should be treated as -0.
Aside from the calculation bug, there's several key formatting that I also need:
-
If the angle is negative, the negative sign must be shown even when the degree (hour) unit is 0 . Meaning, the number should be displayed as -0°xx'xx", and not 0°xx'xx"
-
The negative sign must only be shown in the degree unit. Meaning the number should be displayed as -0°xx'xx", and not -0°-xx'-xx".
-
The numbers at the minute and second unit must be displayed in the tens even when the number is in single digit. Meaning the number should be displayed as -0°0x'0x", and not -0°x'x"
-
(Optional) The displaying of the seconds should be rounded off to the nearest integer. But when converting to decimals again, the decimals of seconds should be accounted for.
-
The resulting answer must be formatted in a way that is able to be converted vice versa.
I've tried looking on the internet, and none even addresses this calculation bug. I've read some say [hh]:mm:ss works, but I've found no more elaborate instruction on how to do that and having the above needed formatting other than "it just works".
Alternatively, the conversion process can be skipped if there is a method to do mathematical computations in the DMS format (while still having the required formatting).
Please help.
EDIT: The use of VBA is PROHIBITED, since it is a macro that Microsoft blocks on default.
dd.mmss is preferred over the dd°mm'ss" format