STDEV function

Synopsis
This function returns the standard deviation of the elements within an array. If the array is empty, the function returns an error.
Variations
STDEV(SourceArray)
Returns the standard deviation of all elements in the source array.
Parameters
SourceArray

Specifies the array to work with.

Supported types: Numeric array.
Returns
Returned types: Numeric.
Examples
1.

The following example calculates the standard deviation in the specified source array. The function returns 1.58114.

STDEV([1, 2, 3, 4, 5])
2.

To avoid an error when you pass an empty array to this function, you could use the following expression. Note the example above is encapsulated in the following IF statement.

IF(COUNT([1, 2, 3, 4, 5]) > 0, STDEV([1, 2, 3, 4, 5]) , -1)
STDEV(SourceArray, StartIndex, Count)
Returns the standard deviation of all the elements in a subset of the source array.
Parameters
SourceArray

Specifies the array to work with.

Supported types: Numeric array.
StartIndex

Specifies the beginning of the subset of the source array.

Supported types: Numeric.
Count

Specifies the number of elements to include in the subset of the source array.

Supported types: Numeric.
Returns
Returned types: Numeric.
Examples
1.

The following example calculates the standard deviation of a subset of the specified source array. The function returns 1.

STDEV([10, 11, 12, 13, 14], 2, 3)
2.

To avoid an error when you pass an empty array to this function, you could use the following expression. Note the example above is encapsulated in the following IF statement.

IF(COUNT([10, 11, 12, 13, 14]) > 0, STDEV([10, 11, 12, 13, 14], 2, 3) , -1)
STDEV(SourceArray, Expression)
Returns the standard deviation of all elements in the source array after performing an expression on each element.
Parameters
SourceArray

Specifies the array to work with.

Supported types: Numeric array; String array; Boolean array; Point array; Object array.
Expression

Specifies the expression to apply to each element of the source array.

Supported types: Numeric.
Returns
Returned types: Numeric.
Examples
1.

The following example calculates the standard deviation of the source array after applying the expression to each element, resulting in the array [1, 1, 1, 1, 1]. The function returns 0.

STDEV([1, 2, 3, 4, 5], Item/Index)
2.

To avoid an error when you pass an empty array to this function, you could use the following expression. Note the example above is encapsulated in the following IF statement.

IF(COUNT([1, 2, 3, 4, 5]) > 0, STDEV([1, 2, 3, 4, 5], Item/ Index) , -1)
STDEV(SourceArray, StartIndex, Count, Expression)
Returns the standard deviation of all the elements in a subset of the source array after performing an expression on each element.
Parameters
SourceArray

Specifies the array to work with.

Supported types: Numeric array; String array; Boolean array; Point array; Object array.
StartIndex

Specifies the beginning of the subset of the source array.

Supported types: Numeric.
Count

Specifies the number of elements to include in the subset of the source array.

Supported types: Numeric.
Expression

Specifies the expression to apply to each element of the source array.

Supported types: Numeric.
Returns
Returned types: Numeric.
Examples
1.

The following example calculates the standard deviation of [-100, 10, 100] after dividing each element by 10. The function returns 10.0167.

STDEV([-100, 10, 100, 0, 0, 0], 1, 3, Item/10)
2.

To avoid an error when you pass an empty array to this function, you could use the following expression. Note the example above is encapsulated in the following IF statement.

IF(COUNT([-100, 10, 100, 0, 0, 0]) > 0, STDEV([-100, 10, 100, 0, 0, 0], 1, 3, Item/10) , -1)