How to create a calculation on form with specific rules to be followed