Converting a Decimal Degree Value to Degrees, Minutes, Seconds

Article translations Article translations
Article ID: 73023 - View products that this article applies to.
This article was previously published under Q73023
Expand all | Collapse all

SUMMARY

This article provides a sample Microsoft Excel macro type (XLM) to convert a degree value stored in decimal format (base 10) to degrees, minutes, and seconds as text. Microsoft Excel does not provide a number format to do this.

MORE INFORMATION

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 with nautical charts and navigation.

Microsoft 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. The following function macro will accept an angle formatted as a decimal number and convert it to degrees, minutes, and seconds as text.
   A1:     Convert_Degree
   A2:     =ARGUMENT("Decimal_Deg")
   A3:     =RESULT(2)
   A4:     Degrees=INT(Decimal_Deg)
   A5:     Minutes=(Decimal_Deg-Degrees)*60
   A6:     Seconds=ROUND((Minutes-INT(Minutes))*60,0)
   A7:     =RETURN(Degrees&"~ "&INT(Minutes)&"' "&Seconds&"""")
				
For example, entering =Convert_Degree(10.46) into a worksheet returns 10~ 27' 36" (10 degrees, 27 minutes, 36 seconds).

REFERENCES

"User's Guide," version 4.0, pages 210-211

"User's Guide," version 3.0, pages 574-75

Properties

Article ID: 73023 - Last Review: November 16, 2006 - Revision: 2.4
APPLIES TO
  • Microsoft Excel 95 Standard Edition
  • Microsoft Excel 5.0c
  • Microsoft Excel 4.0a
  • Microsoft Excel 5.0 Standard Edition
  • Microsoft Excel 5.0a for Macintosh
  • Microsoft Excel 4.0 for Macintosh
  • Microsoft Excel 3.0a for Macintosh
Keywords: 
kbhowto KB73023
Retired KB Content Disclaimer
This article was written about products for which Microsoft no longer offers support. Therefore, this article is offered "as is" and will no longer be updated.

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com