RSQ in Calligra Sheets: R-Squared, Formula Examples and Limits
Use RSQ to calculate r-squared for paired observations in Calligra Sheets. Reproduce ten examples, understand residuals and see verified KDE error-handling discrepancies.
Verification status: See the evidence and test scope described in this guide. How formula examples are checked
Availability and version history
- Introduced: Documented by 26.08.2; original introduction not established.
- Availability: Supported in Calligra Sheets 26.08.2, based on the function-specific registration.
- Scope: The official application listing provides Linux installation; other packaged builds are unverified here.
- Checked: October 14, 2026. Documentation/source check; no new native test in Calligra Sheets 26.08.2.
Quick answer
Use RSQ to calculate the square of Pearson’s correlation coefficient between paired numeric observations. The result, r², describes how closely observations follow a straight-line relationship. For a single-predictor least-squares regression with an intercept, it also equals the fraction of sample response variation accounted for by the fitted line. That interpretation has conditions; it is not evidence of causation or future predictive accuracy.
=RSQ(B2:B6;A2:A6)
With the five exact pairs entered below, the independently calculated expected answer is 0.817567567568 (about 81.76%). This number was not obtained by executing Calligra Sheets. The function’s availability is established by its registration in the pinned Calligra 26.08.2 C++ source and KDE’s XML/help documentation; that is not a native runtime test.
Official syntax, order, types and defaults
=RSQ(known_y;known_x)
known_y— required: numeric dependent observations in a cell range/array; the first argument in KDE’s documentation and 26.08.2 registration.known_x— required: numeric independent observations paired in the same observation order asknown_y; the second argument.- Argument count: exactly two (
setParamCount(2)); the registration enables array input (setAcceptArray()). No optional parameter or default is registered. - Output: a floating-point r². The mathematical value is between 0 and 1 for ordinary finite nonconstant paired data; do not interpret near-1 as proof of cause or absence of overfitting.
- Argument order: although the documented interface takes y then x, mathematically squaring correlation is symmetric. Keep the documented order so a combined RSQ/SLOPE/STEYX worksheet remains understandable.
KDE’s function reference and pinned XML agree on RSQ(known Y; known X). The 26.08.2 registration accepts two arrays. The implementation calculates squared centered correlation from sums over successfully converted pairs, checks the underlying arrays’ Value::count() counts, and has a separate minimum-pair check. Native results for blanks, strings and error propagation have not been tested.
Formula separators and locale
KDE’s formula-entry instructions show semicolons separating arguments and an initial =. Enter the formulas as shown for that documented convention. A user’s language/locale may display decimal or argument separators differently; this research did not test specific non-English installations. For these examples, enter dot-decimal numeric constants only if the locale accepts them.
Build a five-row worksheet that you can check
In a blank sheet enter text headings in row 1, then exactly the numeric values shown in rows 2–6. Column A is the independent variable x, and column B is the response y. Columns C–I are optional numeric comparison series; they make the examples reproducible without reliance on outside data.
| Row | A · x | B · y | C · −y | D · 2x | E · y+10 | F · 2y | G · constant y | H · constant x | I · 3x+1 |
|---|---|---|---|---|---|---|---|---|---|
| 1 | x | y | −y | 2x | y+10 | 2y | constant y | constant x | 3x+1 |
| 2 | 1 | 2 | −2 | 2 | 12 | 4 | 5 | 3 | 4 |
| 3 | 2 | 3 | −3 | 4 | 13 | 6 | 5 | 3 | 7 |
| 4 | 3 | 5 | −5 | 6 | 15 | 10 | 5 | 3 | 10 |
| 5 | 4 | 4 | −4 | 8 | 14 | 8 | 5 | 3 | 13 |
| 6 | 5 | 7 | −7 | 10 | 17 | 14 | 5 | 3 | 16 |
Steps: (1) enter those values as numbers, not numeric-looking text; (2) select an unused result cell such as K2; (3) enter a formula with the leading =; (4) press Enter; (5) increase displayed decimal places when comparing to the independently computed expectations. Repeat in K3, K4, and so on. Do not sort only one of the original series: row pairing would be lost.
Ten reproducible formulas and independently calculated outputs
These are mathematical expectations for the exact table, not application-generated results. Rounding can affect the last decimal place.
| # | Formula for a blank result cell | Expected output | Why it is useful |
|---|---|---|---|
| 1 | =RSQ(B2:B6;A2:A6) |
≈ 0.817567567568 |
Baseline five-pair fit strength. |
| 2 | =RSQ(A2:A6;B2:B6) |
≈ 0.817567567568 |
r² is symmetric, although the documented interface names y first. |
| 3 | =RSQ(C2:C6;A2:A6) |
≈ 0.817567567568 |
Negating every y reverses r but not r². |
| 4 | =RSQ(B2:B6;D2:D6) |
≈ 0.817567567568 |
Multiplying every x by a positive constant leaves r² unchanged. |
| 5 | =RSQ(E2:E6;A2:A6) |
≈ 0.817567567568 |
Adding 10 to every y does not change r². |
| 6 | =RSQ(F2:F6;A2:A6) |
≈ 0.817567567568 |
Doubling every y preserves r². |
| 7 | =RSQ(I2:I6;A2:A6) |
1 |
Perfect linear relationship: I = 3A+1. |
| 8 | =RSQ(B2:B4;A2:A4) |
≈ 0.964285714286 |
Only the first three correctly paired observations. |
| 9 | =CORREL(B2:B6;A2:A6)^2 |
≈ 0.817567567568 |
Squared Pearson correlation cross-check using another documented Calligra function. |
| 10 | =121/(10*14.8) |
≈ 0.817567567568 |
Plain arithmetic cross-check, independent of RSQ execution. |
Verify the arithmetic independently
From A2:A6: x̄ = 3 and Sxx = Σ(x−x̄)² = 10. From B2:B6: ȳ = 4.2 and Syy = Σ(y−ȳ)² = 14.8. The paired deviation-product sum is Sxy = Σ(x−x̄)(y−ȳ) = 11. Therefore:
r = Sxy / SQRT(Sxx*Syy) = 11 / SQRT(10*14.8)
r² = 11²/(10*14.8) = 121/148 = 0.817567567568...
This calculation can be checked without assuming any specific spreadsheet’s handling of text, blanks or locale rules. A negative Pearson r would give the same positive r², so RSQ does not convey whether the slope is upward or downward. Consult SLOPE or CORREL for direction.
Advanced use: regression quality alongside residual spread
Imagine x as a week number and y as units sold. Fill the same numeric table first, then put this summary into unused K2:K6:
K2: =SLOPE(B2:B6;A2:A6)
K3: =INTERCEPT(B2:B6;A2:A6)
K4: =RSQ(B2:B6;A2:A6)
K5: =STEYX(B2:B6;A2:A6)
K6: =K2*6+K3
The independently expected results are slope 1.1, intercept 0.9, r² 0.817567567568, residual standard error 0.948683298051, and a line extrapolation for x=6 of 7.5. For each observed row use a helper cell such as L2 with =$K$2*A2+$K$3; copy down through L6 to produce the five fitted y values 2, 3.1, 4.2, 5.3, 6.4. Subtract fitted from observed values to obtain residuals 0, −0.1, 0.8, −1.3, 0.6; their squared sum is 2.7.
The r² of approximately 81.76% expresses in-sample linear fit, not a prediction interval for week 6 and not evidence that changing x causes y. With five observations, a single unusual value can shift the result substantially. Even a high r² can mask a curved trend or regime change; examine the raw paired data and a scatter plot.
Important errors, mismatches and limitations
- Documentation versus implementation mismatch for unequal array lengths. KDE’s published RSQ help says empty or differently sized arrays produce
#N/A. The pinnedfunc_rsqC++ instead returns internalValue::errorVALUE()when the Value::count() counts differ. That discrepancy is real at source level; neither final GUI label has been observed. Do not promise the exact on-screen error until native execution checks it. - Insufficient convertible pairs. The source explicitly returns internal
Value::errorNA()when fewer than two successfully converted pairs are accumulated. It attempts numeric conversion on both elements before counting a pair. Which text/Boolean/blank values qualify in the installed binary needs controlled native tests. - Constant x or constant y. The mathematical denominator becomes zero; r² is undefined. The examined
func_rsqcalculation does not perform a distinct explicit constant-series guard after its pair-count check. The resulting application-visible behavior, including division-by-zero handling and floating-point edge cases, remains unverified. - Paired values out of alignment. Never independently sort x and y, reverse only one column, or compare different observation periods. A plausible number can still be statistically meaningless if pairing is wrong.
- Two points are not persuasive. Any two distinct nonvertical points lie exactly on a line and mathematically yield r² = 1, but two observations provide little evidence about a general relationship.
- Mixed or nonnumeric cells. Excel’s coercion/exclusion rules are not Calligra evidence. Start with the all-numeric table here, then test your actual source data separately and document your specific Calligra build.
- Precision and extreme magnitudes. The C++ implementation forms sums of numbers and squares. Very large or nearly constant values can be numerically delicate; no high-magnitude native precision bounds were measured.
Troubleshooting sequence
Check the leading = and the exact spelling RSQ; confirm there are exactly two arguments separated as documented (;); verify the cell addresses and paired order; ensure all demo rows contain actual numbers; inspect whether any source cells contain an error; check that neither series is constant; increase displayed decimals before comparing expectations; and reproduce the five-row all-numeric baseline before assuming a platform-specific error code. The same procedure helps identify a pasted formula whose separators do not match your locale.
Compatibility and tested scope
Calligra evidence: KDE’s current handbook, version-pinned XML, C++ function registration and calculation logic were read on 2026-10-13 for Calligra 26.08.2 (KDE’s October 8, 2026 release announcement and app listing). The app listing offers Linux distribution/Flathub installation routes; the mere presence of a function in source does not establish identical behavior on every operating system, locale or packaging build.
Excel comparison, not proof of Calligra behavior: Microsoft’s RSQ reference documents the same statistic using comma-separated English Excel syntax and specifies error handling for its Excel product. The KDE help and pinned KDE implementation themselves disagree on one error condition; do not import Microsoft’s blank/text rules or GUI messages into this Calligra guide. XLSX import/export, localized names and cross-application parity were not tested.
Related functions and verified official references
- RSQ — KDE help and 26.08.2 C++.
- CORREL — KDE help provides signed Pearson r; PEARSON — KDE help is another officially registered name for that related computation.
- SLOPE — KDE help, INTERCEPT — KDE help and STEYX — KDE help complement r² in a line-fit assessment.
- KDE formula entry; 26.08.2 KDE release; Microsoft Excel RSQ (comparison only).
Evidence and validation status — 2026-10-13
Official KDE handbook/XML/26.08.2 source-level checks: completed. Independent arithmetic for the examples: completed. Native Calligra execution, locale testing, input-type/error display tests, XLSX round-trip: NOT performed.