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)| Argument | What it means | |
|---|---|---|
database | Required | The list including its header row. |
field | Required | The numeric column to analyse. |
criteria | Required | The 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)
| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | Dept | Name | Years | Salary | ||
| 2 | Sales | Ana | 3 | 42000 | 16083333.33 | |
| 3 | IT | Ben | 7 | 58000 | ||
| 4 | Sales | Carla | 5 | 46500 | ||
| 5 | IT | Dev | 2 | 49000 | ||
| 6 | HR | Eli | 9 | 51000 | ||
| 7 | Sales | Fay | 1 | 38500 | ||
| 8 | ||||||
| 9 | Dept | |||||
| 10 | Sales |
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
| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | Dept | Name | Years | Salary | ||
| 2 | Sales | Ana | 3 | 42000 | 46562500 | |
| 3 | IT | Ben | 7 | 58000 | ||
| 4 | Sales | Carla | 5 | 46500 | ||
| 5 | IT | Dev | 2 | 49000 | ||
| 6 | HR | Eli | 9 | 51000 | ||
| 7 | Sales | Fay | 1 | 38500 | ||
| 8 | ||||||
| 9 | Years | |||||
| 10 | >=3 |
Result: 46562500
Four salaries qualify; their sample variance is 46562500.
Common errors and how to fix them
| Error | Why it happens | Fix |
|---|---|---|
#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.
| Language | Function name |
|---|---|
| Czech | DVAR.VÝBĚR |
| Danish | DVARIANS |
| Dutch | DBVAR |
| Finnish | TVARIANSSI |
| French | BDVAR |
| German | DBVARIANZ |
| Hungarian | AB.VAR |
| Italian | DB.VAR |
| Norwegian (Bokmål) | DVARIANS |
| Polish | BD.WARIANCJA |
| Portuguese (Brazil) | BDVAREST |
| Portuguese (Portugal) | BDVAR |
| Russian | БДДИСП |
| Spanish | BDVAR |
| Swedish | DVARIANS |
| Turkish | VSEÇVAR |