COVARIANCE.S in WPS Spreadsheet: Sample Covariance and the n − 1 Divisor
Calculate sample covariance, distinguish it from population covariance and check a small paired dataset by hand.
Verification status: See the evidence and test scope described in this guide. How formula examples are checked
Quick answer: =COVARIANCE.S(A2:A4,B2:B4) estimates sample covariance using the n − 1 divisor. For x = 2, 4, 8 and y = 5, 11, 12, the independent expected result is 29/3, approximately 9.666666667.
Syntax and choosing the statistic
=COVARIANCE.S(array1,array2)
Both arguments are required and have no defaults. They identify the two aligned numeric series. WPS describes integer cell ranges; the examples stay within that documented input scope. Choose the sample statistic when the rows are a sample used to estimate covariance in a larger population. Choosing a function merely because its result is larger is not a statistical justification.
For n usable pairs, add their centered cross-products and divide by n − 1. At least two pairs are needed for this denominator. Do not substitute n: that produces the population statistic instead.
Example: reproduce the intact vendor array with cells
Enter:
| Row | A: x | B: y |
|---|---|---|
| 2 | 2 | 5 |
| 3 | 4 | 11 |
| 4 | 8 | 12 |
In F2 enter =COVARIANCE.S(A2:A4,B2:B4). Independent expected result: 9.66666666666667, subject to display rounding.
The x mean is 14/3 and the y mean is 28/3. Centered products are 104/9, −10/9 and 80/9; their sum is 58/3. Divide by two to obtain 29/3. The official lesson’s intact array formula gives 9.666666667, consistent with this calculation. Its separate extracted cell table shows 1.2 in place of 12; this guide uses the intact array, not that damaged transcription.
Advanced example: read the sign and scale
Add C2:C4 = 12, 6, 5, so each C value equals 17 minus its B value. Add D2:D4 = 10, 22, 24, twice B. Put the formulas in F3:F5:
| Formula | Independent expected result |
|---|---|
=COVARIANCE.S(A2:A4,C2:C4) |
−29/3, about −9.666666667 |
=COVARIANCE.S(A2:A4,D2:D4) |
58/3, about 19.333333333 |
=COVARIANCE.S(A2:A4,A2:A4) |
28/3, about 9.333333333 |
The first transformation reverses the direction; the second doubles the measurement scale. Neither says anything about causality. The final result is sample variance of x, a useful self-pairing check.
For these three pairs the population counterpart is 58/9, about 6.444444444. The sample value is 3/2 times the population value because only the divisor changed. For an existing population-oriented walkthrough, see COVAR; this is not an assertion that COVAR and the dotted sample function are aliases.
Errors and practical limits
WPS documents #N/A when the numbers of data points differ, and #DIV/0! for an empty array or an array containing only one data point. Check usable numeric observations, not just the number of selected rows. The lesson says text, logical values and empty reference cells are ignored and zeros are included. Mixed-type pairing details were not tested; remove invalid pairs together instead of relying on independent column cleanup.
Do not independently sort x and y. Preserve row identities, document the units of each variable, and keep full numeric precision in the source cells. Rounding the displayed result is different from rounding the underlying observations before calculation. Covariance is measured in the product of the units and cannot directly compare differently scaled variables. CORREL is a related scale-free linear summary, with its own assumptions and boundaries.
Availability, version history and evidence
The official WPS COVARIANCE.S lesson was published 2020-09-02 and labels its applicable edition WPS Office for Windows Personal. The lesson was checked on October 19, 2026. This establishes a documented-by date, not the release in which the function first appeared. No numeric build, last supported version or retirement date is established. Mac, Linux, web, mobile and global-English edition parity are unverified.
Original expected results here are independent calculations or explicitly labelled test expectations, not native WPS execution. No WPS screenshot or installed-build test is claimed. Formula separators and displayed decimal precision can depend on the target setup; verify the exact function name in that installation before distributing a workbook.