VAR Function in Calligra Sheets: Sample Variance
Use Calligra Sheets VAR to calculate sample variance, compare VARIANCE and VARP, and audit n−1 in a reproducible numeric worksheet.
Verification status: Official documentation referenced; example outcomes independently reasoned or arithmetically checked where stated. Not executed in Calligra Sheets. How formula examples are checked
Quick answer: VAR estimates sample variance from numeric observations, dividing the total squared deviation from the sample mean by n−1. The official examples include VAR(6;7;8) → 1 and VAR(12;5;7) → 13. VARIANCE is also registered, but delegates to the same implementation as VAR; both names are covered by this guide. [K1, K2, K3, K6, I1]
Validation, 2026-10-13: KDE handbook, XML, C++ registration and ValueCalc helpers were inspected. No installed Calligra version was run; tables contain independently calculated, not observed, values.
Exact syntax, argument count and synonyms
=VAR(value1; [value2]; ...)
=VAR(A2:A9)
=VARIANCE(A2:A9) — separately registered synonym, same sample-variance implementation
value1(one formula argument required): a numeric literal, cell reference or array/range containing numeric observations.setParamCount(1,-1)andsetAcceptArray()establish one-or-more formula arguments with array input accepted in the 26.08.2 code. A one-cell range is syntactically accepted but at least two numeric observations are mathematically required for sample variance. [K2, K3]value2, remaining arguments (optional): extra numbers/references/ranges. Variance is independent of observation order for the same multiset of valid numeric values. The C++ registration does not declare a fixed argument maximum, but installed limits have not been measured. [K2, I1]- Return type: a nonnegative numeric sample-variance value for valid numerical data. Unlike standard deviation, its units are squared: if observations are metres, variance is m². [K1, I1]
- No optional population flag:
VAR/VARIANCEalways choose the sample divisorn−1;VARPseparately chooses the population divisorn. [K2, K3] - Synonym: XML says VARIANCE is the same as VAR; both registrations point at
func_variance. VARIANCE is an accepted function name covered in this guide. [K2, K6] - Input notation and defaults: the English handbook shows
;between literals, decimal point., and:in range references. There is no default argument giving a different estimator; no runtime locale tests were performed. [K1, K6]
Mathematically, with mean x̄ = Σxᵢ/n:
sample variance = SUM((xᵢ − x̄)^2) / (n − 1) when n ≥ 2
Calligra’s pinned func_variance checks calc->count(args,false) < 2 and internally returns Value::errorVALUE() in that case. Otherwise it obtains a func_devsq numerator and divides by count−1. This verifies the algorithm in source, not the exact visible error label in the application. [K3]
Step-by-step numeric worksheet — eight data points
- Start a blank Calligra Sheets worksheet and type A1=
Sample measurement. - Enter the numbers shown below, as numeric cells, into A2:A9; they intentionally include repeated values.
- Enter each formula in H as shown. Do not put the output formulas inside A2:A9.
- Show enough decimals to compare sample and population variance values; the results below are expectations from independent arithmetic. [I1]
| A cell | Number | A cell | Number |
|---|---|---|---|
| A2 | 2 | A6 | 5 |
| A3 | 4 | A7 | 5 |
| A4 | 4 | A8 | 7 |
| A5 | 4 | A9 | 9 |
| Enter in | Formula | Independently expected result | Teaching point |
|---|---|---|---|
| H2 | =VAR(A2:A9) |
4.571428571429 | Sample variance = 32/7. |
| H3 | =VARP(A2:A9) |
4 | Population variance = 32/8. |
| H4 | =AVERAGE(A2:A9) |
5 | Mean for a manual audit. |
| H5 | =VARIANCE(A2:A9) |
4.571428571429 | Exact implementation synonym. |
| H6 | =STDEV(A2:A9)^2 |
4.571428571429 | The square of sample SD equals sample variance (rounding aside). |
| H7 | =VAR(12;5;7) |
13 | Official KDE numeric example. |
| H8 | =VAR(6;7;8) |
1 | Official KDE numeric example. |
| H9 | =VAR(15;80;3) |
1716.333333333333 | Wide-spread sample. |
| H10 | =VAR(5;5) |
0 | Repeated observations, no spread. |
| H11 | =VAR(-2;0;2) |
4 | Negative values are valid numeric data. |
| H12 | =COUNT(A2:A9) |
8 | Numeric observation count in this dataset. |
Explain the denominator: A2:A9 has mean 5. Deviations from the mean are −3,−1,−1,−1,0,0,2,4; squares total 32. The sample variance is 32/(8−1) = 32/7 ≈ 4.571428571429. Treating the same eight observations as the entire population yields VARP = 32/8 = 4. The difference is intentional, not a rounding bug. [K3, I1]
Advanced method 1 — manual reproducible check with fixed references
- In B1 type
Squared deviation; in B2 enter=(A2-$H$4)^2and copy through B9. Expected results: 9, 1, 1, 1, 0, 0, 4, 16. [I1] - In H13, enter
=SUM(B2:B9)→ 32. - In H14, enter
=H13/(H12-1)→ 4.571428571429; this agrees mathematically with H2. [I1] - For a competing population calculation, in H15 enter
=H13/H12→ 4, agreeing with H3. [I1]
The $H$4 absolute reference prevents copying the formula from silently shifting the mean to an unrelated cell. The explicit COUNT avoids misreading the number of formula arguments (one range) as the number of numeric observations (eight).
Advanced method 2 — compare dispersion across two groups
Create two side-by-side independent samples in D2:D5 = 2,4,4,4 and E2:E5 = 5,5,7,9. Enter G2==VAR(D2:D5) and G3==VAR(E2:E5). The independent expectations are 1 and 3.666666666667, respectively. Both estimates require n−1 = 3. [I1]
A pooled within-group variance estimate, appropriate only when it makes statistical sense to assume a shared variance, is:
=((COUNT(D2:D5)-1)*VAR(D2:D5)+(COUNT(E2:E5)-1)*VAR(E2:E5))
/(COUNT(D2:D5)+COUNT(E2:E5)-2)
Enter it as a single formula on one line (remove the displayed line break); expected 2.333333333333. This is not the variance of all eight observations in A2:A9, because the pooled method excludes between-group mean differences. State the statistical assumption when using this technique in a report. [I1]
Errors and troubleshooting — source versus runtime
| Case | Established behavior or next action | Confidence |
|---|---|---|
| One or zero accepted numeric observations | The version-pinned func_variance explicitly returns internal Value::errorVALUE() for count<2. The rendered error text is not verified. |
Source-level only. [K3] |
VAR(5;5) returns 0 mathematically |
Identical values have zero squared deviations; requires at least two observations. | Independently calculated. [I1] |
VAR differs from VARP |
Check if data are a sample or the entire population; divisors differ. | Official documentation and source. [K1, K3] |
VARIANCE versus VAR |
Both names are registered to the same implementation; same sample-variance operation. | Official XML and C++ registration. [K2, K6] |
| Wrong units | VAR produces squared measurement units; STDEV restores original units. | Mathematical implication. [I1] |
| Blanks, text, booleans, formula errors | Non-A numeric count and deviation walk are present, but every visible coercion/error branch has not been tested in Sheets. | Native test required. [K3, K4] |
| Wrong delimiter or formula shown as text | Check leading =, number/cell format, separator conventions of local installation. |
English documentation only. [K1] |
| Function missing in installed build | Verify the statistical module and your Calligra edition/package; release registration alone is not execution. | Source evidence, native status unknown. [K2] |
| Huge magnitudes / many observations | Audit precision and overflow with your actual installed software before publishing claims. | Not benchmarked. |
Native validation checklist: VAR(10), VAR() or blank inputs, text/Boolean reference versus literal behavior, error-valued cells, multiple numeric ranges, localized separators, big/small floats, and VARIANCE consistency with VAR in actual Calligra 26.08.2. The exact displayed error and import/export spelling are still unresolved.
Version and cross-spreadsheet compatibility
The Calligra registration contains both VAR and VARIANCE, with the same function pointer; this fact should not be confused with how another spreadsheet imports formulas. Microsoft documents modern VAR.S and legacy VAR as sample variance, and VAR.P as population variance. Those are Excel compatibility references; they do not prove that Calligra recognizes a dotted formula name like VAR.S, that files round-trip between products, or that text and Boolean semantics match. [K2, M1]
Use VARP in KDE’s official manual for whole-population variance, STDEV to get sample standard deviation rather than variance, and AVERAGE for the mean. Unlike VARIANCE, VARP is not a synonym and has a different denominator. [K1–K3]
Source and execution boundaries
Version examined: Calligra 26.08.2, issued 2026-10-08, with C++ source pinned at commit 72123cc643f6625351139e7df294544255a1056f. The long-lived KDE handbook has an older displayed revision (2013-03-11); the version-pinned registration and engine define the behavior investigated here. Source presence is not evidence that a particular Linux distribution package, Flatpak, edition or platform successfully executes the formula. The official Calligra download page describes Linux distribution packages/Flatpak and Windows support as in progress. [K1–K5]
All outputs in the worksheet tables are independently calculated expectations, not recorded Calligra application results. The data are deliberately plain numeric constants to avoid unverified text, Boolean or date coercion. No screenshots, application runs, localized parser checks or import/export tests were conducted. [I1]
Related functions and documentation links
Official KDE handbook links inspected on 2026-10-13: AVERAGE — mean, COUNT — numeric items, SUM, SQRT, STDEV — sample standard deviation, STDEVP — population standard deviation, VAR — sample variance, VARIANCE — VAR-equivalent registration, VARP — population variance. [K1, K2]
References and evidence audit — accessed 2026-10-13
- [K1] KDE official Sheets function handbook: exact function purpose, English argument separator/decimal notation, printed examples and named related functions. https://docs.kde.org/stable_kf6/en/calligra/sheets/functions.html
- [K2] Calligra 26.08.2 registration:
statistical.cppregistrations,setParamCount(1,-1),setAcceptArray(), distinct variants, and VAR/VARIANCE shared implementation. https://github.com/KDE/calligra/blob/72123cc643f6625351139e7df294544255a1056f/sheets/functions/statistical.cpp#L330-L410 - [K3] Calligra 26.08.2 implementation wrappers: population standard deviation delegates to
stddevP(args,false)(lines 2558–2560), and VAR/VARP usefunc_devsqwith divisorscount−1andcountrespectively (lines 2921–2955). https://github.com/KDE/calligra/blob/72123cc643f6625351139e7df294544255a1056f/sheets/functions/statistical.cpp#L2542-L2569 · https://github.com/KDE/calligra/blob/72123cc643f6625351139e7df294544255a1056f/sheets/functions/statistical.cpp#L2918-L2967 - [K4] Calligra 26.08.2 engine:
ValueCalc::stddevversusValueCalc::stddevPnear lines 2391–2440 and numeric-count helper near 2241–2252; check exact error propagation with native tests. https://github.com/KDE/calligra/blob/72123cc643f6625351139e7df294544255a1056f/sheets/engine/ValueCalc.cpp#L2391-L2440 · https://github.com/KDE/calligra/blob/72123cc643f6625351139e7df294544255a1056f/sheets/engine/ValueCalc.cpp#L2241-L2252 - [K5] Official KDE Gear 26.08.2 announcement, dated 2026-10-08, and official Calligra platform/download information. https://kde.org/announcements/gear/26.08.2/ · https://calligra.org/download/
- [K6] Version-pinned KDE statistical XML, including sample versus population descriptions and explicit official examples for
STDEVP,VAR,VARIANCE,VARP. https://github.com/KDE/calligra/blob/72123cc643f6625351139e7df294544255a1056f/sheets/functions/statistical.xml - [M1] Microsoft Excel compatibility documentation (comparison only, not evidence of Calligra parser/import behavior): modern
STDEV.P,VAR.S,VAR.P; legacySTDEVP,VAR,VARPseparately documented. https://support.microsoft.com/en-us/excel/functions/stdev-p-function · https://support.microsoft.com/en-us/excel/functions/var-s-function · https://support.microsoft.com/en-us/excel/functions/var-p-function - [I1] Independent arithmetic audit on 2026-10-13: two methods—Python
statistics.pvariance,statistics.variance,statistics.pstdev,statistics.stdevand direct centered-square sums divided by n or n−1—agreed to numerical tolerance on each test set. No installed Calligra execution was made.