Calculated Variables is an invisible question that works out one number from earlier answers and global variables. The respondent never sees it. It is the question form of the Calculation flow block, and a flavor of Create / Edit Global Variables.
Adding one#
- In the question palette (Specialized group) add Calculated Variables.
- Click Edit formula, pick or name the result variable and build the formula. Click an input to insert it.
- The card shows
ResultVar = formula. The builder flags a missing variable or formula, or a formula with a syntax error.
How inputs become numbers#
A Calculation works out a number from answers and global variables and stores it in a result variable. Add one from the Flow tab (the Calculation block) or as a Calculated Variables question from the question palette. Pick the result variable, open the formula editor and click inputs to insert them.
Every input is turned into a number first:
| You use | Token | Counts as |
|---|---|---|
| Single select | answer | The answer's recode value (set it in the question's recode settings) |
| Multiple select | one Choice per option | 1 if picked, 0 if not |
| Number, slider, rating, short text | answer | The number typed or chosen; empty or non-numeric text is not a number |
| Grid | one Row per row | The selected column's recode value, or the number typed in that row |
| Ranking | one Rank per item | The item's position, 1 being first |
| Global variable | variable name | The number it holds |
If any input cannot become a number, the result is NA. This differs from the Formula operation of Create / Edit Global Variables, which keeps the variable's old value when it cannot compute; a Calculation always replaces it, so an old number can never pass for a fresh one. Alongside the result the survey keeps a record of the formula, the numbers used and any error (a variable named __calc.<YourVariable>) that does not appear in Display Global Variables.
Word import/export and the AI assistant do not know about Calculations yet.
Was this page helpful?