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:

LatitudeLongitude
37° 34' 45.90"-87° 39' 34.60"

<tbody>
</tbody>

<tbody>
</tbody>
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

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
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,215,708
Messages
6,126,373
Members
449,311
Latest member
accessbob

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