Having problems with ACOS worksheet function, when I use the ACOS function is gives me #Name? error. I have the MSowcf.dll file referenced but still did not work. I found another Code which uses the ArcCos function but it returns the wrong value. The code for the ArcCos function is as Follows:
Function ArcCos(X As Double) As Double
' Inverse Cosine
If X = 1 Then
ArcCos = 0
ElseIf X = -1 Then
ArcCos = -PI()
Else
ArcCos = Atn(X / Sqr(-X * X + 1)) + PI() / 2
End If
End Function
but the result is not correct in radians or degrees.
thanks in advance
Function ArcCos(X As Double) As Double
' Inverse Cosine
If X = 1 Then
ArcCos = 0
ElseIf X = -1 Then
ArcCos = -PI()
Else
ArcCos = Atn(X / Sqr(-X * X + 1)) + PI() / 2
End If
End Function
but the result is not correct in radians or degrees.
thanks in advance