@Vinayak - you can create this stepwise in Typeform’s logic rules and some ‘sub-total’ variables but is has some restrictions due to the number of decimal places that Typeform will show ( @Liz - i think it is still limited to 2 decimals, correct?)
create something like these variables
- sub_a numeric default = 0
- sub_c numeric default = 0
- sub_calc_1 numeric default = 1025
- v_total
logic rules something like this (your variables referred to by simple letters):
- If A greater than 0 add A to sub_a
- if C greater than 0 add C to sub_c
- ((variable A-Variable B)*0.9)
- if B greater than or equal 0 then subtract B from sub_a
- if A greater than 0 multiply sub_a by 9
- if A greater than 0 divide sub_a by 10 (this one and the one above are necessary since you can’t input a decimal number, only whole numbers - but this gives you the *.9 result)
- if A greater than 0 add sub_a to v_total
-
- note: typeform only handles 2 decimal places so your 0.025 so you might have to consider either starting with 1025 and eventually divide by 1000 or just deal the fact that you are not going to get to the 3 decimal accuracy inside typeform
- ((1+0.025)/(Variable c-variable d))
- same as 1025/ ((Variable c-variable d)*1000)
- if C greater than 0 add C to sub_c
- if D greater than or equal 0 then subtract C from sub_c
- if C greater than 0 then multiply sub_c by 1000
- (since we set sub_calc_1 to 1025)
- if C greater than 0 then divide sub_calc_1 by sub_c
- if C greater than 0 then multiply v_total by sub_calc_1
- if A greater than 0 then multiply v_total by 25
that should do the trick .. BUT remember that your output will only be to 2 decimals in Typeform
if you push this all to a google sheet you could do the calculation as a formula there..
hope this makes sense..
des