Formulas are stored in fields (field: An element or attribute in the data source that can contain data. If the field is an element, it can contain attribute fields. Fields store the data that is entered into controls.) and are displayed in the controls that are bound (bind: To connect a control to a field or group in the data source so that data entered into the control is saved. When a control is unbound, it is not connected to a field or group, and so data entered into the control will not be saved.) to those fields. When designing a form, you can create a formula that calculates the average for a column of numbers in a repeating table (repeating table: A control on a form that contains other controls in a table format and that repeats as needed. Users can insert multiple rows when filling out the form.) by using a text box, rich text box, or expression box.
Note You should use an expression box only if you do not want to use the calculated average in another calculation or save it as part of your form, because expression boxes only display data and do not store it.
- In design mode, double-click the control where you want to create the average formula. The control should not be part of the repeating table.
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 Data tab in the Control Properties dialog box, click Insert Formula .
- In the Insert Formula dialog box, click Insert Function.
- In the Categories list in the Insert Function dialog box, click Math.
- In the Functions list, click avg, and then click OK.
- In the Formula box in the Insert Formula dialog box, double-click the text in parentheses.
- In the Data source list in the Select a Field or Group dialog box, click the field whose values you want to average. The column must be bound to the selected field, and the field itself must be a repeating field or part of a repeating group.
Note 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.