Contact

SLOPE Function (Gnumeric)

Statistical Intermediate Gnumeric

Learn the SLOPE function in Gnumeric: Returns the slope of the linear regression line.

Verification status: See the evidence and test scope described in this guide. How formula examples are checked

Availability and version history

  • Introduced: Documented by 1.12.62; original introduction not established.
  • Availability: Supported in Gnumeric 1.12.62, based on the function-specific registration.
  • Scope: Desktop; the fn-stat function module must be included and enabled.
  • Checked: October 14, 2026. Documentation/source check; no new native test in Gnumeric 1.12.62.

Purpose and interpretation

SLOPE estimates the coefficient m of a best-fitting straight line ŷ = m×x + b from paired numerical observations. It answers: How many Y-units are predicted to change for each one-unit increase in X? For a line fitted to training hours (X) and scores (Y), a positive slope means higher predicted scores as hours rise. A negative slope means the opposite. This is a descriptive least-squares association, not proof that changing X causes changes in Y. Gnumeric documents the function and its argument order in the official Statistics reference. [S1]

Exact syntax, position and defaults

=SLOPE(known_ys,known_xs)
Position Official argument Required type and meaning Optional? / default
1 known_ys A series/range/array of numeric Y responses, e.g. B2:B6 Required; no default
2 known_xs A corresponding numeric X series, e.g. A2:A6 Required; no default

The function requires two arguments, with Y before X. It does not include an intercept or affine switch; a separate INTERCEPT function is available for the line’s constant. A denominator or confidence option cannot be passed as a third argument. [S1]

Reproducible worksheet: five paired observations

Enter the values below as numbers, not text. Row 1 consists of labels; exclude row 1 from every formula. Each row is one observation, so a sort must move its X and Y cells together. Column C is an ideal straight line; column D is reverse-ranked X for additional comparisons.

Row A: Training hours (X) B: Assessment score (Y) C: Perfect-fit Y D: Reverse-ranked X
1 Hours Score Reference line Reverse
2 1 2 3 5
3 2 3 5 4
4 3 5 7 3
5 4 4 9 2
6 5 6 11 1

Use the ranges A2:A6 for X, B2:B6 for observed Y, C2:C6 for a perfect linear Y of 2X+1, and D2:D6 for a perfect negative linear relationship with X. The entries in C and D are fixed input numbers for this reproducible table; they are not outputs from an application session. This is a small instructional dataset, not an empirical or predictive validation study.

For independent checking, the five observations have n = 5, mean(X) = 3, mean(Y) = 4, Σ(X−3)² = 10, Σ(Y−4)² = 10, and Σ(X−3)(Y−4) = 9. Consequently the best-fit line is Ŷ = 1.3 + 0.9X, the Pearson correlation is 0.9, and its square is 0.81. The residual sum of squares is 1.9. All example outputs below were independently calculated in Python and cross-checked algebraically, not observed in Gnumeric.

Worked formulas: independent expected outputs

Enter this formula Expected value Explanation
=SLOPE(B2:B6,A2:A6) 0.9 The estimated score gain per additional hour.
=SLOPE(C2:C6,A2:A6) 2 Data from the exact line Y = 2X + 1.
=SLOPE(D2:D6,A2:A6) -1 Perfect inverse linear relation for the reverse-ranked values.
=SLOPE(A2:A6,B2:B6) 0.9 This toy sample happens to give the same value when axes are exchanged only because both datasets have identical deviation sums of squares (10). Do not generalize; slopes ordinarily change under reversal.

Independent least-squares derivation, using the five original A/B pairs:

x̄ = 3; ȳ = 4
Σ(x−x̄)² = 4 + 1 + 0 + 1 + 4 = 10
Σ(x−x̄)(y−ȳ) = 4 + 1 + 0 + 0 + 4 = 9
m = Σ(x−x̄)(y−ȳ) / Σ(x−x̄)² = 9 / 10 = 0.9
b = ȳ − m×x̄ = 4 − 0.9×3 = 1.3

This formula is the conventional simple least-squares slope. Its arithmetic is independently checkable, but Gnumeric has not been executed in this review.

Advanced use: build a change-sensitive forecast

A training coordinator can estimate the expected score for a hypothetical sixth hour without typing the slope separately:

=SLOPE(B2:B6,A2:A6)*6+INTERCEPT(B2:B6,A2:A6)

Independently expected: 6.7 points (0.9×6 + 1.3). This extrapolation is outside the observed 1–5-hour range; forecasts can be unreliable if the true relationship bends or changes. To build an auditable model instead, put =SLOPE($B$2:$B$6,$A$2:$A$6) in H2 and =INTERCEPT($B$2:$B$6,$A$2:$A$6) in H3, then use =$H$2*A2+$H$3 in E2 and fill to E6. The five fitted values are 2.2, 3.1, 4, 4.9, 5.8. Do not mistake these fitted numbers for observed scores.

For a quick audit, place =B2-E2 in F2 and fill down. Expected residuals are −0.2, −0.1, 1.0, −0.9, +0.2. Their sum is approximately zero and their squared sum is 1.9; that gives an independent cross-check for STEYX without repeating another product’s implementation assumptions.

Exact-release source note: The official 1.12.62 source archive was checksum-verified. In src/collect.c, these paired-range functions receive GNM_ERROR_VALUE as the fallback: no accepted pairs, unequal collected lengths and failed numeric callbacks therefore follow a #VALUE! source path. Some manual entries instead name #N/A or #DIV/0 for empty/mismatched/constant inputs. Those manual tokens below are documentation claims, not confirmed runtime outcomes; the actual installed build was not executed.

Errors specifically documented by Gnumeric

  • #N/A: according to the official SLOPE entry, missing data in either vector or differing numbers of data entries produce this error. Check row counts and truly aligned pairs before interpreting a result.
  • #DIV/0: if the variance of the X observations is zero, the slope denominator is zero. Example: replace all X in A2:A6 with 3 and use =SLOPE(B2:B6,A2:A6); this is an official documented outcome if those entries are numeric, but this change was not executed here.
  • No two aligned numeric points: no meaningful line can be calculated; the exact error for every malformed or mixed-type variant requires native QA. Do not invent additional error codes.

Input quality, limits, and troubleshooting

  • Order and pairing: the first vector of known_ys is the dependent Y variable, followed by known_xs (independent X); RSQ accepts first and second arrays and is symmetric for valid aligned numeric inputs. Select matching cell ranges representing the same rows. Do not independently sort just one column or silently shift one range.
  • Numbers versus text: enter actual numeric cells. Labels must remain outside formula ranges. The official Statistics documentation does not specify every detail of coercion and alignment for each regression function; if you have text such as '5, blanks, TRUE/FALSE, errors, or mismatched shapes, clean or pair-filter the data and test the result in your installed Gnumeric. Do not assume such entries become zeros or new pairs by row position.
  • Missing values: rather than filling blanks with zero or relying on unverified pair-omission semantics, build a contiguous two-column table of complete observations. Preserve each record’s identity during filtering and sorting; the apparent fit can change dramatically if pairs are misaligned.
  • Mathematically undefined regressions: a zero-variance X vector contains no information about slope; constant Y makes some correlation calculations undefined. One or two valid observations are also insufficient for meaningful regression uncertainty. The exact displayed Gnumeric error is not assumed unless its official reference explicitly specifies it.
  • Error-valued cells: upstream #VALUE!, #N/A, etc. can invalidate calculations. Repair the referenced inputs instead of wrapping the entire calculation in a blanket error replacement that might hide a damaged dataset.
  • Decimal display and separators: these examples use English function names, a comma between arguments, and a period for decimal numbers, as illustrated in Gnumeric’s manual. Its locale is derived from the operating system. If your installed configuration differs, use the formula syntax and number formats accepted there; no alternate-locale parser was executed in this review. [S3]
  • Rounded results: the decimal outputs below are display approximations from exact input integers. Use additional displayed precision to compare calculations; a tiny floating-point difference alone is not proof of changed statistical logic.

INTERCEPT supplies the Y-intercept of the same fitted line (1.3 here); RSQ returns the squared Pearson correlation (0.81) and describes linear fit strength rather than Y-units per X-unit. STEYX gives the residual standard error (≈0.7958224258); a high slope with large unexplained residual variation does not prove a useful predictor. For multi-input regression, LINEST provides a richer model output, but its arguments and return-array semantics differ. [S1]

Compatibility, versions and evidence boundaries

The Gnumeric 1.12-series Statistics manual lists this function by name and explicitly labels it Microsoft Excel compatible. That statement supports broad function-level compatibility; it is not a substitute for checking edge cases, function-name translation, type coercion, or file interchange in Excel or another spreadsheet. The current official GNU/GNOME 1.12 release archive identifies 1.12.62 dated 2026-09-21 as the latest release in the reviewed source series. It does not prove that the website manual has been regenerated for that exact binary build. [S1], [S4]

Platform and availability: Gnumeric is a GNOME-family spreadsheet application currently released and packaged for Linux; do not assume an up-to-date maintained Windows build or that a plugin is available in every distribution package. The official public function catalogue lists this function as Complete / Basic (registration/implementation and an upstream test classification), not as a native run of the worked examples on this page. [S2], [S4]

Validation limits: Exact official 1.12.62 source was checksum-verified and inspected, and all displayed numbers independently recalculated. No native Gnumeric execution, screenshots, locale regression or workbook round-trip tests were performed.

Dated source notes — checked 2026-10-13 UTC