Forum Discussion
Angles
- Mar 15, 2022
Are you sure that you copied and edited the formula correctly?
For cells in which you enter a value such as 30.30.3: either format the cells as text before entering data, or prefix the values with an apostrophe ' to force Excel to treat them as text.
I have attached a sample workbook with two VBA functions: DMS2Dec and Dec2DMS. You can view them by pressing Alt+F11.
(Remark: VBA only works in the desktop version of Excel for Windows or Mac OSX, not in Excel for Android or iOS, nor in the online/browser version of Excel)
The workbook is a macro-enabled workbook (.xlsm), so you'll have to allow macros when you open it.
No .... I would like to decimalize an angle ie: 30 degrees 30 minutes 30 seconds = 30.50833336
and then do it backwards ie: 30.50833336 = 30.30.30
- JohnTheFishermanMar 15, 2022Copper ContributorI found this page:
https://blog.batchgeo.com/convert-latitude-longitude-to-decimals-excel/#:~:text=%3DDegree%2BMinute%2F60%2BSecond%2F3600&text=Add%20a%20heading%20(such%20as,the%20rest%20of%20the%20column
It seems to answer your question hopefully- OvertimeMar 15, 2022Copper ContributorThanks for that.
That's how I've been doing it, I was hoping for an easier answer maybe a function or formulae embedded in excel ..... but thanks for your help- HansVogelaarMar 15, 2022MVP
With a text value such as 30.30.30 in A2, the formula
=LET(first,FIND(".",A2),second,FIND(".",A2,first+1),LEFT(A2,first-1)+MID(A2,first+1,second-first-1)/60+MID(A2,second+1,2)/3600)
will return the decimal equivalent.
The other way round, with 30.50833333 in C2, the formula
=INT(C2)&"."&INT(60*MOD(C2,1))&"."&INT(60*MOD(60*C2,1))
will return the text value 30.30.30
It would be relatively easy to modify the formulas for the format 30°30'30"
And if you prefer, you could create custom VBA functions.