Calculating Subtotals and Multi-step Equations

Formsite calculating subtotals sample

Formsite’s Calculation item lets form owners calculate values on online forms. These calculations use scores, prices, or entered numbers as parts of equations defined by the form owner. Many times the calculations are only part of the equation, however, and need further processing later in the form. An example would be calculating subtotals for a multi-step equation.

Calculation Basics

Formsite calculating subtotals settings example

The fundamental math for Calculation items includes the basic addition, subtraction, multiplication, and division. These essential modifiers let form owners build equations to calculate values based on answers in the form.

Adding items to the equation works by clicking the Show calc codes link, then copy and pasting the code for each item. The calc code uses either the number entered or the score for the choice selected in the equation.

Number items allow form visitors to enter numbers and using these items make equations easy to understand. For example, to calculate the total number of values entered into 5 Number items, the equation would look like this:

Id1+id2+id3+id4+id5

To calculate the average number using the same items, the equation looks like:

(id1+id2+id3+id4+id5)/5

Calculating Subtotals

Using calculated values from Calculation items is possible with some considerations. The main consideration is that Calculation items have no value on the same page. That means that their values can’t contribute to another calculation on the same page. They can be part of equations on later pages, though.

An example of how to calculate a subtotal when all parts appear on the same page:

  • Calculation item 1 equation: id12+id22+id34
  • Calculation item 2 equation: id45+id52

To calculate the total of the two Calculation items, if the previous Calculation items appear on a previous page then the equation would be:

Calculation item 1 + Calculation item 2

To calculate the total when they’re on the same page, however, the equation uses each item’s equation instead of the id number:

(id12+id22+id34)+(id45+id52)

As with the average example, use parentheses to group related parts of the equation. For more information or other questions about Formsite features, feel free to contact our support team.

Billions of forms submitted