AI Assistant
Notifications
Clear all

CONVERTING DECIMAL DEGREES TO DMS IN EXCEL TO TWO PLACES (EXAMPLE 10?ø47'25.32")

13 Posts
5 Users
0 Reactions
1,121 Views
ekillo
(@ekillo)
Posts: 559
Member
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
 

I need a little help with this.?ÿ What do I need to change to get two places on the seconds?

?ÿ

Function Convert_Degree(Decimal_Deg) As Variant
With Application
'Set degree to Integer of Argument Passed
Degrees = Int(Decimal_Deg)
'Set minutes to 60 times the number to the right
'of the decimal for the variable Decimal_Deg
Minutes = (Decimal_Deg - Degrees) * 60
'Set seconds to 60 times the number to the right of the
'decimal for the variable Minute
Seconds = Format(((Minutes - Int(Minutes)) * 60), "0")
'Returns the Result of degree conversion
'(for example, 10.46 = 10~ 27 ' 36")
Convert_Degree = " " & Degrees & "?ø " & Int(Minutes) & "' " _
& Seconds + Chr(34)
End With
End Function

?ÿ

Thanks,

Ed


 
Posted : July 3, 2019 5:25 pm
field-dog
(@field-dog)
Posts: 1543
Member
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
 

Looks like you got the code from https://support.microsoft.com/en-us/help/213449/how-to-convert-degrees-minutes-seconds-angles-to-or-from-decimal-angle .

I'll try to figure this out for you just because it's a challenge.


 
Posted : July 3, 2019 5:54 pm
field-dog
(@field-dog)
Posts: 1543
Member
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
 

https://excel.tips.net/T003085_Formatting_for_Hundredths_of_Seconds.html


 
Posted : July 3, 2019 6:02 pm
field-dog
(@field-dog)
Posts: 1543
Member
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
 

https://www.excelsupersite.com/easily-convert-decimal-degrees-to-degrees-minutes-seconds-in-excel/

This looks like it addresses your issue.


 
Posted : July 3, 2019 6:18 pm
ekillo
(@ekillo)
Posts: 559
Member
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
 

Thanks.

I have never understood why this is not a built in function in EXCEL.

Ed


 
Posted : July 3, 2019 8:14 pm

jimcox
(@jimcox)
Posts: 2102
Member
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
 

Because excel, like most computers, thinks in Radians...

BTW I have a little add on for excel, that gives you the hms, r->p, etc functionality of the old HP calculators. Free for the asking...

?ÿ


 
Posted : July 4, 2019 1:00 am
ekillo
(@ekillo)
Posts: 559
Member
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
 

Jim,

I would like to get a copy of your program, I am working on a project for the next few months that I will be having to convert several hundred points.

Thanks,

Ed


 
Posted : July 4, 2019 1:27 am
mathteacher
(@mathteacher)
Posts: 2243
Member
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
 

You probably won't encounter any negative angles, but, if you do, the INT function will lead you astray. While INT(10.6) = 10, INT(-10.6) = -11. That's because the integer function selects the?ÿnext lowest integer, and -11 is lower than -10.?ÿ?ÿ

Using the truncate function solves that problem.


 
Posted : July 4, 2019 10:01 am
field-dog
(@field-dog)
Posts: 1543
Member
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
 

I'd like it, please.


 
Posted : July 4, 2019 10:15 am
loyal
(@loyal)
Posts: 3735
Member
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
 
Posted by: MathTeacher

You probably won't encounter any negative angles, but, if you do, the INT function will lead you astray. While INT(10.6) = 10, INT(-10.6) = -11. That's because the integer function selects the?ÿnext lowest integer, and -11 is lower than -10.?ÿ?ÿ

Using the truncate function solves that problem.

I know NOTHING about EXCELL (or any other such program, I never had any use for them), but wouldn't a negative Longitude (North America for example) be an issue as well?

Loyal


 
Posted : July 4, 2019 10:27 am

field-dog
(@field-dog)
Posts: 1543
Member
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
 

What is the source of your several hundred points in decimal degrees? Maybe Excel isn't the best solution for you.


 
Posted : July 4, 2019 10:29 am
mathteacher
(@mathteacher)
Posts: 2243
Member
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
 

Yes, as would negative convergence angles, which is where I was reunited with the problem. Back in my old Fortran days, we had a rounding subroutine from IBM called ROCSP. Lo and behold, it couldn't consistently round negative numbers correctly, so we wrote our own.

We also have to be careful about adding and subtracting decimal parts in these conversions as well.


 
Posted : July 4, 2019 11:37 am
ekillo
(@ekillo)
Posts: 559
Member
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
 

You are probably right, but I was sent an Excell file with a list of points in decimal degrees that I needed to locate, I know I could have gotten by not converting them, but I am old school and think in DMS.


 
Posted : July 4, 2019 8:41 pm