VAR in ONLYOFFICE Spreadsheet Editor
Calculate sample variance while accounting for ONLYOFFICE-specific direct text, Boolean and error handling, including a precise contrast with VAR.S.
Verification status: See the evidence and test scope described in this guide. How formula examples are checked
Quick answer: For numeric observations 2,4,6, =VAR(A1:A3) independently returns 4: squared deviations total 8, divided by the sample divisor 3ā1.
Availability and evidence scope
- Introduced: Original introduction release is not established by the checked sources.
- Available: Listed in current unversioned ONLYOFFICE help, checked October 18, 2026.
- Implementation inspected: Official SDKJS v10.0.0.169, commit
3679e0375a758d7dc59d31337a45461be3525ed8. The snapshot does not prove identical behavior in every installed editor. - Retired or deprecated: These sources do not establish retirement or formal deprecation.
- Testing: Numerical examples are independent mathematical expectations, and implementation discrepancies are labeled source predictions. No ONLYOFFICE application or calculation-engine execution was performed.
The examples use English function names and commas. Use your locale’s argument separator if different. Retain full precision in formulas; round only the displayed result. These examples establish only the stated mathematical or source-trace cases. Application rendering, array placement and general import/export behavior have not been tested.
Syntax and sample interpretation
=VAR(number1, [number2], ...)
At least one argument is required, with the inherited source maximum of 255 arguments. References and ranges can supply multiple observations per argument. The sample variance is the sum of squared deviations from the sample mean divided by nā1, where n is the number of included numeric observations. At least two included numbers are needed.
The output is in squared measurement units. If observations are in centimeters, variance is in square centimeters. The square root is a sample standard deviation in the original units. VAR is not the population-divisor calculation; using n rather than nā1 answers a different question about the specified data.
VAR and VAR.S agree for ordinary numeric-only data in the inspected source, but they are not interchangeable for all argument types. The direct-text contrast below is why this guide does not assume that a newer spelling is an exact implementation alias.
Step-by-step: verify a small variance by hand
- Put 2,4,6 vertically in A1:A3.
- Enter
=VAR(A1:A3)in a separate cell. - The independent expectation is 4.
- Check the mean: (2+4+6)/3 = 4.
- Squared deviations are (2ā4)²=4, (4ā4)²=0 and (6ā4)²=4. Divide their sum 8 by 3ā1=2.
The corresponding sample standard deviation is 2, while the variance using a population divisor would be 8/3. Label these quantities clearly. An identical set of values in a different order produces the same mathematical variance, because the calculation depends on deviations rather than observation order.
Direct arguments differ from values in ranges
The inspected VAR wrapper includes direct Boolean arguments by numeric conversion, so TRUE contributes 1 and FALSE contributes 0. Direct string and empty arguments are skipped. In a range or array, numeric elements are included, while text, Boolean and empty elements are excluded; error elements propagate.
| Formula | Included values in inspected VAR | Independent result |
|---|---|---|
=VAR(2,4,6) |
2,4,6 | 4 |
=VAR(2,4,"6") |
2,4 | 2 |
=VAR(2,4,TRUE) |
2,4,1 | 7/3 ā 2.333333333333 |
=VAR(2) |
Only one number | Source-predicted #DIV/0! |
Help/source discrepancy: Current help says direct text representations of numbers are interpreted numerically and that error values in arrays are ignored. The inspected VAR implementation instead skips direct strings and propagates range/array errors. Do not rely on the help’s broader coercion statement for this source snapshot. These are source predictions, not observed native outputs.
For a range containing 2,4 and an error from =1/0, VAR predicts propagation of #DIV/0!. This error is not evidence that only one numeric observation was present; it comes from the input error itself. Diagnose the source values rather than replacing errors indiscriminately.
Advanced example: compare VAR with VAR.S before migration
In the same source snapshot, VAR.S appends zero for a direct string or empty argument, where VAR skips it. Thus =VAR.S(2,4,"6") is source-predicted to calculate the sample variance of 2,4,0, giving 4, while =VAR(2,4,"6") gives 2. Neither case treats the quoted string as numeric 6 in that inspected branch.
This contrast does not mean every referenced string is converted to zero by VAR.S; references and arrays take other branches. Audit the actual argument forms before changing function names across a workbook. A safer numeric analysis uses a deliberately cleaned numeric input range and separately records excluded or invalid observations.
If observations are converted from centimeters to millimeters by multiplying each by 10, variance multiplies by 100. For the main dataset, 20,40,60 has sample variance 400. Adding the same constant to every observation does not change mathematical variance, although very large offsets can create floating-point issues. These invariants are useful checks on units and transformations.
Errors and statistical limits
With fewer than two included numeric values, the helper returns internal division_by_zero, conventionally #DIV/0!. Existing error arguments or error elements can also propagate. Zero is a valid numeric observation and counts toward n; a blank cell does not. A string that looks like zero is still subject to its input-path rules.
The implementation computes a mean and then squared deviations; it is a floating-point algorithm, not an arbitrary-precision guarantee. Extremely large values can overflow, and closely spaced values around a very large offset may lose precision. The small integer examples avoid those problems.
Choosing a sample variance does not establish that observations are independent or representative. Excluding text labels is ordinary data selection, but dropping error-bearing records or miscoded measurements can bias an analysis. Keep the data-selection rule explicit and do not interpret a small variance as proof that a process is stable over time.
Compatibility and related functions
Recalculate representative formulas when moving a workbook between editors. Matching names do not guarantee identical argument coercion, array behavior, numerical precision or error handling. These source-derived examples do not establish automatic spill behavior or a general import/export guarantee.
Official references
- ONLYOFFICE VAR help, checked October 18, 2026.
- Official SDKJS implementation, 12536ā12662, tag v10.0.0.169 and exact commit above.