# Working with If else on calculation

Hi guys,

I got this problem that i came across but can't seem to find a smart way to solve. I want to calculate the final result (rounded off number) which is dependent on the d_avg.

1. If the \${d_avg} = 0, that means a user enters 0 through out the form fields (n,e,w,s) then this results to 0.
2. If user got \${d_avg} greater than 0 and less than 1, this should result to 1.
3. else the remaining calculations should fall back to current working formula.

Know how i should go about with this and play with if else statements in calculate. I've looked around the mailing list and can't seem to see any good previous examples.

Please find both the .xls and .xml files attached.

Thanks,

Richard

simple_center.xls (8 KB)

simple_center.xml (2.44 KB)

Apologies, attached slightly different file. Please use these ones attached here .

simple_center.xls (8.5 KB)

simple_center.xml (2.58 KB)

··· On Wednesday, May 21, 2014 6:59:33 PM UTC+3, nga...@gmail.com wrote: > Hi guys, > > I got this problem that i came across but can't seem to find a smart way to solve. I want to calculate the final result (rounded off number) which is dependent on the d_avg. > 1. If the \${d_avg} = 0, that means a user enters 0 through out the form fields (n,e,w,s) then this results to 0. > 2. If user got \${d_avg} greater than 0 and less than 1, this should result to 1. > 3. else the remaining calculations should fall back to current working formula. > > Know how i should go about with this and play with if else statements in calculate. I've looked around the mailing list and can't seem to see any good previous examples. > > Please find both the .xls and .xml files attached. > > Thanks, > > Richard

Fixed it to achieve what i wanted in a dirty way but works for. Find final attached. Hope helps someone someday :).

simple_center.xls (8.5 KB)

··· On Wednesday, May 21, 2014 8:05:05 PM UTC+3, nga...@gmail.com wrote: > Apologies, attached slightly different file. Please use these ones attached here . > On Wednesday, May 21, 2014 6:59:33 PM UTC+3, nga...@gmail.com wrote: > > Hi guys, > > > > I got this problem that i came across but can't seem to find a smart way to solve. I want to calculate the final result (rounded off number) which is dependent on the d_avg. > > 1. If the \${d_avg} = 0, that means a user enters 0 through out the form fields (n,e,w,s) then this results to 0. > > 2. If user got \${d_avg} greater than 0 and less than 1, this should result to 1. > > 3. else the remaining calculations should fall back to current working formula. > > > > Know how i should go about with this and play with if else statements in calculate. I've looked around the mailing list and can't seem to see any good previous examples. > > > > Please find both the .xls and .xml files attached. > > > > Thanks, > > > > Richard