Documentation/Calc Functions/DSTDEV

Function name:
DSTDEV

Category:
Database

Summary:
DSTDEV calculates the sample standard deviation based on the numeric values in the cells (fields) of the specified column, for all rows (database records) that match the specified search criteria. Non-numeric values are ignored.

Syntax:
DSTDEV(Database; DatabaseField; SearchCriteria)

Returns:
Returns a non-negative real number that is the sample standard deviation of the extracted numeric values.

Returns a #NUM! error if exactly one record matches the specified search criteria, or if there is only one numeric value in the cells of the specified column for the matching records.

Returns 0 if no matches are found, or if there are no numeric values in the cells of the specified column for the matching records.

Arguments:

 * If no matches are found for the given SearchCriteria, or if there are no non-zero numeric values in the cells of the specified column for the matching records of the Database, then the function returns 0.
 * If exactly one record matches the specified search criteria, or if there is only one numeric value in the cells of the specified column for the matching records, then the function returns a numeric(#NUM!) error.

Formula
The formula for the sample standard deviation is:

$$\text{s}~=~\sqrt{\frac{1}{n-1}\sum_{i=1}^{n}\left (x_{i}-\bar{x} \right )^2}$$

where s is the standard deviation, xi is the value of the i-th sample, n is the count of samples, and x̄ is the mean value.

Examples:
The content of cells A12:E12 should be identical to the header labels for the database table in cells A1:E1. Make sure that cells A13:D13 are blank and that cell E13 contains ">0" (this search criterion is intended to match all records in the database table).

Many more examples of both search criteria and function calls can be found in this [[Media:Calc_Database_Functions_Examples.ods | Calc spreadsheet]].

Related LibreOffice functions:
DAVERAGE

DCOUNT

DCOUNTA

DGET

DMAX

DMIN

DPRODUCT

DSTDEVP

DSUM

DVAR

DVARP

STDEV

STDEV.S

ODF standard:
Section 6.9.9, part 2

Equivalent Excel functions:
DSTDEV