COVAR Function (OpenOffice Calc)
Apache OpenOffice COVAR divides centered cross-products by n. Compare population and sample covariance with paired data, units and reproducible examples.
Verification status: Eight reference formulas and 2 listed boundary cases were recalculated in Apache OpenOffice 4.1.16 on Linux x86-64, Build 9816, after XLSX import, with retained ODS results. Other explanatory calculations are independent references. How formula examples are checked
Quick answer: =COVAR(B4:B8;A4:A8) returns approximately 1.2 for the worksheet below.
Availability and version history
- Introduced: First release not established. The OpenOffice.org 3.3 appendix documents COVAR; that is historical presence evidence.
- Supported in: Apache OpenOffice 4.1.16; no final supported release established.
- Scope: Desktop Calc. Formulas below use English names and semicolon argument separators, with complete numeric example ranges.
- Checked: October 14, 2026. The eight reference formulas were recalculated in Apache OpenOffice 4.1.16 on Linux x86-64, Build 9816, using XLSX import and hard recalculation. Source and independent arithmetic were also checked.
Meaning and units
COVAR computes population-form covariance: the sum of centered cross-products divided by the number of usable pairs n. A positive result indicates same-direction variation around the means; a negative result indicates opposite-direction variation. Its magnitude depends on the measurement units. Function entry.
Syntax and data requirements
=COVAR(Data1; Data2)
Exactly two arrays are required, with identical row and column dimensions. A row vector and a column vector of the same length are still different shapes. Keep paired observations aligned; dropping a value from only one side changes the relationship being analyzed. The release calculation logic is the authority for these contracts.
Reproducible worksheet
Enter this compact set of numeric observations starting in row 4. Column D is Y shifted by 10; C and E are exact straight-line transformations of X. Keep these labels outside the formula ranges.
| Row | A: X | B: Y | C: negative line | D: shifted Y | E: positive line | F: constant |
|---|---|---|---|---|---|---|
| 4 | 1 | 2 | 10 | 12 | 3 | 7 |
| 5 | 2 | 4 | 8 | 14 | 5 | 7 |
| 6 | 3 | 5 | 6 | 15 | 7 | 7 |
| 7 | 4 | 4 | 4 | 14 | 9 | 7 |
| 8 | 5 | 5 | 2 | 15 | 11 | 7 |
These eight formulas were recalculated in Apache OpenOffice 4.1.16 on Linux x86-64, Build 9816, after XLSX import. Saved ODS values match independent arithmetic; results below are rounded to twelve decimal places.
| Formula | Expected result, approximately |
|---|---|
=COVAR(B4:B8;A4:A8) |
1.2 |
=COVAR(A4:A8;B4:B8) |
1.2 |
=COVAR(C4:C8;A4:A8) |
-4 |
=COVAR(D4:D8;A4:A8) |
1.2 |
=COVAR(E4:E8;A4:A8) |
4 |
=COVAR(B4:B7;A4:A7) |
0.875 |
=COVAR(B5:B8;A5:A8) |
0.25 |
=COVAR(A4:A8;A4:A8) |
2 |
Practical calculation
For the five displayed X/Y pairs, the means are 3 and 4 and the centered cross-products sum to 6. =COVAR(A4:A8;B4:B8) returns 6/5=1.2.
If X is measured in hours and Y in units produced, covariance is in hours×units. Converting hours to minutes multiplies covariance by 60, to 72. That is a unit change, not stronger association. Standardizing both sides leads to a dimensionless correlation instead.
Advanced checks and interpretation
To obtain the usual sample covariance from these complete pairs, use =COVAR(A4:A8;B4:B8)*COUNT(A4:A8)/(COUNT(A4:A8)-1). The result is 1.5 because n/(n−1)=5/4. This conversion requires n>1 and the count of the same paired observations, not an unrelated column containing extra measurements.
=COVAR(A4:A8;A4:A8) equals population variance, 2. Shifting either sample by a constant does not change covariance. Scaling X and Y by factors a and b multiplies covariance by a×b. A negative factor can therefore reverse the sign. Unlike correlation, covariance has no universal −1-to-1 bound.
Boundaries and troubleshooting
At least one usable pair is needed. Unlike correlation, the population-form calculation can return 0 for one pair or a constant variable; that is not useful evidence for a population relationship from a single observation. Shape mismatch is rejected. A sample-covariance conversion separately requires at least two pairs.
The shared implementation calculates means first and then centered cross-products, avoiding the simplest raw-sum cancellation formula. That does not eliminate all floating-point limits for very large offsets or nearly constant data.
Selected boundary cases were checked in that same native session. Error displays are retained as errors, not interpreted as numeric zero.
| Formula | Native result or display |
|---|---|
=COVAR(A4:A4;B4:B4) |
0 |
=COVAR(A4:A8;F4:F8) |
0 |
Official evidence and checking scope
The saved ODS retained the tested formulas and numeric inputs. A deliberately stale SUM result and an uncached SUM formula confirmed recalculation. Native evidence covers the eight reference formulas and listed boundary cases in the stated 4.1.16 build; other explanatory calculations are independent references. Other releases, locales and import formats were not tested.