Formula chaining IFs and ANDS

Formula chaining IFs and ANDS

dwackerX6C3B
Explorer Explorer
280 Views
3 Replies
Message 1 of 4

Formula chaining IFs and ANDS

dwackerX6C3B
Explorer
Explorer

Hello Everyone,

 

I have a text parameter I'm trying to manipulate using formulas. However, I'm having some struggles.

 

What I am trying to accomplish, simplified, is:

If Height < 38" and Depth < 24" = "LE1"

If Height > 38" and Depth < 24" = "LE2"

If Height > 38" and Depth > 24" = "LE3"

 

I attempted this by using the following formulas:

IF ( AND (Depth < 2’, Height < 3’ 2”), “LE1”, (IF ( AND (Depth < 2’, Height > 3’ 2”), “LE2”, “LE3”)))

&

IF (Depth < 2', "LE2", IF (AND (Depth < 2’, Height <3’ 2”), “LE1”, “LE3”))

 

Neither of these worked for me and I am unsure why. 

 

Thank you for any help you can provide!

0 Likes
Accepted solutions (1)
281 Views
3 Replies
Replies (3)
Message 2 of 4

RDAOU
Mentor
Mentor
Accepted solution

 

 

With double double you are missing conditions

  • Height < 38" and Depth > 24"
  • Height =38 and Depth=24
  • Height = 38 and Depth < 24
  • Height = 38 and Depth > 24
  • Height > 38 and Depth = 24
  • Height < 38 and Depth = 24

What happens when the  condition one of the above? Assuming they would included under any other value than the defined, which would be LE4, the statement would look as follows

 

if(and(Depth < 24", Height < 38"), "LE1", if(and(Depth < 24", Height > 38"), "LE2", if(and(Depth > 24", Height > 38"), "LE3", "LE4")))

 

 

if(and(Depth < 24", Height < 38"), "LE1", if(and(Depth < 24", Height > 38"), "LE2", if(and(Depth > 24", Height > 38"), "LE3", "LE4")))

 

 

 

The question remains...What would you wish that text to be  for the other conditions when ...the above includes it as others value as set LE4. YOu might need to add some ORs in there or additional IFs

 

 

 

YOUTUBE | BIM | COMPUTATIONAL DESIGN | PARAMETRIC DESIGN | GENERATIVE DESIGN | VISUAL PROGRAMMING
If you find this reply helpful kindly hit the LIKE BUTTON and if applicable please ACCEPT AS SOLUTION


0 Likes
Message 3 of 4

dwackerX6C3B
Explorer
Explorer

That would be "LE2" also.

 

So something along the lines of this? 

 

IF ( AND (Depth < 2’, Height < 3’ 2”), “LE1”, (IF ( AND (Depth < 2’, Height > 3’ 2”), “LE2”, (IF ( AND (Depth > 2’, Height < 3’ 2”), “LE2”, “LE3”))))

 

REVIT still doesn't like it, stating "The following is not a valid parameter: 2'"

0 Likes
Message 4 of 4

RDAOU
Mentor
Mentor

@dwackerX6C3B 

 

change units to inch instead feet & inch...  and paste the following

 

if(and(Depth < 24", Height < 38"), "LE1", if(or(and(Depth < 24", Height > 38"), and(Depth > 2", Height < 38")), "LE2", if(and(Depth > 24", Height > 38"), "LE3", "LE4")))

 

Unless you want to include them under LE1, LE2 and LE3 the above accounts for the remaining conditions as other LE4

  • Height =38 and Depth=24
  • Height = 38 and Depth < 24
  • Height = 38 and Depth > 24
  • Height > 38 and Depth = 24
  • Height < 38 and Depth = 24

 

 

 

if(and(Depth < 24", Height < 38"), "LE1", if(or(and(Depth < 24", Height > 38"), and(Depth > 2", Height < 38")), "LE2", if(and(Depth > 24", Height > 38"), "LE3", "LE4")))

 

 

 

 

 

 

YOUTUBE | BIM | COMPUTATIONAL DESIGN | PARAMETRIC DESIGN | GENERATIVE DESIGN | VISUAL PROGRAMMING
If you find this reply helpful kindly hit the LIKE BUTTON and if applicable please ACCEPT AS SOLUTION


0 Likes