Cognito-forms – “If then” calculations based on value

cognito-forms

I have about a dozen tables in a new form that is working perfectly. Tables may contain positive or negative adjustments to static numbers. I need a field to calculate all of the fields that contain negative adjustments and another for positive adjustments.

I imagine some sort of "if then" statement will do this but I am not sure where to start.

Something like this maybe:

=if ChangeAmount <= 0 then ADD 

Best Answer

I'm a developer with Cognito Forms.

You can set up a calculation that will add/sum all of your number feilds. You can use the following calculation to help set this up. In my example the Table field is labeled as 'Table' and the Number field is labeled as 'Number'. You will have to target each field individualy and then add them together.

=Table.Sum(Number)

If you have several different Number fields in the same table field they can all be added in the same parentheses set.

=Table.Sum(Number + Number2)

You can also have two numbers in two different tables summed and then added together.

=Table.Sum(Number) + Table2.Sum(Number)

We do have more Help Content on setting this up in our Calculations Overview section.