Discussion Locked

How to convert 30.75 in 30?34'30

0 helpful
15 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

To resolve problems in trigonometry.
Until now I resolve Cos, Sin, Tan, Air Cos, Air Sin and Air Tan but to converted results from 48.270/5.33=9.056285178 I don't find out how to convert this on 9?3'22.6266" How I have to do to get it?

15 replies

by the ice man

This looks like your converting decimal degrees into DMS (degrees, minutes, seconds) and it a very straight forward process.

To convert 9.056285178 decimal degrees into DMS first subtract the 9, then mulitple the result .056285178 by 60 to get your minutes, 3.37711068. Once you have the minutes subtract that value (the 3) and multiple by 60 again to get your seconds .37711068 * 60 = 22.6266.

You now have the three pieces you need for your DMS value, the 9, the 3 and 22.6266 putting them in order 9?3'22.6266".

If you need to proof it then reverse process and divide by 60 for the 2 steps. It will be off a little bit due to rounding.

by aaasantacruz

Thanks Ice Man
Your answer is logic; but when A1 is #.decimals I want to find a magic formul in A2 that give me as an answer DD?mm'ss.ss" in one cel; without so many calculs to do in diferents cels.
For sample in Sin of A1(30) I find "=sin(radians(a1))" and I get .5; that is what I looking for.
Thanks

by tony hopkinson

0.5 is the sine it's not an angle, expressing it in DMS is meaningless.

If you calculate a sine from the lengths the triangle and then take it's inverse (arcsin) then you get the angle that would subtend a triangle with those two lenghts.

If you want to display a decimal number as DMS.s and put it in one cell as a label in that format, it's doable but longwinded. Personally I'd work out the intermediates in other columns and do the string conversion last, then hide the working out columns.
Or you could write functions to work out the intermediates and then chain them together.
B1 = DegreesOf(A1) + '?' + MinutesOf(A1) + '.' ... etc.
Doing it all in one cell is possible but I wouldn't recommend it, you'll spend twenty days looking for missing parentheses ,and when you are done it will be unbelievably inefficient.

by aaasantacruz

I create in Format-cell-Custom "dd?00'ss.0"; Excel 2003 of course but this is giving me for
1.5 1?0:0.0 1.55 1?12:0.0
1.6 1?24:0.0 1.66 1?50:24.0
1.74 1?45:36.0 1.75 1?0:0.0
15.25 15?0:0.0 15.5 15?0:0.0
15.75 15?0:0.0 15.99 15?45:36.0
119.99 28?45:36.0 59.99 28?45:36.0
I get crazy trying to find out why.

by the ice man

I believe this link will provide you the information you need to have it done automatically without having to create a custom formatting. The site gives the information for converting from decimail to DMS and from DMS to decimal. Just make sure your back on one of your worksheets when entering the data.

http://support.microsoft.com/?kbid=213449

by danmcphail

G'day Mate

I have trying to work out if it is possible to convert input data (dms) to decimal. Where the input data doesn't display any symbols (ie. ? ' ").

eg: 25.3512(dms) = 25.5867(decimal)

Cheers, Dan

by aaasantacruz

Your programs are very good, but I was looking to save the time to copy to excel.
There is a link that provide me all the information I need to have it done automatically without having to create a custom formatting. The site gives me the information for converting from decimail to DMS and from DMS to decimal.
http://support.microsoft.com/?kbid=213449
Thanks to IceMan.
And Thanks to you for your implication.

by aaasantacruz

Good, very good, This is wonderful.
This save me a lot of time and hearikkkkk.
A little macro and that's it.
Thank you very much to you.
Ice Man U the best, keeping like that.
Thanks again

by aaasantacruz

Good, very good, This is wonderful.
This save me a lot of time and hearikkkkk.
A little macro and that's it.
Thank you very much to you.
Ice Man U the best, keeping like that.
Thanks again

by aaasantacruz

There is a link that provide me all the information I need to have it done automatically without having to create a custom formatting. The site gives me the information for converting from decimail to DMS and from DMS to decimal.
http://support.microsoft.com/?kbid=213449
Thanks Tony I hope this helps you too in your programing career.

by eddie n

...have you spent 20 years converting from DMS to decimal degrees and back? :)

But seriously, sometimes in a bid to shorten code as much as possible we introduce unneeded complexity. I agree with you (and from the evidence pf that KB article, so do MSFT) that doing each step on a line of its own makes the coding less error-prone, especially in this case.

by tony hopkinson

before google was invented, so it took a while.
LOL

Hunt the parentheses is a great game isn't it. Especially when there's three missing, and operator precedence comes in to play.

This discussion is closed to new replies.