Error getting tags :
error 404Error getting tags :
error 404 average | revDocs | RunRev
Welcome Guest (Log in)
Product Edition
Version
average
Basics
Expander triangle
Type
Function
Syntax
average(numbersList)
Introduced
1.0
Changed
1.1
Environment
Desktop, Web and Server
Platform Support
MacOS,Mac OS X,Windows,Linux
Security
None required
Summary
Returns the arithmetic mean of a list of numbers.
Examples

average(6,22,8) -- returns 12
put average(importedList) into field "Imported Price"
put average(replaceText(field "Values",return,comma)) into avgValue

Additional Comments
Expander triangle

Use the average function to find the value that best represents a group of values.

Parameters:

The numbersList is a comma-separated list of numbers, or an expression that evaluates to such a list, or an array containing only numbers.

Value:

The average function returns a number.

Comments:

The average of a list of numbers is the sum of the items in the list or elements in the array, divided by the number of items or elements.

The average function can also be written like this:

sum(numbersList)/the number of items in numbersList

If the numbersList is empty, the average function returns zero.

Changes to Revolution:

The ability to use an array was introduced in version 1.1. In previous versions, only lists of numbers could be used with the average function.

User Comments
Expander triangle