Quick Answer

DSTDEV Function

Sample standard deviation of a database column for rows that meet the criteria.

✓ Excel✓ Google SheetsExcel All versions

Syntax

DSTDEV
(database, field, criteria)

Parameters

ParameterDescriptionRequired
databaseThe range containing the database, including the header row as the first row.Required
fieldThe column to analyze, given as the column label in quotes (e.g. "Yield") or its 1-based column index.Required
criteriaThe 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)
Result2.82842712474619

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 instead

DSTDEVP divides by n instead of n-1, giving a smaller value for the same two points.

=DSTDEVP(A1:E7, "Yield", A9:B10)
Result: 2
With n=2, the population variance is 8/2 = 4, so the standard deviation is 2, versus the sample 2.828.

Example 2: Wider sample of all apple trees

Criteria Tree=Apple across three rows

Compute the sample standard deviation over three apple yields.

=DSTDEV(A1:E7, "Yield", A9:A10)
Result: 4
Apple yields 14, 10, 6 have mean 10; squared deviations 16, 0, 16 sum to 32; divided by 2 gives variance 16; sqrt is 4.

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.

1
Set up the database
Enter your table with a header row, e.g. A1:E7 with Tree, Height, Age, Yield, Profit.
2
Set up criteria
Place criteria headers and values in a separate range, e.g. A9:B10.
3
Enter DSTDEV
Type =DSTDEV(A1:E7, "Yield", A9:B10) and press Enter.

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

Practice 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.

Works in Google SheetsCompatible with ExcelIncludes exercises

File format: CSV (comma-separated values) - opens in Excel, Google Sheets, and all spreadsheet apps

Frequently Asked Questions

When should I use DSTDEV instead of DSTDEVP?
Use DSTDEV when the matching rows are a sample of a larger population; use DSTDEVP when they represent the whole population.
Why is my DSTDEV result larger than DSTDEVP?
DSTDEV divides by n-1 while DSTDEVP divides by n, so the sample estimate is generally larger.
What happens with only one matching row?
DSTDEV returns #DIV/0! because a sample needs at least two values.