AVG macro
The AVG macro is available in IBM® Campaign and IBM® Interact.
Syntax
AVG(data [, keyword])
Parameters
data
The numerical values for which to compute the arithmetic mean. These values can be a constant value, a column, a cell range, or an expression evaluating to any of the above. For the format definition of data, see the "Macro Function Parameters" section in the chapter in this guide for your IBM® product.
keyword
This optional keyword determines how the computation is performed over the input data range. Select one of the following keywords:
ALL - Performs the computation on all cells in data (default)
COL - Performs the computation separately for each column of data
ROW - Performs the computation separately for each row of data
For more details on using keywords in IBM® Campaign, see Format Specifications.
*
Many macro functions take the keyword parameters {ALL | COL | ROW}. These keywords do not apply in IBM® Campaign because the input data is always a single column or field. The macro always behaves as if the COL keyword were specified. Therefore, you do not need to specify these keywords when you use IBM® Campaign.
Description
AVG calculates the arithmetic mean or average of the cells in the specified data range. The arithmetic mean is calculated by summing the contents of all cells, then dividing the result by the number of cells. The number of columns that are returned by AVG depends on keyword.
*
If keyword is ALL, AVG returns one new column, containing a single value (the average of all cells in data).
*
If keyword is COL, AVG returns a new column for each input column. Each new column contains one value (the average of all cells in the corresponding input column).
*
If keyword is ROW, AVG returns one new column that contains the average across each row of data.
*
*
AVG is the same as the MEAN macro function.
Examples
Related functions
SUM or TOTAL