You can perform calculations and logical comparisons in a table by using formulas. The Formula command is found on the Table Tools, Layout tab, in the Data group.
A formula in Word automatically updates when you open the document that contains the formula. You can also update a formula result manually. For more information, see the section Update formula results.
Note: Formulas in Word or Outlook tables are a type of field code. For more information about field codes, see the See Also section.
In Word, the result of a formula is calculated when it is inserted, and when the document containing the formula opens. In Outlook, the result of a formula is only calculated when it is inserted and won't be available for the recipient of the email to edit.
You can also manually update:
Important: This procedure updates all the field codes in a document, not just formulas.
You can use positional arguments (LEFT, RIGHT, ABOVE, BELOW) with these functions:
As an example, consider the following procedure for adding numbers by using the SUM function and positional arguments.
Important: To avoid an error while summing in a table by using positional arguments, type a zero (0) in any empty cell that will be included in the calculation.
To add the numbers…
Type this in the Formula box
Above and below the cell
Left of the cell
Right of the cell
Left and right of the cell
Left of and above the cell
Right of and above the cell
Left of and below the cell
Right of and below the cell
Note: Formulas that use positional arguments (e.g., LEFT) do not include values in header rows.
The following functions are available for use in Word and Outlook table formulas:
Calculates the absolute value of the value inside the parentheses
Evaluates whether the arguments inside the parentheses are all TRUE.
1, if the sum of the values to the left of the formula (in the same row) is less than 10 and the sum of the values above the formula (in the same column, excluding any header cell) is greater than or equal to 5; 0 otherwise.
Calculates the average of items identified inside the parentheses.
The average of all values to the right of the formula cell, in the same row.
Calculates the count of items identified inside the parentheses.
The number of values to the left of the formula cell, in the same row.
Evaluates whether the argument inside the parentheses is defined. Returns 1 if the argument has been defined and evaluates without error, 0 if the argument has not been defined or returns an error.
1, if gross_income has been defined and evaluates without error; 0 otherwise.
Takes no arguments. Always returns 0.
Evaluates the first argument. Returns the second argument if the first argument is true; returns the third argument if the first argument is false.
Note: Requires exactly three arguments.
10, if the sum of values to the left of the formula is at least 10; 0 otherwise.
Rounds the value inside the parentheses down to the nearest integer.
Returns the maximum value of the items identified inside the parentheses.
The maximum value found in the cells above the formula (excluding any header rows).
Returns the minimum value of the items identified inside the parentheses.
The minimum value found in the cells above the formula (excluding any header rows).
Takes two arguments (must be numbers or evaluate to numbers). Returns the remainder after the second argument is divided by the first. If the remainder is 0 (zero), returns 0.0
Takes one argument. Evaluates whether the argument is true. Returns 0 if the argument is true, 1 if the argument is false. Mostly used inside an IF formula.
Takes two arguments. If either is true, returns 1. If both are false, returns 0. Mostly used inside an IF formula.
Calculates the product of items identified inside the parentheses.
The product of multiplying all the values found in the cells to the left of the formula.
Takes two arguments (first argument must be a number or evaluate to a number; second argument must be an integer or evaluate to an integer). Rounds the first argument to the number of digits specified by the second argument. If the second argument is greater than zero (0), first argument is rounded down to the specified number of digits. If second argument is zero (0), first argument is rounded down to the nearest integer. If second argument is negative, first argument is rounded down to the left of the decimal.
Takes one argument that must either be a number or evaluate to a number. Evaluates whether the item identified inside the parentheses if greater than, equal to, or less than zero (0). Returns 1 if greater than zero, 0 if zero, -1 if less than zero.
Calculates the sum of items identified inside the parentheses.
The sum of the values of the cells to the right of the formula.
Takes one argument. Evaluates whether the argument is true. Returns 1 if the argument is true, 0 if the argument is false. Mostly used inside an IF formula.
You can refer to a bookmarked cell by using its bookmarkname in a formula. For example, if you have bookmarked a cell that contains or evaluates to a number with the bookmarkname gross_income, the formula =ROUND(gross_income,0) rounds the value of that cell down to the nearest integer.
You can also use column and row references in a formula. There are two reference styles: RnCn and A1.
Note: The cell that contains the formula is not included in a calculation that uses a reference. If the cell is part of the reference, it is ignored.
You can refer to a table row, column, or cell in a formula by using the RnCn reference convention. In this convention, Rn refers to the nth row, and Cn refers to the nth column. For example, R1C2 refers to the cell that is in first row and the second column. The following table contains examples of this reference style.
…use this reference style