DVAR Function
Estimates the variance of matching records, treating them as a sample.
Category
Database
Available in
All versions, Microsoft 365
Returns
A number
Want to practice DVAR in a real spreadsheet? Open a blank sheet in our Practice Sandbox and try it with live data, with the AI Excel tutor beside you. No Excel needed — just a free account.Try it free in the Sandbox
Overview
DVAR returns the variance — the average squared distance from the mean — for the matching records, treated as a sample (divides by n − 1, like VAR.S).
Variance is the standard deviation squared; DSTDEV is usually easier to read because it's in the same units as the data.
Syntax
=DVAR(database, field, criteria) Explain
Arguments
| Argument | Required? | What it does |
|---|---|---|
| database | Yes | The whole list, including the header row — e.g. A1:E7. Each row is a record, each column a field. |
| field | Yes | Which column to calculate: its header in quotes ("Sales"), a cell holding the header, or its position (5 = the fifth column). |
| criteria | Yes | A small range with at least one header copied exactly from the list and the conditions underneath, e.g. G1:G2. |
Examples
Example 1 — Variance of Paper sales
The same three Paper sales: 520, 325 and 390.
G5fx=DVAR(A1:E7,"Sales",G1:G2)
| A | B | C | D | E | F | G | |
|---|---|---|---|---|---|---|---|
| 1 | Region | Rep | Product | Units | Sales | Product | |
| 2 | North | Amara | Paper | 40 | 520 | Paper | |
| 3 | South | Ben | Toner | 12 | 576 | ||
| 4 | North | Chloe | Toner | 8 | 384 | Variance | |
| 5 | East | Dev | Paper | 25 | 325 | 9858.33 | |
| 6 | North | Amara | Pens | 100 | 120 | ||
| 7 | South | Ella | Paper | 30 | 390 |
=DVAR(A1:E7,"Sales",G1:G2) Explain
99.29 (the DSTDEV answer) squared is 9,858.33.
Common mistakes
- #DIV/0! Fewer than two numbers matched.
Notes
- Criteria rules: conditions on the same row must all be true (AND); conditions on separate rows are alternatives (OR). Text such as Nor matches anything that begins with it — type ="=North" for an exact match. Use >500, <>East, or wildcards like *Paper*.
- Related functions: DSUM, DAVERAGE, DCOUNT, DCOUNTA, DGET, DMAX, DMIN, DPRODUCT, DSTDEV, DSTDEVP, DVAR, DVARP.

Author
Kyle Stott
Certified Microsoft Excel Expert
Kyle has worked professionally with Microsoft Excel for over a decade and has consulted on and taught Excel best practices to over 400 companies across 30+ countries.