A great new feature that allows you to create your own formula using items from your questionnaire. You can use the /*-+() to create formulas using variables such as answers or quiz scores to calculate an average, for example.

This guide will teach you:

  1. How to create a formula
  2. Test your formula
  3. Advanced formula calculations
  4. How your formula can be used in outcomes, email templates, and final screen
  5. How to use formulas to calculate averages

1 How to create a formula

1.1 Creating formula in the software

Can't wait to create your formula? Make sure your questionnaire is completed then head straight to the Extra Options tab and select Formulas in the Custom Scoring section.

how to create formula example

Click Create formula and you're on your way! Let's see how to build the formula.

creating formulas example

  1. Title - name your formula. Make it something that will be clear to you if you want to come back to edit it.
  2. Variable - you cannot edit the variable but you can copy it to use in outcomes, email templates or results. This will actually return the result of the calculation wherever you use the variable.
  3. The formula - build your formula here. Use the circled symbols to put your formula together. Click Variables to access the drop-down menu of questionnaire variables that you can use in your formula. For example, you could write:


One formula isn't enough for you? Click Create formula to add as many new formulas as you like.

1.2 Creating formulas outside the software

Now let's see how to build the formula outside the software. Click Import formulas to get started.

Import formula example

Select the File you want to upload.

Formula creating outside software

Once you upload your file, it should look like this:

Upload formula example

creating formula in software

If you are looking for an example file to import your formulas, you can download one here.

2 Test your formula

To test out how your formula will work, just click Test and your formula calculation will be displayed below based on a previous response.

Formula test

tipTip: You need at least one response in order for your Formula Test to work.

3 Advanced formula calculations

Want to add a more advanced formula? Here's how you can use different variables in your formula:

  • *|qb1_custom_score|* - the question block custom score value that was obtained. It is valid for the respondent who’s taking the questionnaire and will add the custom scores of each answer in one question block. You can use this variable in your formula or also as a piping variable
  • *|qb1_custom_score_percentage|*the question block custom score value as a percentage. It's the same as the variable just discussed *|qb1_custom_score|* but will calculate as a percentage.
  • *|qb1_max_custom_score|*the maximum total score for one question block.
  • *|q1_custom_score|* - the custom score value for this specific question.
  • *|q1_custom_score_percentage|* - this is the same as above *|q1_custom_score|* but then calculated as a percentage.
  • *|total_custom_score|* - the value of all custom scores for all questions (or for all question blocks) together.
  • *|total_custom_score_percentage|* - the value of the custom score as a percentage compared to the max score.
  • *|max_possible_custom_score|* - the maximum score for the whole questionnaire.

For advanced users, we recommend Math, a built-in object that has properties and methods for mathematical constants and functions. More information can be found here:

tipTip: The formula test button does not work on formulas where 'include all survey responses' is enabled.

tipTip: Although it is possible to create advanced formulas using the Math object, the formula test can only parse numerical values. To test these advanced formulas you would be required to collect a new response for the questionnaire and look at the formula results.

4 How can your formula be used?

You can create an outcome that will be displayed based on the value of the formula or send an email after survey completion, depending on the result of the formula. Formulas will also help you in displaying scores as percentages on the final screen.

Outcome-based on formula

Watch this video to learn how to use formulas to show the correct outcome or follow the steps below.

After you have created your formulas as described above, click on the Outcomes feature in Extra options. See the Outcomes guide for full details about setting up your Outcome screen. We'll just look at the final part, which is where the Formula function comes in. You'll need to select Show this outcome when a certain condition is met. From the drop-down menu, click Formula.

Formula in outcome

Now use the drop-down menus that will come up to choose which formula you want to use, how it should be used, and what the values should be.

Specify formula for outcome

Click Apply and your Outcome is now set to be shown with the right formula value.

Email template based on formula

Once you have saved your formula, click on the Email templates feature in Extra options. See the email template guide for full details about setting up your email templates. When you need to specify when to send the email, this is where the Formula function comes in. Just click on the arrow and select Formula.

Formula - email templates

Now you can choose which formula you want to be used and for which values you want the email to be sent out. Click Apply, and you're all set.

Formulas to show scores in your final screen / outcome(s)

Formulas can also be used together with custom scores to create a final screen or outcome(s) where respondents will see their scores as a percentage for each set of questions. You can simply use the variables of the formulas (see section 1) to show the results of the formulas in your outcome screen or final screen.

You can also use the variable *|f_result_ranking_table|* to easily insert a table with results of all formulas ordered from highest to lowest. The steps are similar to those shown in this video, with setting up custom scores and formulas.

5 How to use formulas to calculate averages

If you're on the Enterprise or ReportR plan, you'll see a button underneath the formula box, which you can toggle to include all survey responses in this formula calculation.

Formulas including all responses

Turning on this feature will allow calculations to be made using data from the survey to calculate averages, for example. This allows you to show data in the PDF report for the entire population or from all responses received rather than from just one response. 

Formula filters are available on the ReportR plan only. You can add custom filters so that the formula is only calculated for respondents who meet certain conditions.

Read the full guide about calculating formulas from all responses and using formula filters.

That's all! Now log in and try out the formulas feature for yourself!

Vincent is the author of this solution article.

Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.