Database function

DVAR function

Estimates the variance of a column for the records that match the criteria, treating them as a sample of a larger group.

Available in All versions of Excel, including Microsoft 365 and Excel for the web

In every Excel versionWorks in Google Sheets

Syntax

DVAR(database, field, criteria)
ArgumentWhat it means
databaseRequiredThe list including its header row.
fieldRequiredThe numeric column to analyse.
criteriaRequiredThe criteria range.

Returns: The sample variance (divides by n − 1) of the matching values.

How DVAR works

Variance is the average of the squared distances from the mean. It describes spread just like standard deviation does, but in squared units — for salaries in euros, the variance is in "euros squared", which is why the numbers look enormous. Its square root is the standard deviation (DSTDEV), which is usually easier to interpret. Variance is still the quantity many statistical methods work with, for example when comparing the spread of two groups.

DVAR calculates the sample variance (dividing by n − 1, like VAR.S) for the records that pass the conditions in a criteria range. Use DVARP when the matching records are the complete population. At least two matching numbers are needed.

Examples

1Variance of Sales salaries (sample)

F2fx=DVAR(A1:D7, "Salary", A9:A10)
ABCDEF
1DeptNameYearsSalary
2SalesAna34200016083333.33
3ITBen758000
4SalesCarla546500
5ITDev249000
6HREli951000
7SalesFay138500
8
9Dept
10Sales

Result: 16083333.33

The squared deviations of 42,000, 46,500 and 38,500 from their mean, divided by 3 − 1 = 2, give 16083333.33 (two decimals). Its square root, 4010.40, is the DSTDEV result.

2Staff with at least 3 years

F2fx=DVAR(A1:D7, "Salary", A9:A10)
ABCDEF
1DeptNameYearsSalary
2SalesAna34200046562500
3ITBen758000
4SalesCarla546500
5ITDev249000
6HREli951000
7SalesFay138500
8
9Years
10>=3

Result: 46562500

Four salaries qualify; their sample variance is 46562500.

⬇Practice workbookExamples with live formulas + practice sheets · .xlsx · 14 KB

Common errors and how to fix them

ErrorWhy it happensFix
#DIV/0!Fewer than two matching numbers.Widen the criteria or use DVARP.
#VALUE!The field name is not in the list.Use the exact header or a column number.

Tips

  • Report the standard deviation to non-specialists — it is in the same units as the data. Keep variance for calculations.
  • A comparison of two groups' variances (e.g. Sales vs IT) is the first step of an F-test; see F.TEST.

Google Sheets

DVAR also exists in Google Sheets and works the same way for everyday use, so the examples above work there too.

DVAR in other languages

In a non-English version of Excel the function has a local name. Excel translates formulas automatically when a file is opened in another language.

LanguageFunction name
CzechDVAR.VÝBĚR
DanishDVARIANS
DutchDBVAR
FinnishTVARIANSSI
FrenchBDVAR
GermanDBVARIANZ
HungarianAB.VAR
ItalianDB.VAR
Norwegian (Bokmål)DVARIANS
PolishBD.WARIANCJA
Portuguese (Brazil)BDVAREST
Portuguese (Portugal)BDVAR
RussianБДДИСП
SpanishBDVAR
SwedishDVARIANS
TurkishVSEÇVAR