We want to create a formula to calculate the value of a field under the following conditions:

"If the value of the field with ID=23 is = to 2 months, then increase the value of the field with ID 24 by 10% and divide by 2, if the value of the field with ID=23 is = to 3 months, then increase the value of the field with ID 24 by 10% and divide by 3, and so… "

We have entered the following formula in a field and it does not work for us, could you tell us how should be the structure of the formula?

if( rgar( $form_data, ‘23’ ) == ‘2 meses’,

( rgar( $form_data, ‘24’ ) * 1.1 ) / 2,

if( rgar( $form_data, ‘23’ ) == ‘3 meses’,

( rgar( $form_data, ‘24’ ) * 1.1 ) / 3,

if( rgar( $form_data, ‘23’ ) == ‘4 meses’,

( rgar( $form_data, ‘24’ ) * 1.15 ) / 4,

rgar( $form_data, ‘24’ )

)

)

Thank you in advance!