Support » Plugin: Calculated Fields Form » Are nested IF supported?

• Resolved mhdskr

(@mhdskr)

Dear Developer,
I copied a working function from an excel sheet and replaced the cell IDs by the corresponding fieldnames to get the following nested IF functions:

`IF(fieldname3=0.5,IF(fieldname10<701,65,IF(fieldname10<1001,130,IF(fieldname10<2001,140,IF(fieldname10<3001,150,IF(fieldname10<4001,170,IF(fieldname10<5001,190,IF(fieldname10<6001,200,0))))))),IF(fieldname3=1,IF(fieldname10<701,65,IF(fieldname10<1001,130,IF(fieldname10<2001,140,IF(fieldname10<3001,150,IF(fieldname10<4001,170,IF(fieldname10<5001,190,IF(fieldname10<6001,200,0))))))),IF(fieldname3=1.5,IF(fieldname10<701,"loan n/a",IF(fieldname10<1001,150,IF(fieldname10<2001,160,IF(fieldname10<3001,170,IF(fieldname10<4001,190,IF(fieldname10<5001,200,IF(fieldname10<6001,210,0))))))),IF(fieldname3=2,IF(fieldname10<701,"loan n/a",IF(fieldname10<1001,170,IF(fieldname10<2001,180,IF(fieldname10<3001,190,IF(fieldname10<4001,210,IF(fieldname10<5001,220,IF(fieldname10<6001,240,0))))))),IF(fieldname3=2.5,IF(fieldname10<701,"loan n/a",IF(fieldname10<1001,"loan n/a",IF(fieldname10<2001,"loan n/a",IF(fieldname10<3001,230,IF(fieldname10<4001,250,IF(fieldname10<5001,260,IF(fieldname10<6001,300,0))))))),IF(fieldname3=3,IF(fieldname10<701,"loan n/a",IF(fieldname10<1001,"loan n/a",IF(fieldname10<2001,"loan n/a",IF(fieldname10<3001,230,IF(fieldname10<4001,250,IF(fieldname10<5001,260,IF(fieldname10<6001,300,0))))))),IF(fieldname3=3.5,IF(fieldname10<701,"loan n/a",IF(fieldname10<1001,"loan n/a",IF(fieldname10<2001,"loan n/a",IF(fieldname10<3001,270,IF(fieldname10<4001,290,IF(fieldname10<5001,280,IF(fieldname10<6001,320,0))))))),IF(fieldname3=4,IF(fieldname10<701,"loan n/a",IF(fieldname10<1001,"loan n/a",IF(fieldname10<2001,"loan n/a",IF(fieldname10<3001,270,IF(fieldname10<4001,290,IF(fieldname10<5001,280,IF(fieldname10<6001,320,0)))))))))))))))`

[Moderator note: code fixed. Please wrap code in the backtick character or use the code button.]

the Calculated Field doesn’t display anything when I input values in fieldname3 and fieldname10. What is wrong? Are nested if functions not supported?

Thank you,

• This topic was modified 3 years, 6 months ago by bdbrown.
Viewing 2 replies - 1 through 2 (of 2 total)
• Plugin Author codepeople

(@codepeople)

Hello @mhdskr,

I’ve no checked the number of open and close parentheses, however, there are errors in some of conditions, in javascript the logical operator for equality is double symbol: “==” because the symbol: “=” is used for assignment, please, fix the equality: `fieldname3=0.5` as `fieldname3==0.5` (the same issue is present in many other conditions)

Best regards.

mhdskr

(@mhdskr)

Thank you very much @codepeople, that solved it!

Viewing 2 replies - 1 through 2 (of 2 total)
• The topic ‘Are nested IF supported?’ is closed to new replies.