What does the functionality do?
When you ask respondents to score certain aspects it can be valuable to calculate an average score (mean) across multiple aspects. For this purpose you can use a value assignment and the meanValid function. You can include this element behind for instance a matrix question in the survey. Suppose you have included 5 aspects in the matrix question to be rated by the survey participants with a number between 1 (Very Poor) and 5 (Excellent).
The meanValid function automatically excludes all missings (No answer given, N/A selected, hidden by filter) from the calculation of the mean.
Note: In order to use a value assignment, you have to create a custom variable.

The values/numbers that can be set for each rating criterion can be defined in the columns of the question, e.g.
- Very poor > Value 1
- Poor> Value 2
- Average > Value 3
- Good> Value 4
- Excellent> Value 5
Use case and how to set it up?
In order to calculate the average service score of a participant, for example, proceed as follows:
A. Insert a Value assignment element and select ‘Create Variable’:

B. Then you give it a name (e.g. varMean) and select the data type Real number:

C. You Save the variable and populate the field ‘Is equal to the following term’ with the meanValid function and the variables of which the mean should be calculated. The list of variables is separated by comma’s and always start with (” and end with “)
meanValid("q1_1,q1_2,q1_3,q1_4,q1_5")
- q1_1 = Service (First row of question q1)
- q1_2 = Functionality (Second row of question q1)
- q1_3 = Performance and speed (Third row of question q1)
- q1_4 = Value for money (Fourth row of question q1)
- q1_5 = Feature completeness (Fifth row of question q1)
Hint: use the option Available placeholders and search function to select the desired variables:

D. When a participant now fills out the survey, his/her scores for the various aspects will be added together and subsequently be divided by the number of answers given. The value is stored in the custom variable varMean. If you want to display the average score to a participant, you can include another text block under the value assignment element in the survey. In this text block, you can enter the following information, among others:

In general it is recommended to place the value assignment after the question and use the “every time” execution mode:

Only if you need to have content shown on an interview page that changes dynamically according to the answers on the same page, a value assignment with the execution mode “anytime” is needed.
You can also use the meanValid function to calculate the mean of different questions combined, or even calculate an overall mean across multiple means.