# Blog

## Using conditions in your calculations

Posted by:

You are here:
• Using conditions in your calculations

You can also do conditions in your formulas using this format:

if( condition) //Price or calculation that you want to use

So for example, lets say that you have a drop down called “Subscription type” with two options “Yearly Subscription” and “Monthly Subscription”

With the annual subscription you give a 20% discount, so you will have two calculations, one with the discount and one without the discount. So your formula would look like this

With this formula if the user select “Monthly Subscription” the price will be just the product price (without any additional discount) but if “Yearly Subscription” is selected the product price will be multiplied by 0.8 (which effectively adds a 20% discount).

## Type of conditions

You can do these types of comparisons using conditions

 Symbol Name Description Example == Equal to Compare that a value is equal than another value [Field 1] == [Field 2] != Not Equal To Compare that a value is not equal than another value [Field 1] != [Field 2] > Greater than Compare that a value is greater than another [Field 1]>[Field 2] >= Greater or equal Compare that a value is greater or equal than another [Field 1]>=[Field 2] < Less than Compare that a value is less than another [Field 1]<[Field 2] <= Less or equal than Compare that a value is less or equal than another [Field 1]<=[Field 2] Contains Contains Compare that a value is inside a list of values (frequently used for multiple options fields like radio buttons or check boxes fields) [Field 1] contains [Field 2] not contains Not Contains Compare that a value is not inside a list of values (frequently used for multiple options fields like radio buttons or check boxes fields) [Field 1] not contains [Field 2] 