Modified ACOS function
It isn't entirely clear what your formula is trying to do. From 0 to 180
degrees it seems to convert your X and Y into an angle in the correct
quadrant, but beyond 180 degrees it is doing something very different.
I wonder whether =MOD(DEGREES(ATAN2(A2,B2)),360) might be what you are
trying to achieve?
--
David Biddulph
"danpt" wrote in message
...
I want to modified ACOS function to display in degrees reflecting to its
quartrant.
Is there another simpler formula to replace then one I have in cell(D2)?
Sub worksample()
Range("A1") = "X"
Range("B1") = "Y"
Range("C1") = "deg"
Range("D1") = "mod. ACOS"
Range("A2") = -1
Range("B2") = -1
Range("C2") = "=DEGREES(ACOS(A2/(A2^2+B2^2)^0.5))"
Range("D2") =
"=MOD(IF(B2=0,360,IF(A20,270,IF(A2<0,90,180)))+D EGREES(ACOS(A2/(A2^2+B2^2)^0.5)),360)"
End Sub
|