乔山办公网我们一直在努力
您的位置:乔山办公网 > excel表格制作 > 怎样在excel直接输入度分秒,并且能够识别和计算?-excel怎么输入分秒,电子表格如何录入分秒

怎样在excel直接输入度分秒,并且能够识别和计算?-excel怎么输入分秒,电子表格如何录入分秒

作者:乔山办公网日期:

返回目录:excel表格制作


用这个VBA代码,能实现你说的
MicroSoft FAQ

Converting Decimal Degrees to Degrees/Minutes/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 & "°e68a84e799bee5baa6e997aee7ad94365 " & Int(Minutes) & "\' " _
& Seconds + Chr(34)
End With
End Function

Example:
A1 =10.6
B1 = Convert_Degree(A1)

Converting Degrees/Minutes/Seconds to Decimal Degrees

Function Convert_Decimal(Degree_Deg As String) As Double
\' Declare the variables to be double precision floating-point.
Dim degrees As Double
Dim minutes As Double
Dim seconds As Double
\' Set degree to value before "°" of Argument Passed.
degrees = Val(Left(Degree_Deg, InStr(1, Degree_Deg, "°") - 1))
\' Set minutes to the value between the "°" and the "\'"
\' of the text string for the variable Degree_Deg divided by
\' 60. The Val function converts the text string to a number.
minutes = Val(Mid(Degree_Deg, InStr(1, Degree_Deg, "°") + 2, _
InStr(1, Degree_Deg, "\'") - InStr(1, Degree_Deg, _
"°") - 2)) / 60
\' Set seconds to the number to the right of "\'" that is
\' converted to a value and then divided by 3600.
seconds = Val(Mid(Degree_Deg, InStr(1, Degree_Deg, "\'") + _
2, Len(Degree_Deg) - InStr(1, Degree_Deg, "\'") - 2)) _
/ 3600
Convert_Decimal = degrees + minutes + seconds
End Function

Example:
=Convert_Decimal("10° 27\' 36""")



拒躲则赔充瓜效贩抓ggu

excel输入度分秒并可以计算的具体步骤如下:

需要准备的材料分别是:电脑、Excel表格。

1、首先打开要编辑的Excel表格,选中需要设置的单元格。

2、然后右键单击单元格选择打开“设置单元格格式”。

3、然后在弹出来的窗口中点击选择数字中的“自定义”。

4、然后在弹出来的窗口中点击类型输入:[h]°m’s”,回车确定。

5、然后就得到可以计算的度分秒了。

相关阅读

关键词不能为空
极力推荐
  • 如何在<em>wps</em>表格中使用<em>函数</em>-wps

  • 1、首先百,我们打开我们电脑上面的wps表格,然后我们在里面输入一些数字,如图所示;度2、之后,我内们选中图示中的单元格,然后我们点击公式;3、然后我们点击自动求和的下拉

ppt怎么做_excel表格制作_office365_word文档_365办公网