2 Replies Latest reply on Sep 2, 2014 9:11 AM by Josh Brady

# How do you nest an if Equation.

How do you nest an if Equation for Example will this work =if(overall height<=2500,2 if(overall height<=3500,3,4)) basically i am looking the answer to come out as if the height is less than 2500mm the ANS=2 if it is less than 3500mm but Greater than 2500mm the ANS=3 and then for any Height Greater than 3500mm the ANS=4. Please Help or is there any other Way of getting the some outcome Thanks.

• ###### Re: How do you nest an if Equation.

Hi Josh,

I would use an IIF function for that

This works for me :

if H > 2500 ANS get 2 else we enter another iif which gives 4 if H > 3500, else it gives 3

Have fun with SolidWorks!

Eddy

• ###### Re: How do you nest an if Equation.

I would also add that you may want to avoid using "=" as part of your comparison.  At one time, SW would not even accept an equation that contained "=" as part of a comparison.  I think '14 or '15 started allowing them, but I would still recommend structuring your comparisons such that you can avoid using the "=" if possible.