ONLYOFFICE PEARSON: Linear Correlation, Negative Trends and Curves
Understand Pearson correlation in ONLYOFFICE using negative linear data, a zero-correlation curve and a reproducible vendor example.
Verification status: See the evidence and test scope described in this guide. How formula examples are checked
Quick answer: =PEARSON(A2:A6,B2:B6) returns the Pearson product-moment correlation coefficient. With x values 1, 2, 3, 4, 5 and y values 17, 14, 11, 8, 5, the expected result is â1, a perfect negative straight-line relationship.
Availability and version history
- Introduced: The first introduction release and date are not established by the checked sources.
- Availability: Currently documented in ONLYOFFICE’s rolling function help; no final supported-version endpoint is established.
- Scope: Shared Spreadsheet Editor documentation. Exact availability in individual Docs, Desktop and mobile builds is not established by this page.
- Checked: October 14, 2026, against the official PEARSON reference. Examples were independently calculated and compared with the vendor screenshot; these cases were not tested in the native application.
Syntax and meaning
=PEARSON(array1, array2)
The official PEARSON reference requires two ranges containing the same number of elements. It says text, logical values and empty cells are ignored, while numeric zeros are included. Both arguments are required; there is no optional rank-correlation or significance-test mode.
For complete numeric pairs, Pearson’s r is the sum of centered xĂy products divided by the square root of the centered x-square and y-square sums. It measures linear association, not causation or the size of a change in original units. Swapping the two variables leaves r unchanged mathematically.
A negative relationship with visible intermediate values
Create a blank sheet named NegativeLine. Put x, y, x deviation, y deviation, Product, x square and y square in A1:G1. Enter A2:B6 using the table below:
| Row | A: x | B: y | Expected C | Expected D | Expected E | Expected F | Expected G |
|---|---|---|---|---|---|---|---|
| 2 | 1 | 17 | -2 | 6 | -12 | 4 | 36 |
| 3 | 2 | 14 | -1 | 3 | -3 | 1 | 9 |
| 4 | 3 | 11 | 0 | 0 | 0 | 0 | 0 |
| 5 | 4 | 8 | 1 | -3 | -3 | 1 | 9 |
| 6 | 5 | 5 | 2 | -6 | -12 | 4 | 36 |
Enter =AVERAGE(A2:A6) in I2 and =AVERAGE(B2:B6) in I3. Expect 3 and 11. Put =A2-$I$2 in C2, =B2-$I$3 in D2, =C2*D2 in E2, =C2^2 in F2 and =D2^2 in G2. Fill C2:G2 through row 6.
Use I5 =SUM(E2:E6), I6 =SUM(F2:F6) and I7 =SUM(G2:G6). Their expected totals are â30, 10 and 90.
In I9 enter =PEARSON(A2:A6,B2:B6); in I10 enter =I5/SQRT(I6*I7). Both mathematical results are â1. In I11 enter =PEARSON(B2:B6,A2:A6) to check the symmetric coefficient.
Here y=20â3x, so the slope is â3, but the correlation is â1. The coefficient cannot replace a slope when you need a prediction in y’s units.
Advanced: zero correlation can hide a perfect curve
Create a separate sheet named Curve. Put x and y in A1:B1. Enter â2, â1, 0, 1, 2 in A2:A6 and =A2^2 in B2; fill B2 through B6. The y values are 4, 1, 0, 1, 4.
In D2 enter =PEARSON(A2:A6,B2:B6). The independent expected result is 0, even though y is determined exactly by x². For a transparent check, put =A2*B2 in C2 and fill to C6; the products â8, â1, 0, 1, 8 sum to zero. The x mean is zero, so this also makes the centered product sum zero.
A zero coefficient here means no linear association, not no relationship. Plotting the five pairs reveals the U-shaped pattern immediately. Numeric zero in the middle row belongs in the data; it must not be discarded as if it were an empty cell.
Reproduce ONLYOFFICE’s rectangular-range example
Use a new blank sheet and enter the following four rows directly into A1:D4, with no header row:
| A | B | C | D |
|---|---|---|---|
| 1 | 0 | 0 | 0 |
| 0 | 2 | 0 | 0 |
| 0 | 0 | 3 | 0 |
| 0 | 0 | 0 | 4 |
Put =PEARSON(A1:B4,C1:D4) in D5. The independently expected coefficient is approximately â0.3069375160, which agrees with the official screenshot’s â0.306938.
Each range contains eight cells. Including all the zeros gives centered square sums 31/8 and 151/8, and a centered product sum of â21/8. Removing the zeros would change both the observations and the result.
Limits and common mistakes
Keep row and column correspondence intact. Use the same shape for your paired ranges even though the reference states the requirement as equal element counts. Do not separately sort, remove blanks from or filter one variable without preserving its partner.
Constant input series make the mathematical denominator zero. The short official page does not specify every native error for constant, incomplete, mismatched or erroneous inputs; this guide does not import another product’s error matrix.
A correlation is not a probability that one variable causes another, a percentage of correct predictions or a p-value. Outliers and a restricted observation range can substantially change it. Any inferential interpretation requires additional assumptions beyond calling this function.
CORREL is another documented correlation function. RSQ returns the squared coefficient, while SLOPE estimates the straight-line change in y per unit x. The SUM checks above make the underlying products visible.