Add, subtract, multiply, and divide values

Microsoft Office InfoPath 2003

Show All Show All

Add, subtract, multiply, and divide values

When designing a form, you can create a formula that calculates values in text boxes, rich text boxes, date pickers, and expression boxes. Because expression boxes only display data and do not store it, you should use an expression box only if you do not want to use the calculated value in another calculation or save it as part of your form.

Formulas are stored in fields and are displayed in the controls that are bound to those fields.

  1. In design mode, double-click the control where you want to create the formula.
  2. On the Data tab of the Control Properties dialog box, click Insert Formula Button image.

    Note  To create the formula by using the field's properties, right-click the field in the Data Source task pane, and then click Properties on the shortcut menu.

  3. In the Insert Formula dialog box, click Insert Field or Group.
  4. In the Select a Field or Group dialog box, click the field whose value you want to include in the formula, and then click OK.
  5. After the field in the Formula box in the Insert Formula dialog box, type the symbol for the mathematical operation that you want. The symbols are shown in the following table (note that you should include spaces around the division symbol).
    OperationSymbol
    Add+
    Subtract-
    Multiply*
    Divide /
  6. To add the second value to your formula, click Insert Field or Group.
  7. In the Select a Field or Group dialog box, click the field whose value you want to include.

Notes

  • To create more complicated formulas, you can repeat steps 3 and 4, include functions, and use parentheses.
  • To add the values in a repeating field, use the sum function.
  • The information in this topic may not apply if you are working with a form designed using Microsoft Office InfoPath 2003 without the service pack installed. Learn more