Can trig functions be used inside an IF function?

WendyBass
Community Member
  • I'm creating an IF function and I have several others that I know work -  such as if(b+c<a,0,if(a+b<c,0,if(a+c<b,0,1))) can be used to determine if 3 given numbers create a triangle - so I know my general process is correct.
  • My new formula determines the angle measure in a triangle plus an original bearing angle and I've verified that it works: (acos((((((a*h)^2+(b*h)^2-(2*(a*h)*(b*h)*cos(deg_to_rad(x+y))))^.5)^2+(b*h)^2-(a*h)^2)/(2*b*h*(((a*h)^2+(b*h)^2-(2*(a*h)*(b*h)*cos(deg_to_rad(x+y))))^.5))))*(180/pi))+b 
  • The problem occurs when I try to put this new formula INTO the IF function.
  • For example, let's call the crazy formula above X. I want the IF function to be if(X>90,1,2) but I get an "invalid formula" error when I insert the crazy formula in for X. It doesn't seem to matter if I put parenthesis around it or not. 
  • Is the problem the trig function inside the IF function or am I doing something else wrong?
0 Likes