Issues with Converting from DMS to DD

mpratt

New Member
Joined
Sep 5, 2014
Messages
16
I have a couple hundred Lat/Long coordinates to convert to decimal degree in this DMS format:

[TABLE="width: 500"]
<tbody>[TR]
[TD][TABLE="width: 500"]
<tbody>[TR]
[TD]Latitude[/TD]
[TD]Longitude[/TD]
[/TR]
[TR]
[TD]37° 34' 45.90"[/TD]
[TD]-87° 39' 34.60"[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
I've tried various VBA codes via help sites and a few equations but nothing I've tried has worked. I'm not the most adept at Excel, which may be part of the problem, but I simply don't know what else to do to convert these coordinates.

I'd appreciate any help at all.

Thanks!
-Maddy
 
the usual separator issues:

=SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A2;"-";"");"° ";":");"' ";":");"""";"");".";",")*24*SIGN(LEFT(A2;2))

Only if the decimal separator is the comma rather than the dot (and the list separator is the semicolon rather than the comma).
 
Upvote 0

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
However, it didn't work for my Longitude values. Again, it highlighted the cell with my Long value in it as the cause of the problem.
 
Upvote 0
However, it didn't work for my Longitude values. Again, it highlighted the cell with my Long value in it as the cause of the problem.
Describe "didn't work". Your "it highlighted the cell" comment made it sound like you got an error... if so, what was the error... and what was the value in the Formula Bar for that cell?
 
Upvote 0
Probably needs:

=24*TEXT(ABS(A1), "0\:00\:00.0")*SIGN(A2)


That worked for most of the longitude values. I'm still getting an error message on a few of the cells however. I'm not sure what the error is though. For the cells with the error message this is what I know:

-Error Message for Long cells:
  • Show Calculation steps > 24*TEXT(ABS(K13), "0\:00\:00.0")*Sign(K13) > Evaluate > 24*TEXT(ABS(-874685.7), "0\:00\:00.0")*Sign(K13) > Evaluate> 24*TEXT(874685.7, "0\:00\:00.0")*Sign(K13) >Evaluate> 24*"87:46:85.7"*Sign(K13) >Evaluate > #Value!*Sign(K13) >Evaluate> #Value!*Sign(-874685.7) >Evaluate> #Value!*-1 >Evaluate > #Value!
-Error Message for Lat cells:
  • Show Calculation steps> 24*TEXT(J13), 0\:00\:00.0")> Evaluate> 24*TEXT(371788.7,"0\:00\:00.0") > Evaluate > 24*"37:17:88.7" (The next evaluation will show an error) > Evaluate > #Value!

-Formatting for cells: Custom- 00° 00' 00.00''
-Formula bar display for the cell: 371788.7 for latitude and -874685.7 for longitude

I'm not sure if this is helpful at all, but I don't understand what Excel is telling me is wrong.


 
Upvote 0

Forum statistics

Threads
1,224,811
Messages
6,181,080
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top