Excel function

DVARfunction

Returns the sample variance of the matching field values.

All versions
=DVAR(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. Squaring the DSTDEV result gives the DVAR result. Try breaking it on purpose to see the errors.

Result

1322253333.3333333

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 DVAR function?

=DVAR(database, field, criteria)

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

The sample variance divides the sum of squared deviations by (count-1), 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.

DVAR examples

  1. Example 1. Basic use

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

    The sample variance of the Seoul sales 45000, 25600 and 96000: about 1322253333.33.

  2. Example 2. OR condition

    =DVAR(A1:D9, 4, F1:F3)

    The variance of the 6 sales for Seoul or Busan.

Common mistakes

FAQ

How does it relate to VAR.S?
It is the same as VAR.S on only the matching values.
And the standard deviation?
The square root of DVAR is DSTDEV.