Excel function

DSTDEVfunction

Returns the sample standard deviation of the matching field values.

All versions
=DSTDEV(A1:D9, 4, F1:F2)
Range to drag
A
B
C
D
E
F
G
1
2
3
4
5
6
7
8
9

Drag the corner dots to change database, criteria. Click the numbers on the top to change field. Change the criteria range to F5:F6 (sales of 90000 or more). Only one number matches, so you get #DIV/0!. Try breaking it on purpose to see the errors.

Result

36362.8015055679

database
A1:D9Drag the corner dots on the table

The whole list. The first row must hold the headers (field names).

field
4database has 4 columns

The column to calculate. The first column of the database is 1. In Excel you can also write a header name such as "Sales" or a cell like D1.

criteria
F1:F2

The criteria table. Its first row holds headers; conditions on the same row must all hold (AND), conditions on different rows are alternatives (OR).

What is the DSTDEV function?

=DSTDEV(database, field, criteria)

DSTDEV treats the field values of the matching records as a sample and returns their standard deviation. Its conditions are written as a separate table on the sheet.

The sample standard deviation divides the sum of squared deviations by (count-1) and takes the square root, so at least 2 numbers must match.

Arguments

database
The whole list. The first row must hold the headers.
field
The column to calculate: a column number (the first column is 1), a header name such as "Sales", or a cell holding the header (D1).
criteria
The criteria table. Its first row uses the same headers as the database, with the conditions below.

DSTDEV examples

  1. Example 1. Basic use

    =DSTDEV(A1:D9, 4, F1:F2)

    The sample standard deviation of the Seoul sales 45000, 25600 and 96000: about 36362.8.

  2. Example 2. Only one number

    =DSTDEV(A1:D9, 4, F5:F6)

    Only one number matches, so #DIV/0!.

Common mistakes

FAQ

How does it relate to STDEV.S?
It is the same as STDEV.S on only the matching values.
Variance?
DVAR is the sample variance of the same values: the square of DSTDEV.