IF Then Formula with Yes/No parameters reporting text

IF Then Formula with Yes/No parameters reporting text

Anonymous
Not applicable
591 Views
2 Replies
Message 1 of 3

IF Then Formula with Yes/No parameters reporting text

Anonymous
Not applicable

I need some help! I am trying to make an IF THEN formula and everything looks right, but I keep getting the Bad IF-Statement format error. I think the problem is with the Nested Formula formatting.

I am trying to state the following:

  1. If FinEnd_Side_l is clicked then I want this parameter to report an "L"

  2. If FinEnd_Side_ll is clicked then I want this parameter to report an "R"

  3. If both FinEnd_Side l and FinEnd_Side ll are clicked I want this parameter to report a "B"

  4. If neither are clicked this parameter can remain empty.

Here is the formula I have written which gives the error:

 

if((and(FinEnd_Side_l, (not(FinEnd_Side_ll)))), "L", " ", if((and(FinEnd_Side_ll, (not(FinEnd_Side_l)))), "R", " ", if((and(FinEnd_Side_ll, FinEnd_Side_l)), "B", " ", if((not(FinEnd_Side_ll, FinEnd_Side_l)), " ", " " ))))

 

Can anyone help?

Thanks!

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

L.Maas
Mentor
Mentor
Accepted solution

This should do it.

if(and(FinEnd_Side_l, FinEnd_Side_ll), "B", if(FinEnd_Side_l, "L", if(FinEnd_Side_ll, "R", "")))

 

You do not have to keep checking with all the and/nots. If a true is found then the formula stops and comes with the result.

Because I already checked if both are true then I only have to look if one is true to come to a conclusion if it should be L or R. I often build these formulas in something like notepad. You have a better overview of your longer formulas

Louis

EESignature

Please mention Revit version, especially when uploading Revit files.

0 Likes
Message 3 of 3

Anonymous
Not applicable

Thank you. Your response is very appreciated.

0 Likes