You are viewing limited content. For full access, please sign in.

Question

Question

Perform Calculation IF

asked on May 6, 2019

Looking for a little guidance with formulas. 

I have a table where I only want the formula of a particular column to be run if a checkbox is checked (from another column). 

The formula less the IF logic looks like this...

=PRODUCT(INDEX(Test.Soft__Total,ROW()),INDEX(Test.Tax_Rate,ROW()))

The IF logic would be dictated based upon a checkbox field called Taxable having been checked with the value Software

If it's not checked, then I wouldn't want it to run the formula. 

Can someone tell me what my formula would look like? I have been having a hard time with this one. 

Thanks! 

0 0

Answer

SELECTED ANSWER
replied on May 6, 2019

You need to wrap INDEX(Test.Taxable_.Software,ROW()) in TEXT()

and compare it to "TRUE" or "FALSE"

Like so,

=IF(TEXT(INDEX(Test.Taxable_.Software,ROW()))="TRUE",PRODUCT(INDEX(Test.Soft__Total,ROW()),INDEX(Test.Tax_Rate,ROW()))

Checkbox variables don't return the underlying value, they return a true/false for checked/unchecked.

For example, if Software is checked

INDEX(Test.Taxable_.Software,ROW()) = TRUE not "Software"

Functions don't work with the "raw" boolean, which is where the TEXT() = "TRUE" portion comes into play.

1 0

Replies

replied on May 6, 2019

The format would be something like,

=IF(TEXT(Checkbox.Value)="TRUE","Calculation","Default")

Just replace "Checkbox.Value" with your actual variables by clicking the > button, expanding the checkbox variable, and selecting the specific option you're using for the evaluation.

Replace "Calculation" with your other formula, and put whatever value you want in place of the "Default" portion.

This may be a bit different if the checkbox is part of a table/collection, but in that case you would just use Index on the variable.

 

Although Checkbox.Value returns a boolean (true for checked, false for unchecked), the formulas do not seem to accept them, so as a workaround the TEXT() function converts it to a string and compares that value to "TRUE" as plain text.

0 0
replied on May 6, 2019

I'm not sure I have this right... here is some context. 

=IF(INDEX(Test.Taxable_.Software,ROW())="Software",PRODUCT(INDEX(Test.Soft__Total,ROW()),INDEX(Test.Tax_Rate,ROW()))

 

 

0 0
SELECTED ANSWER
replied on May 6, 2019

You need to wrap INDEX(Test.Taxable_.Software,ROW()) in TEXT()

and compare it to "TRUE" or "FALSE"

Like so,

=IF(TEXT(INDEX(Test.Taxable_.Software,ROW()))="TRUE",PRODUCT(INDEX(Test.Soft__Total,ROW()),INDEX(Test.Tax_Rate,ROW()))

Checkbox variables don't return the underlying value, they return a true/false for checked/unchecked.

For example, if Software is checked

INDEX(Test.Taxable_.Software,ROW()) = TRUE not "Software"

Functions don't work with the "raw" boolean, which is where the TEXT() = "TRUE" portion comes into play.

1 0
You are not allowed to follow up in this post.

Sign in to reply to this post.