Arithmetic Operator Order

The order in which you select column segments and operators is important. When the system reads formulas, it first solves formulas that are within the formula, and then reads the formula from left to right, applying the multiplication operators, then the division operators, then the addition operators, and then the subtraction operators.

For example, suppose that your formula includes these segments and operators: SEG1+SEG2/.375+SEG3-SEG4*.5. Suppose further that the values for the segments are:

  • SEG1=10000

  • SEG2=30000

  • SEG3=50000

  • SEG4=40000

The steps the system uses to resolve the formula are:

  1. Calculate or accumulate the values for the segments.

    The values in the equation are: 10000+30000/.375+50000-40000*.5

  2. Next, the system solves the multiplication and division steps, reading the formula from left to right.

    The results are: 10000+(the result of 30000/.375, which is 80000)+50000-(the result of 40000 *.5, which is 20000). The formula now is: 10000+80000+50000-20000.

  3. Finally, the system solves the addition and subtraction, resulting in an amount of 120000.

If you need to create a column to calculate values and you need to use addition or subtraction as well as multiplication or division, consider creating a formula column for the addition or subtraction action, and then use that formula column in another formula column to apply the multiplication or division action. When you create a formula column and then use it in another formula column, the system treats the included formula as if it is surrounded by parentheses, so the system solves the included formula first.

In the example discussed in this section, your results would be different if you created formula columns for the addition and subtraction operations, and then used those formulas within another formula. For example, you might create a formula column named ADD that includes SEG1+SEG2, and create a formula column named SUB that includes SEG3-SEG4. You could then use those formula columns within a new formula named FORM1. The FORM1 column would include: ADD/.375+SUB*.5. When the system resolves the FORM1 formula, it will solve the ADD and SUB formulas first, and then apply the multiplication and division operators and the numeric factors. The result is (10000+30000)/.375+(50000-40000)*.5, which is equal to 40000/.375+10000*.5. The system solves the multiplication and division, and then applies the final addition step. The results are:

40000/.375 = 106667

10000*.5 =5000

10667 + 5000 = 111666.

See Also Examples of Formulas.