AVERAGE
Last updated
Was this helpful?
Last updated
Was this helpful?
Calculates simple average or moving average for a metric or a variable.
Syntax: AVERAGE (
metric_or_variable
,
start_index
,
end_index
)
metric_or_variable
is the name of the metric or variable
start_index
is the starting index which can be described either in fixed or relative terms to the time period
end_index
is the ending index which can be described either in fixed or relative terms to the time period
For example, consider the Customers
metric for the period of Jan '23 to Jul '23
For the time period defined above, an index 0
refers to Jan '23 whose value is 10
, index 1
refers to Feb '23 whose value is 20
, and so on. The index can take on negative values as well—these would refer to previous time periods—for example, index -1
would refer to the value of the cell in Dec '22. Assume the values for Oct '22, Nov '22 and Dec '22 to be 10 each.
The average is computed by adding all the values specified between the starting and ending indices and then dividing by the count indices as shown in the examples below:
Example to calculate simple average: AVERAGE ( Customers , 0 , 2 )
( 10 + 20 + 30 ) / 3 = 60 / 3 = 20
Output: 20
(for all cells)
Example to calculate moving average: AVERAGE ( Customers , t-1 , t-2 )
Output: Jan '23: 10; Feb '23: 10; Mar '23: 13.33; Apr '23: 20; May '23: 30; Jun '23: 40; Jul '23: 50