Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a Text Object with an expression in the Text that produces a percentage based on user selections. I have two selections that I need to test for and each test will use a different set of variables to calculate that percentage. How can I write the expression to best return the result I am looking for? Here are the IF statements listed out on their own that I am looking to combine into one large expression.
=If((vFlag) = 'Yes' and Division = 'A', vProjAFYSavings, vFYASavings)
=If((vFlag) = 'Yes' and Division <> 'A', vProjFYSavings, vFYSavings)
=If((vFlag) = 'No' and Division = 'A', vFYASavings, vFYASavings)
=If((vFlag) = 'No' and Division <> 'A', vProjFYSavings, vFYSavings)
Assuming Flag can either be Yes or No:
=If(Flag = 'Yes',
If(Division ='A',vProjAFYSavings, vProjFYSavings),
If(Division = 'A', vFYASavings, vProjFYSavings)
)
Not sure if these can be combined at all.
For example, If Division <> 'A' and vFlag = 'No', the second expression will return vFYSavings, while the fourth vPrjFYSavings.
In general, you can use nested if() statements like
=If( ConditionA, Then1, If( ConditionB, Then2, If(Condition3, Then 3, Else1)))
or
=If(ConditionA, If(ConditionB, Then1, Else1), Else2)
etc.
Yes, agreed. Could you show me how to nest these IF statements?
Assuming Flag can either be Yes or No:
=If(Flag = 'Yes',
If(Division ='A',vProjAFYSavings, vProjFYSavings),
If(Division = 'A', vFYASavings, vProjFYSavings)
)