+ Reply to Thread
Results 1 to 23 of 23

Convert GPS Degrees Minutes Seconds to Decimal

  1. #1
    Registered User
    Join Date
    01-30-2014
    Location
    California
    MS-Off Ver
    Excel 2010
    Posts
    16

    Post Convert GPS Degrees Minutes Seconds to Decimal

    Hi all,

    This may have been already answered somewhere here in this forum, although I couldn't find it at least in the same format as I have my data.

    I already tried what's explained on this video http://www.youtube.com/watch?v=0QxxuSIFdFU via VBA but the returned decimal values are not correct.


    What would be the formula to convert the following data (it is in the same cell):

    12°34'56.78"N --> to decimal (the only variation here would be the other coord.. instead of N it would be a W)

    And:

    12.345678° --> to decimal


    Thanks in advance.

    --Nelson.

  2. #2
    Forum Expert
    Join Date
    12-11-2011
    Location
    Netherlands
    MS-Off Ver
    office 365
    Posts
    3,670

    Re: Convert GPS Degrees Minutes Seconds to Decimal

    Take a look at this dutch document
    Attached Files Attached Files
    Willem
    English is not my native language sorry for errors
    Please correct me if I'm completely wrong

  3. #3
    Registered User
    Join Date
    01-30-2014
    Location
    California
    MS-Off Ver
    Excel 2010
    Posts
    16

    Re: Convert GPS Degrees Minutes Seconds to Decimal

    Thank you popipipo.

    As far as I can understand the document, it seems like the degrees, minutes and/or seconds are in separate cells, and that wouldn't work for me unfortunately.

    Did I miss something there?

    Thanks again.

    --Nelson.

  4. #4
    Forum Expert
    Join Date
    12-11-2011
    Location
    Netherlands
    MS-Off Ver
    office 365
    Posts
    3,670

    Re: Convert GPS Degrees Minutes Seconds to Decimal

    If you post a xls file here I try to translate it

  5. #5
    Registered User
    Join Date
    01-30-2014
    Location
    California
    MS-Off Ver
    Excel 2010
    Posts
    16

    Re: Convert GPS Degrees Minutes Seconds to Decimal

    I don't think I'm following you, sorry.

    Here's what I have:

    A1 cell contains:

    12°34'56.78"N ---> need to convert that to decimal

    Another cell, let's say A2 contains:

    12°34'56.78"W ---> need to convert that to decimal

    Another cell, let's say B1 contains:

    12.345678° ---> need to convert that to decimal

    My entire xls file would look like the above.

    Thanks,

    --Nelson.

  6. #6
    Forum Expert
    Join Date
    12-11-2011
    Location
    Netherlands
    MS-Off Ver
    office 365
    Posts
    3,670

    Re: Convert GPS Degrees Minutes Seconds to Decimal

    If A1 cell contains 12°34'56.78"N is this allways that format and A1 never contains 12.345678°

  7. #7
    Registered User
    Join Date
    01-30-2014
    Location
    California
    MS-Off Ver
    Excel 2010
    Posts
    16

    Re: Convert GPS Degrees Minutes Seconds to Decimal

    Quote Originally Posted by popipipo View Post
    If A1 cell contains 12°34'56.78"N is this allways that format and A1 never contains 12.345678°
    Yes, each cell contain either the format 12°34'56.78"N or 12.345678°, I just need to formula to convert each of these formats to decimal.

    [I'll take care of pasting the formula respectively, that's not a problem].


    Thanks,


    --Nelson.

  8. #8
    Forum Expert
    Join Date
    12-11-2011
    Location
    Netherlands
    MS-Off Ver
    office 365
    Posts
    3,670

    Re: Convert GPS Degrees Minutes Seconds to Decimal

    Extra columns is that allowed?
    It makes the formulas much easier.

  9. #9
    Registered User
    Join Date
    01-30-2014
    Location
    California
    MS-Off Ver
    Excel 2010
    Posts
    16

    Re: Convert GPS Degrees Minutes Seconds to Decimal

    Yeah, let's say A1 has the value: 12°34'56.78"N, let's make B1 cell the decimal version of A1

    Same here, let's say A2 has the value: 12.345678°, let's make B2 cell the decimal version of A2

    I'm 99% that each formula is going to be different, and again, I'll take care of the pasting stuff for each format.

    Thanks again.

    BTW, I thought I found the solution here: http://shaileshchaure.com/howconverDminuts_Ddecimal.php by using the formula described under "COMPLICATED BUT BETTER WAY":

    Please Login or Register  to view this content.
    But no luck for me

    --Nelson.
    Last edited by Nelson.B22; 02-03-2014 at 05:48 PM.

  10. #10
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Convert GPS Degrees Minutes Seconds to Decimal

    Assuming you always have seconds to hundredths,

    A
    B
    1
    12°34'56.78"N
    12.58244


    In B1:

    =IF(OR(RIGHT(A1)={"S","W"}), -24, 24) * TEXT(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(LEFT(A1, LEN(A1)-1), "°", ""), "'", ""), """", ""), " ", ""), "0\:00\:00.00")
    Entia non sunt multiplicanda sine necessitate

  11. #11
    Registered User
    Join Date
    01-30-2014
    Location
    California
    MS-Off Ver
    Excel 2010
    Posts
    16

    Re: Convert GPS Degrees Minutes Seconds to Decimal

    shg:

    You nailed it! Although, one of my other values is like this:

    12°3'45.67"N --> and it's decimal value is way off (somewhere in the Pacific Ocean )

    Is it because of the Minutes are not to hundredths in this case?

    Thank you.

    --Nelson.

  12. #12
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Convert GPS Degrees Minutes Seconds to Decimal

    It needs two-digit minutes.

  13. #13
    Registered User
    Join Date
    01-30-2014
    Location
    California
    MS-Off Ver
    Excel 2010
    Posts
    16

    Re: Convert GPS Degrees Minutes Seconds to Decimal

    Quote Originally Posted by shg View Post
    It needs two-digit minutes.
    So is this an "impossible mission"?

    Would it be better to separate Degrees, Minutes and Seconds in columns? (yuck!)

    How can this be accomplished?

    --Nelson.

  14. #14
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Convert GPS Degrees Minutes Seconds to Decimal

    You could use a UDF:

    A
    B
    C
    1
    12°34'56.78"S
    -12.5824
    B1: =DMS2Deg(A1)
    2
    12°3'45.67"N
    12.06269


    Please Login or Register  to view this content.

  15. #15
    Registered User
    Join Date
    01-30-2014
    Location
    California
    MS-Off Ver
    Excel 2010
    Posts
    16

    Re: Convert GPS Degrees Minutes Seconds to Decimal

    Mr./Mrs. shg,

    You have done it. So far all the tests done are accurate.
    I really appreciate your help and time on this.

    May I abuse of your knowledge and ask you about the other value: 12.345678° --> to decimal ?

    I'm more or less familiar with other programming languages, I just can't wrap my head around VBA

    Thanks so much.

    --Nelson.

  16. #16
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Convert GPS Degrees Minutes Seconds to Decimal

    =--substitute(a1, "°", "")

  17. #17
    Registered User
    Join Date
    01-30-2014
    Location
    California
    MS-Off Ver
    Excel 2010
    Posts
    16

    Re: Convert GPS Degrees Minutes Seconds to Decimal

    Quote Originally Posted by shg View Post
    =--substitute(a1, "°", "")
    Oh, duh, silly me.. I didn't realize that 12.345678° is the same as 12.345678 (sorry about that)... I thought it needed some kind of conversion from "degrees".

    Anyway... if you don't mind, what's the difference between:
    Please Login or Register  to view this content.
    and
    Please Login or Register  to view this content.
    ?

    I really appreciate it.

    --Nelson.

  18. #18
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Convert GPS Degrees Minutes Seconds to Decimal

    Make the column containing the formula wide, set the horizontal alignment to General, and try it both ways. What do you see?

  19. #19
    Registered User
    Join Date
    01-30-2014
    Location
    California
    MS-Off Ver
    Excel 2010
    Posts
    16

    Re: Convert GPS Degrees Minutes Seconds to Decimal

    Oh, so it is just for alignment..

    With =--SUBSTITUTE(G4, "°", "") --> value is aligned to the right

    With =SUBSTITUTE(G4, "°", "") --> value is aligned to the left

    Ok.. thank you again for all your help. I'll mark this post as SOLVED!

    --Nelson.

  20. #20
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Convert GPS Degrees Minutes Seconds to Decimal

    It's more than alignment. What does alignment tell you about the contents of a cell?

  21. #21
    Registered User
    Join Date
    01-30-2014
    Location
    California
    MS-Off Ver
    Excel 2010
    Posts
    16

    Re: Convert GPS Degrees Minutes Seconds to Decimal

    Quote Originally Posted by shg View Post
    It's more than alignment. What does alignment tell you about the contents of a cell?
    Hmmm... the difference between plain text and numerical values (?)

    --Nelson.

  22. #22
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Convert GPS Degrees Minutes Seconds to Decimal

    That is the key difference, and a glaring clue that people lose when they center everything, and then can't figure out why their formulas don't work.

    MANY functions ignore text that looks like numbers.

  23. #23
    Registered User
    Join Date
    01-30-2014
    Location
    California
    MS-Off Ver
    Excel 2010
    Posts
    16

    Re: Convert GPS Degrees Minutes Seconds to Decimal

    I see. Interesting. Thanks for pointing that out.

    --Nelson.

+ 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] convert decimal degrees to degrees minutes seconds
    By Chris r in forum Excel General
    Replies: 6
    Last Post: 12-06-2013, 06:24 AM
  2. [SOLVED] Decimal Degrees to Degree Minutes Seconds Conversion VBA Stripping Leading Zeros
    By JTHOM in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-18-2012, 11:04 PM
  3. Converting Lat/Long (Degrees Minutes Seconds) to Decimal Degrees
    By Jeremy Rayne in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-24-2008, 06:02 PM
  4. Replies: 2
    Last Post: 04-28-2006, 07:20 AM
  5. Replies: 1
    Last Post: 11-23-2005, 10:15 AM

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