Articles on: Building Calculators

Creating a Formula

The formula is the price that the customer will see on the product page and will be calculated dynamically and displayed live as their input changes.


In the formula section, you will need to define the formula based on the defined inputs in the elements.


  • Supported operators: +, -, *, /
  • Do things in parentheses first: ()
  • Comparisons: >, <, >=, <=, ==, !=
  • ceil(label name) => Rounds a number up to the nearest integer
  • floor(label name) => Rounds a number down to the nearest integer
  • sqrt(label name) => Calculates the square root of the input
  • max(a, b) and min(a, b) => The larger or smaller of two values
  • if(condition, value when true, value when false) => A price that depends on what the customer entered. For example: if(Width > 45, 85, 0) adds 85 once the width passes 45
  • and(...) and or(...) => Combine two conditions. && also works
  • Functions can be nested inside one another
  • Not available: round(), abs(), pow(), and ^. To control decimal places, set Formula Output Decimals in the calculator settings
  • Use the label names to build the formula



Number input:


If you are using the range feature, you can return the range value by inserting the "labelname", or the actual value inserted by the customer by inserting "label name[actualvalue]"


Data lookup:
To add the matched value to your formula all you have to do is insert the element's "label name". You can also use any of the two inputs inserted by your customer to your formula by doing the following: "ELEMENT LABEL [INPUT 1 NAME]"


Example:
Dropdown labeled Color with options named Blue and Red. I want the price for each to be the options value * 100

Formula: Color * 100

If I want to add a base cost of $30 I would change the formula to: Color * 100+30

NOTE: Each element has to have a unique label name.



The formula field helps as you type


Click into the formula field and a list appears showing the functions and variables you can use, including your own element names. Keep typing and the list narrows; pick one with the arrow keys or the mouse. While you are inside a function, a hint below the field shows which argument you are entering, the way a spreadsheet does.



If you would rather describe the pricing than write it, the same field offers a shortcut into Calcy, the AI builder, which writes the formula from a plain-English description.

Updated on: 19/08/2026

Was this article helpful?

Share your feedback

Cancel

Thank you!