DSTDEV Function
Sample standard deviation of a database column for rows that meet the criteria.
Syntax
Parameters
| Parameter | Description | Required |
|---|---|---|
| database | The range containing the database, including the header row as the first row. | Required |
| field | The column to analyze, given as the column label in quotes (e.g. "Yield") or its 1-based column index. | Required |
| criteria | The range with a header row matching database column names and one or more condition rows; only matching records are analyzed. | Required |
Basic Example
Sample standard deviation of Yield for apple trees taller than 10
=DSTDEV(A1:E7, "Yield", A9:B10)The two matching rows have Yield 14 and 10. The mean is 12, squared deviations are 4 and 4 (sum 8), divided by n-1 = 1 gives 8, and the square root is about 2.828.
Advanced Examples
Example 1: Compare with population version
Same data, DSTDEVP insteadDSTDEVP divides by n instead of n-1, giving a smaller value for the same two points.
=DSTDEVP(A1:E7, "Yield", A9:B10)Example 2: Wider sample of all apple trees
Criteria Tree=Apple across three rowsCompute the sample standard deviation over three apple yields.
=DSTDEV(A1:E7, "Yield", A9:A10)How DSTDEV Works
DSTDEV filters the database to rows matching the criteria, then computes the sample standard deviation of the numeric values in the specified field: it takes the square root of the sample variance, where the sum of squared deviations from the mean is divided by n-1 (the number of matching records minus one). Use DSTDEV when the matching records are a sample, not the whole population.
Important Notes & Limitations
Assumes the matching records are a sample; use DSTDEVP for an entire population.
Needs at least two matching numeric values, or the result is undefined (#DIV/0! when n is less than 2).
Criteria header labels must exactly match database headers.
Common Errors & Fixes
#DIV/0!Fewer than two records matched, so the sample (n-1) denominator is zero or negative.Fix: Ensure the criteria match at least two records, or use a different statistic for single values.
#VALUE!The field was an unquoted column name.Fix: Wrap the field name in quotes, e.g. "Yield", or use the column index.
Download Practice File
DSTDEV
dstdevPractice DSTDEV with Real Data
Download a sample CSV file with pre-populated data and practice exercises for the DSTDEV function. Works in both Excel and Google Sheets.
File format: CSV (comma-separated values) - opens in Excel, Google Sheets, and all spreadsheet apps