Calculator: Advanced Functions and Conditional Operators
Calculator: Advanced Functions and Conditional Operators

Learn How to Use the Calculator’s Advanced Features

Written by Elod
Updated over a week ago
 Available on ❌ Free ✅ Basic ✅ Pro ✅ Business ✅ Agency

You'll find these advanced functions listed on the right side panel of the Calculator's formula builder. A short description is displayed as well when hovering above an operator on the side panel.

 Name Description Syntax Example MAX Returns the largest of all input numbers MAX(Q1,Q2,5,...) MIN Returns the smallest of all input numbers MIN(Q1,Q2,5,...) ROUND Rounds input numbers to decimal places ROUND(number,precision) POW Power of / exponent function POW(number,exponent) RAND Returns a random number from a specified range RAND(min,max,precision) FLOOR Returns the next lowest integer value by rounding down FLOOR(1.12345) CEIL Returns the next highest integer value by rounding up CEIL(1.12345) ROOT Square root (√) of a number ROOT(Q1) LOG Base 2 logarithm of a number LOG(Q1,10) LOG10 Base 10 logarithm of a number LOG10(Q1) LN Natural logarithm of a number LN(Q1) COUNT Function to check how many answers were given or files were uploaded. Can only be used with Multiple Choice, Image Choice and File Upload elements. COUNT(Q1) DAYS Function to calculate how many days are in the range of two dates (including both dates). Can only be used with Date & Time elements. DAYS(Q1,Q2)

# Conditional Logic Operators

 Name Description Syntax Example IF/THEN Conditional Logic IF(condition, then case, else case)

The conditions below can only be used inside the first parameter of an IF function:

These advanced functions will allow you to build more customized calculations. You'll find some example formulas for different use cases below:

# Use Case Examples

## Quantity Dependent Shipping Price Calculator

Calculator formula: =IF(Q2>5,Q1*Q2+10,IF(Q2>3,Q1*Q2+5,Q1*Q2+2))

Where Q1 is the price of the selected item, and Q2 is the quantity of the items ordered.

In the example above, two nested IF functions are used to check for the quantity ordered.

The leftmost IF function checks if there are more than 5 items in the order. If true, \$10 will be charged for shipping, which is added to the ordered products' price. If the condition isn't true (less than 6 items ordered), the nested IF function checks if the amount of items is more than 3, in which case \$5 will be charged for shipping. If the nested IF function's condition isn't true, the else case will be calculated, which charges \$2 for shipping.

## Coupon Code Checker

Calculator formula: IF(CONTAINS(Q2,'COUPONCODE'),Q1*0.8,Q1)

Where Q1 is the price of the selected product, and Q2 is the coupon code entered by the participant.

In the example above, the CONTAINS function checks if Q2 includes the predefined text, which is COUPONCODE in this case. If a match is found, the formula applies a 20% discount to the chosen product's value (achieved by the multiplication with 0.8).

If no match is found, the calculator's output will be the full value of the chosen product (Q1).

You'll find more use case examples in our blog post.