Article ID: 121944 - Last Review: October 11, 2006 - Revision: 2.3 Custom Function to Express Degree to/from as Fractions of DegreesThis article was previously published under Q121944 On This PageSUMMARY
Fractions of a degree are commonly expressed in units called minutes and
seconds. One degree is equivalent to 60 minutes, and similarly, one minute
equals 60 seconds. These units are most commonly used for expressing a
navigational point such as a point on a nautical chart.
Although Microsoft Excel lacks a built-in number format to express these terms, this article contains a sample custom function you can use to convert a degree value (stored in decimal format, or base 10) to degrees, minutes, and seconds (stored in text format). Also, this article contains a user-defined function that converts degrees, minutes, and seconds (stored in text format) to a degree value (stored in decimal format). MORE INFORMATIONMicrosoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements. Converting Decimal Degrees to Degrees/Minutes/SecondsThe following Microsoft Visual Basic for Applications custom function accepts an angle formatted as a decimal value and convert it to a text value displayed in degrees, minutes, and seconds.Converting Degrees/Minutes/Seconds to Decimal DegreesThe following Microsoft Visual Basic for Applications custom function accepts a text string of degrees, minutes and seconds formatted in the exact same format that the Convert_Degree function returns (for example, 10~ 27' 36") and converts it to an angle formatted as a decimal value. This is exactly the reverse of the Convert_Degree custom function.WARNING: This custom function fails if the Degree_Deg argument does not follow the format of the following: NOTE: You are required to type three quotation marks (""") at the end of argument of this formula to balance the quotation mark for the seconds and the quotation mark for the text string. REFERENCES
For additional information about getting help with Visual Basic for
Applications, please see the following article in the Microsoft Knowledge
Base:
163435
(http://support.microsoft.com/kb/163435/EN-US/
)
VBA: Programming Resources for Visual Basic for Applications
APPLIES TO
| Article Translations
|

Back to the top
