CORREL Function (OpenOffice Calc)
Use CORREL in Apache OpenOffice to measure signed linear association, with paired ranges, reproducible coefficients and constant-input warnings.
Verification status: Eight reference formulas and 3 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: =CORREL(B4:B8;A4:A8) returns approximately 0.774596669241 for the worksheet below.
Availability and version history
- Introduced: First release not established. The OpenOffice.org 3.3 appendix documents CORREL; 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
CORREL measures the direction and strength of linear association between paired observations. Its mathematical range is −1 through 1. Positive values describe an increasing linear association, negative values a decreasing one, and values near zero weak linear association. Function entry.
Syntax and data requirements
=CORREL(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 |
|---|---|
=CORREL(B4:B8;A4:A8) |
0.774596669241 |
=CORREL(A4:A8;B4:B8) |
0.774596669241 |
=CORREL(C4:C8;A4:A8) |
-1 |
=CORREL(D4:D8;A4:A8) |
0.774596669241 |
=CORREL(E4:E8;A4:A8) |
1 |
=CORREL(B4:B7;A4:A7) |
0.71818484646 |
=CORREL(B5:B8;A5:A8) |
0.4472135955 |
=CORREL(A4:A8;A4:A8) |
1 |
Practical calculation
For X in A4:A8 and Y in B4:B8, means are 3 and 4. The centered cross-product sum is 6, and the individual centered sums of squares are 10 and 6. Therefore r=6/SQRT(10×6), approximately 0.774596669241.
Put =CORREL(A4:A8;B4:B8) in a clearly labeled result cell. A scatter plot of these five pairs is a useful companion because the coefficient cannot reveal every pattern, individual outlier or separate cluster. Keep each X/Y pair on the same row.
Advanced checks and interpretation
Shifting Y by 10 leaves r unchanged, as columns B and D demonstrate. Multiplying one variable by a positive constant preserves r; a negative multiplier reverses its sign. Columns C and E show perfect negative and positive lines, returning −1 and 1.
Zero correlation does not imply independence. In a separate example X=−2,−1,0,1,2 and Y=X², the centered cross-product sum is 0 even though Y is completely determined by X. A straight-line summary misses that nonlinear relation. Correlation also does not by itself establish causality or a direction of prediction.
Boundaries and troubleshooting
The source rejects a zero centered sum of squares in either variable with a division-by-zero error. One usable pair is therefore insufficient, and an all-constant variable has no defined Pearson coefficient. Shape mismatch is a separate invalid-argument condition. A numerical zero coefficient is not the same as an error.
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 |
|---|---|
=CORREL(A4:A8;F4:F8) |
#DIV/0! |
=CORREL(A4:A7;B4:B8) |
Err:502 |
=CORREL(A4:A4;B4:B4) |
#DIV/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.