VAR.S in Microsoft Excel: Sample Variance and Squared Units
Understand VAR.S and legacy VAR sample variance, denominator choice, direct-versus-reference inputs and migration cautions.
Verification status: See the evidence and test scope described in this guide. How formula examples are checked
Availability and version history
- Introduced: Microsoft marks this function as introduced in Excel 2010. Version-marker reference.
- Availability: Official help lists Excel for Microsoft 365, Excel for Microsoft 365 for Mac, Excel 2024, Excel 2024 for Mac, Excel 2021, Excel 2021 for Mac, Excel 2019, Excel 2016.
- Checked: October 14, 2026; official VAR.S reference. Documentation check, not a new native test; existing example-verification notes retain their scope.
Quick answer
Use VAR.S in Microsoft Excel to estimate variance from a sample, dividing the sum of squared deviations by n minus one. The working example below describes daily order totals; its result is measured in squared orders. The official reference supports the function’s identity and purpose.
This guide separates documentation review from application testing. The expected numbers are independently calculated, not screenshots or results captured from Microsoft Excel.
Syntax and arguments
VAR.S(number1, [number2], ...)
Numeric inputs: individual numbers or cell ranges holding the observations. One range can contain many observations; a header is not a measurement.
Additional inputs: optional extra numeric values or ranges. Omit the square brackets shown in the syntax notation when entering a formula. The numeric-only examples avoid relying on text or logical-value conversion.
When this calculation is useful
Use sample variance when the available observations represent a larger population and your analysis needs squared deviations. The n minus one denominator distinguishes it from population variance. This distinction is about the question being asked, not the number of rows or how many decimal places you display.
Variance is in squared input units. For measurements recorded in minutes, the result is in minutes squared, not minutes. Standard deviation is often easier to explain to a non-specialist because its units match the original data. Neither statistic alone establishes causation, a prediction interval or whether a particular observation should be discarded.
Set up the practice data
An operations workbook with one row per trading day provides the scenario. Enter the following numeric observations into A2:A9, one per row, with a header in A1. Use a spare result cell outside the input range.
| Cell | Orders |
|---|---|
| A2 | 240 |
| A3 | 180 |
| A4 | 420 |
| A5 | 240 |
| A6 | 300 |
| A7 | 540 |
| A8 | 120 |
| A9 | 360 |
Download the Microsoft Excel VAR.S practice data (CSV). Import it into a new, blank sheet starting at A1, with a comma as the file delimiter and the header row retained. The CSV contains input values only, not formulas or native test results. Blank spacer columns place the requested position in D2 and any additional test data in column F. Keep observations numeric rather than importing them as text.
Three worked examples
Example 1: Measure spread in the working register
=VAR.S(A2:A9)
Expected result: 18514.285714 (displayed to six decimal places).
The numeric count is 8, the mean is 300, and the sum of squared deviations is 129600. Divide by 7 (n minus one); the result is a variance in squared measurement units.
Example 2: Check the denominator with three known numbers
=VAR.S(2,4,6)
Expected result: 4.
The mean is 4 and the squared deviations are 4, 0 and 4, for a total of 8. The sample denominator is 2. Keep the fractional result during later calculations rather than rounding the input values.
Example 3: Check squared units when values are rescaled
For this check, use F2:F5 containing 0, 0, 80, 80, in that order. These values are included in the practice file.
=VAR.S(F2:F5)
Expected result: 2133.333333 (displayed to six decimal places).
These four observations have mean 40 and squared deviations totalling 6400. They are ten times the numbers 0, 0, 8, 8, so their variance is one hundred times as large. Both zeros still count as observations.
Advanced example: compare the denominators directly
For the original eight-day register:
=VAR.P(A2:A9)*COUNT(A2:A9)/(COUNT(A2:A9)-1)
Expected result: 129600/7, approximately 18514.285714, matching VAR.S on the same eight values. The population variance is 16200; multiplying it by 8/7 changes only the denominator convention.
Do not choose between sample and population variance based on which result looks more convenient. State which population the observations are intended to represent.
Advanced example: combine groups from their actual observations
=VAR.S(0,2)
=VAR.S(10,12)
=VAR.S(0,2,10,12)
Expected variances are 2, 2 and 104/3, approximately 34.666667. The combined mean is 6 and the squared deviations are 36, 16, 16 and 36, totaling 104.
Averaging the two subgroup variances would give 2 and omit the large separation between their means. Equal group sizes do not make that shortcut correct for the combined sample.
Advanced example: inspect a unit transformation
=VAR.S(2,4,6)
=VAR.S(-6,-12,-18)
=VAR.S(12,14,16)
Expected results are 4, 36 and 4. Multiplication by -3 multiplies the variance by 9, while adding 10 leaves variance unchanged. A negative input scale never makes a variance negative.
The square root of 36 is 6, the standard deviation of the scaled sample. That value has the transformed measurement units; the variance still has squared units.
Advanced check: report insufficient data explicitly
For a source range already inspected for errors:
=IF(COUNT(A2:A9)<2,"Insufficient numeric observations",VAR.S(A2:A9))
The eight original numeric observations select the normal result. A one-number control selects the explanatory text rather than misrepresenting an undefined sample variance as zero. Two identical observations, by contrast, have a defined sample variance of 0.
This selected-output model does not certify every internal branch-evaluation or mixed-error case. Keep an error check and the numeric count separate from the variance interpretation.
Check the mathematics and interpretation
Subtract the mean from each observation and square each difference. Add the squared differences and divide by n minus one. Do not take a square root when reporting variance; its units remain squared. This mathematical definition is used to check the numbers in the examples, independently of the spreadsheet software. Keep stored results at full available precision and round only the final presentation when a report requires it. The displayed expectations above are rounded where necessary; a different number of displayed decimal places is not by itself a calculation error.
Common mistakes and troubleshooting
The output looks much larger than the original measurements. Variance is expressed in squared units. Compare it with other variances using the same unit scale, not directly with an average expressed in the original units.
The sample has fewer than two numeric observations. The n minus one denominator is then unusable. Show that the data is insufficient rather than quietly substituting zero.
A very different value appears after an import. Check units, included records and numeric storage before changing the formula. A mixture of individual observations, totals and text-coded numbers is not a consistent statistical input. Do not average subgroup variances as though that automatically gives the combined variance.
Excel input placement and a controlled mixed-type check
Microsoft distinguishes values typed directly in the argument list from values inside a reference. Its reference rule excludes ordinary text, logical values and empty cells, while numeric-looking text and logical values typed directly as arguments are counted.
In a separate J2:J7 range enter 2, 4, 6, =“8”, =TRUE() and a genuinely empty cell, in that order. The numeric reference inputs are 2,4,6, so =VAR.S(J2:J7) has expected result 4 (rounded where needed).
By contrast:
=VAR.S(2,4,6,"8",TRUE)
The documented direct-argument conversion model includes 2,4,6,8,1. Their mean is 4.2 and squared deviations total 32.8, producing an expected result of 8.2. These independent type controls do not certify every locale’s text-number conversion.
The source also says reference error values are ignored while another sentence says error arguments cause errors. That wording is insufficient for a certified mixed-error rule here. No error-containing range result is asserted: inspect and resolve source errors separately before interpreting the statistic. Unusable direct text and direct errors are documented to cause errors, but their complete native error-code matrix remains untested.
Microsoft Excel notes and compatibility
The Microsoft function reference is the source for this guide’s Excel name and purpose. The reviewed Excel help distinguishes values supplied as arguments from values inside referenced arrays or ranges. Keep imported observations numeric rather than depending on automatic conversion of text or logical values.
For the daily order workbook, keep one comparable trading day per row. Exclude a grand-total row from the statistical input; it is not another trading day. When combining weeks, check that repeated dates are legitimate records rather than duplicated imports. The formula cannot make that distinction for you.
These examples use English function names and comma-separated arguments. A workbook configured for another regional separator may require semicolons. The data addresses stay the same. Test a copied formula on a small known input after an import or file conversion; this guide is not a certification of every Excel edition or exchange format.
For the same statistical question in other programs, see VAR.S in Google Sheets, VAR.S in ONLYOFFICE, VAR.S in SoftMaker PlanMaker. These links identify corresponding measures, not a guarantee that names, mixed-data rules, error codes or file conversions are identical.
Related functions and evidence
MEDIAN, LARGE, SMALL, RANK.EQ, STDEV.S, STDEV.P, VAR.P. Browse the Microsoft Excel function library for the other published guides.
Editorial verification: Complete article and direct Microsoft reference reviewed on October 14, 2026. All three original numeric examples, added arithmetic models, original CSV inputs and related links were checked independently. Exact approved availability/history text is retained. No native Excel execution, maximum-size benchmark or round-trip workbook certification was performed. Mixed-error coercion, unsupported input types and unassigned edge-case error codes remain explicitly unverified.
Legacy VAR compatibility contract
=VAR(number1,[number2],...) requires its first argument and accepts up to 255 number arguments in the current documentation; a range or array can supply many observations. It estimates sample variance, using denominator n−1. The documented renamed counterpart is VAR.S.
Microsoft distinguishes direct arguments from ranges: directly supplied logical values and numeric text are counted; blank cells, text and logical cells in references are ignored. Direct errors and unconvertible text cause errors. The legacy page also says referenced errors are ignored, which conflicts with Microsoft’s NA propagation guidance. Do not build a cleaning rule on that sentence; error-cell propagation requires native verification. The VARA family changes treatment of nonnumeric inputs and is not a spelling replacement.
Original legacy example and independent check
On a fresh sheet enter 2, 4, 6, 10 in A2:A5. =VAR(A2:A5) independently targets 11.6666666667. The mean is 5.5 and squared deviations sum to 12.25+2.25+0.25+20.25=35; the final calculation is 35/3. The result is in squared measurement units, not standard-deviation units.
Migration traps
Changing to the population counterpart changes the denominator from three to four for these four observations. Preserve the statistical purpose and the way inputs are supplied, rather than merely matching a familiar suffix. At least two usable numeric observations are needed for a nonzero sample denominator. The current legacy page does not enumerate an insufficient-data error code, so this mathematical constraint is not presented as a native error test. These independent sums and square roots do not certify floating-point equivalence across Excel versions.
Compatibility and verification scope
Checked October 19, 2026 against the Microsoft legacy VAR reference. Its current Applies To list includes Microsoft 365 (Windows/Mac), Excel 2024 and 2021 (Windows/Mac), 2019 and 2016. The Excel 2010 function-change reference places the renamed counterpart in that transition and retains old names for backward compatibility. This does not date the original legacy function’s introduction. Compatibility status is not retirement: no removal release or last-working build is established here. Keep old-workbook compatibility needs in view, test before migration, and do not assume identical numerical behavior across versions. This addition is a documentation review with independent calculations; it supplies no native Excel evidence.