SLOPE Function (OpenOffice Calc)
Apache OpenOffice SLOPE estimates y change per x unit. Verify argument order, fitted values and why reversing the regression is not generally reciprocal.
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: =SLOPE(B4:B8;A4:A8) returns approximately 0.6 for the worksheet below.
Availability and version history
- Introduced: First release not established. The OpenOffice.org 3.3 appendix documents SLOPE; 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
SLOPE fits the coefficient b in the ordinary least-squares line y=a+b×x. The response values come first and the predictor values second. The coefficient measures fitted response change per one predictor unit; it is not a correlation coefficient. Function entry.
Syntax and data requirements
=SLOPE(KnownY; KnownX)
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 first range is KnownY and the second KnownX; swapping them changes the fitted problem. 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 |
|---|---|
=SLOPE(B4:B8;A4:A8) |
0.6 |
=SLOPE(A4:A8;B4:B8) |
1 |
=SLOPE(C4:C8;A4:A8) |
-2 |
=SLOPE(D4:D8;A4:A8) |
0.6 |
=SLOPE(E4:E8;A4:A8) |
2 |
=SLOPE(B4:B7;A4:A7) |
0.7 |
=SLOPE(B5:B8;A5:A8) |
0.2 |
=SLOPE(A4:A8;A4:A8) |
1 |
Practical calculation
For Y in B4:B8 and X in A4:A8, =SLOPE(B4:B8;A4:A8) returns 0.6. The centered cross-product sum is 6 and X’s centered sum of squares is 10, giving b=6/10.
=INTERCEPT(B4:B8;A4:A8) gives 2.2. With x=6, =INTERCEPT(B4:B8;A4:A8)+SLOPE(B4:B8;A4:A8)*6 gives a fitted value of 5.8. This is an extrapolation beyond the observed X range 1–5; a valid formula does not establish that the linear pattern continues.
Advanced checks and interpretation
Swapping the arrays gives =SLOPE(A4:A8;B4:B8), which is 1, not 1/0.6. Ordinary least squares minimizes vertical residuals in its selected response direction, so the reversed fit generally differs from algebraically inverting the first fitted line.
Adding a constant to X or Y leaves the slope unchanged. Rescaling Y by a factor c scales the slope by c; rescaling X by c divides it by c, when c is nonzero. A coefficient reported in units per hour must therefore change when the predictor is converted to minutes. Keep units in the column headings.
Boundaries and troubleshooting
A constant predictor has zero centered sum of squares, so the evaluator reports division by zero. A constant response with varying predictor is different: slope is 0 and intercept is the response constant. Empty data and mismatched shapes have separate checks. Do not replace a failed fit with a zero coefficient.
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 |
|---|---|
=SLOPE(F4:F8;A4:A8) |
0 |
=SLOPE(A4:A8;F4:F8) |
#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.