Using Calculated Fields

5 min read

What Are Calculated Fields?

Calculated fields perform automatic math operations using values from other fields in your form. They update in real time as respondents fill out the form, allowing you to display dynamic totals, scores, and computed values without any coding.

Adding a Calculated Field

  1. In the form editor, click Add Field and select Calculated Field from the field type list.
  2. Give the field a label (e.g., "Order Total" or "BMI Result").
  3. Click the Formula tab in the field settings to define your calculation.

Basic Math Operations

Calculated fields support the following operations:

  • Addition (+): Add values together. Example: Field1 + Field2
  • Subtraction (-): Subtract one value from another. Example: Price - Discount
  • Multiplication (*): Multiply values. Example: Quantity * UnitPrice
  • Division (/): Divide one value by another. Example: Total / NumberOfItems
  • Parentheses: Control order of operations. Example: (Subtotal + Tax) * Quantity

Referencing Other Fields

To use another field's value in your formula:

  1. In the formula editor, click Insert Field or type { to open the field picker.
  2. Select the field you want to reference. It will be inserted into your formula as a field token (e.g., {Quantity}).
  3. Build your formula using field tokens and math operators.

Fields you can reference:

  • Number fields: Use the numeric value directly.
  • Choice fields with numeric values: If you assign numeric values to dropdown or radio options, those values can be used in calculations.
  • Other calculated fields: Chain calculations by referencing one calculated field inside another.

Displaying Calculations

Configure how the calculated result appears to respondents:

  • Number Format: Choose the number of decimal places (e.g., 2 for currency).
  • Prefix: Add text before the value (e.g., $ for currency).
  • Suffix: Add text after the value (e.g., kg or %).
  • Visibility: Choose whether the calculated field is visible to respondents or hidden (used only for internal logic or passed to integrations).

Use Cases

Order Total Calculator

Build an order form where customers select products and quantities. Use calculated fields to show line item totals and a grand total:

  • Line Total: {Quantity} * {UnitPrice}
  • Subtotal: {LineTotal1} + {LineTotal2} + {LineTotal3}
  • Tax: {Subtotal} * 0.08
  • Grand Total: {Subtotal} + {Tax}

Score Calculator

Create a self-assessment where each answer has a point value. A calculated field sums up the points and shows a total score. You can use this with conditional logic to display different messages based on the score range.

BMI Calculator

Ask for height and weight, then calculate BMI using the formula: {Weight} / ({Height} * {Height}). Add a prefix and suffix to format the output as needed.

Pricing Estimator

Let potential customers configure options (size, add-ons, duration) and see an estimated price update in real time. This is great for service businesses, SaaS pricing pages, or custom product configurators.

Tips and Limitations

  • Division by zero: If a divisor field is empty or zero, the calculated field displays "N/A" instead of an error.
  • Empty fields: Empty number fields are treated as 0 in calculations.
  • Circular references: You cannot create a formula that references itself. WittyForm will show an error if a circular reference is detected.
  • Calculation order: When one calculated field references another, WittyForm automatically resolves them in the correct order.
  • Submission data: Calculated field values are included in form submissions, exports, and integrations.
$37 · paid once

Ready to Build Smarter Forms? Add Logic in Minutes

Start free and keep the five forms for good, or pay once and unlock all of it — unlimited forms, ten team members, AI, CRM, white label and the API. No renewal, ever.

14-day money-backInstant accessNo subscription, ever
Using Calculated Fields