YourPlugins

Build a formula calculator

Part of Build a calculator.

All docs

Use Formula mode when your calculator can be expressed with a mathematical expression and you do not need a full spreadsheet file. If you need more complex logic or multiple mapped cells, use spreadsheet mode instead.

Create a formula-based calculator

  1. Create or open the WooCommerce product where the calculator will be used.
  2. Open YourPlugins > Spreadsheet Calculator and create a new calculator.
  3. In the Base tab, enter the calculator name and any internal description you need.
  4. In the Fields tab, add the input fields that should feed the formula and any output fields you want to display.
  5. In the Formula/Mapping tab, set Type = Formula.
  6. Write the formula using field tokens and standard math operators.
  7. In the Products tab, assign the calculator to products and/or categories.
  8. Use the Preview tab to test the calculator before publishing.
  9. Click Save.

Formula syntax

The recommended syntax in version 3.x uses readable field tokens in double braces, for example:

{{width}} * {{height}}

You can also use:

  • $price to reference the WooCommerce product base price
  • legacy tokens such as $aws_price_calc_12 for backward compatibility
  • operators such as +, -, *, / and parentheses
  • common math functions such as sqrt(), abs(), log(), sin() and cos()
Tip: formula keys are more stable than old numeric field IDs. If you rename a field label, the formula key does not change automatically unless you choose to change it.

Only fields that return calculable values can be used directly inside a formula. If you need spreadsheet-only features such as cell-level mapping, error cells, tax-rate cells, or SKU-based worksheet logic, use spreadsheet mode instead.

Price formatting still follows WooCommerce settings.