Calculated fields
Calculated fields let you perform calculations using answers from other questions in your form.
Updated
For example, you can multiply the quantity a customer enters by the price of an item to calculate the total. The result updates while the respondent fills out the form.
This is useful for order forms, registrations, assessments and other forms that need automatic calculations.
How calculated fields work
A calculated field uses a formula to calculate a number from other answers.
You can use:
- Addition (
+) - Subtraction (
-) - Multiplication (
*) - Division (
/) - Remainder (
%) - Parentheses (
())
You can also use answers from number questions in your formula.
Examples of calculated fields
Here are a few ways you can use calculated fields.
Calculate an order total
If your form asks for quantity and unit price, use:
{{Quantity}} * {{Unit price}}This calculates the total price.
Add tax to a subtotal
If your form collects a subtotal, use:
{{Subtotal}} * 1.1This adds 10% to the subtotal.
Calculate an average score
If your form collects two scores, use:
({{Score 1}} + {{Score 2}}) / 2This calculates the average of both scores.
Show or hide calculated values
You can choose how a calculated field appears to respondents.
A calculated field can be:
- Visible and read-only: Respondents can see the calculated result but cannot change it.
- Hidden: The calculation runs without showing the result to respondents.
This is useful when you need a value for your form without displaying it.
What happens when an answer is empty?
Calculated fields use numeric answers from other questions.
If a referenced answer is empty or does not contain a valid number, OG Forms treats it as an empty value. The calculated field shows nothing instead of displaying an incorrect result.
What is not supported yet?
Calculated fields currently support basic arithmetic and parentheses.
Functions such as SUM(), IF(), AVG() and CONCAT() are not supported yet.