+ Reply to Thread
Results 1 to 8 of 8

Converting Lat/Long Coordinates from DMS to DD

  1. #1
    Registered User
    Join Date
    05-06-2011
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    5

    Converting Lat/Long Coordinates from DMS to DD

    Hi, I am looking for assistance in creating a function which will convert Lat/Long coordinates from Degrees Minutes Seconds to Decimal Degrees.
    The caveat is that the input coordinate is not in a traditional DMS format.
    The input value is: 42.344444374, which would traditionally read N42°34'44.44374".
    Respectively, -88.094498472 would traditionally read: W88°09'44.98472".

    Thanks, any help is appreciated.

  2. #2
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,849

    Re: Converting Lat/Long Coordinates from DMS to DD

    So, what you have, instead of DMS is you have a sort of Degree.decimal minutes or something that means whole number part + fraction part/60 -- which is what the DOLLARDE() function does (https://support.office.com/en-us/art...d-a38476693427 ). DOLLARDE(42.344444374,60) returns 42.57407 and DOLLARDE(-88.094498472,60) returns -88.157497. Are those correct?
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  3. #3
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,907

    Re: Converting Lat/Long Coordinates from DMS to DD

    DOLLARDE would be off a bit, since you need to divide minutes portion with 60, but seconds portion with 3600.

    You can use following formula: Same formula applies to both Lat & Long
    =(INT(ABS(A2))+ROUND(MOD(ABS(A2),1),2)*100/60+REPLACE(SUBSTITUTE(ABS(A2),LEFT(ABS(A2),FIND(".",ABS(A2))+2),""),3,0,".")/3600)*SIGN(A2)

    See attached sample.
    Attached Files Attached Files

  4. #4
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,919

    Re: Converting Lat/Long Coordinates from DMS to DD

    Quote Originally Posted by SebastianJ View Post
    42.344444374, which would traditionally read N42°34'44.44374".
    -88.094498472 would traditionally read: W88°09'44.98472".
    Try this ...

    =IF(A1>=0,"N","W")&SUBSTITUTE(TEXT(ABS(A1),"00.00\'00\.0000\'\'"),".","°",1)

  5. #5
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,849

    Re: Converting Lat/Long Coordinates from DMS to DD

    DOLLARDE would be off a bit, since you need to divide minutes portion with 60, but seconds portion with 3600.
    You are correct. I misread the problem statement and thought he had decimal minutes in the fraction portion of the number.

  6. #6
    Registered User
    Join Date
    05-06-2011
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Converting Lat/Long Coordinates from DMS to DD

    Yes, Thank you CK76.
    This is what I was looking for.

  7. #7
    Registered User
    Join Date
    05-06-2011
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Converting Lat/Long Coordinates from DMS to DD

    Generally, I have had success with the below function.
    However, I've notice that a few conversions in each data set I apply this to, does not return the correct converted value.

    =(INT(ABS(A2))+ROUND(MOD(ABS(A2),1),2)*100/60+REPLACE(SUBSTITUTE(ABS(A2),LEFT(ABS(A2),FIND(".",ABS(A2))+2),""),3,0,".")/3600)*SIGN(A2)

    For example:

    Input:
    42.34503058 -88.09529052

    Return:
    42.59730716 -88.18136256

    Where as the correct DD conversion is:
    42.58064049444444, -88.16469589722222

    Any thoughts?

    Thanks

  8. #8
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,907

    Re: Converting Lat/Long Coordinates from DMS to DD

    That's probably due to ROUND function for minute part.

    Try...
    =(INT(ABS(A2))+LEFT(MOD(ABS(A2),1)*100,2)/60+REPLACE(SUBSTITUTE(ABS(A2),LEFT(ABS(A2),FIND(".",ABS(A2))+2),""),3,0,".")/3600)*SIGN(A2)

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Get google maps place name from lat/long coordinates in excel
    By sabha in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 02-06-2019, 11:07 AM
  2. Replies: 1
    Last Post: 08-29-2014, 06:40 AM
  3. [SOLVED] Need help converting Coordinates
    By stewman in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-11-2013, 08:32 PM
  4. [SOLVED] converting X,Y chart points into actual coordinates
    By Alexander_Golinsky in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-21-2012, 04:34 AM
  5. Converting Geo-Coordinates in Excel?
    By andvin in forum Excel General
    Replies: 0
    Last Post: 03-08-2012, 02:28 PM
  6. Performance long/single comparison vs converting single to long
    By George Nicholson in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-03-2005, 02:05 PM
  7. converting long formula to VBA
    By hamboy in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-15-2005, 07:39 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1