DEVSQ Function (Gnumeric)
Learn the DEVSQ function in Gnumeric: Returns the sum of squares of deviations from the sample mean value.
Verification status: Official documentation referenced; example outcomes independently reasoned or arithmetically checked where stated. Not executed in Gnumeric. How formula examples are checked
Validation limits: Examples were checked by independent arithmetic and the checksum-verified official Gnumeric 1.12.62 source. No native Gnumeric execution, screenshots, locale regression or workbook round-trip was performed.
Quick answer
=DEVSQ(A2:A9) returns the sum of squared distances of numeric observations from their arithmetic mean. It is the unnormalized sum of squares at the heart of variance calculations. Unlike standard deviation, DEVSQ’s result is expressed in squared units: with measurements in days, the output has units of days². For the eight example delivery times below, the independently calculated answer is 32. The Gnumeric catalogue registers devsq as a complete function with basic project testing. Official Gnumeric catalogue · 1.12.62 source help
DEVSQ is valuable for an analysis audit, a calculation of sample or population variance, or for seeing how much individual observations contribute to squared variability. Squaring gives large departures disproportionately more weight, so DEVSQ should not be described as the typical absolute distance from the mean. Source implementation
Exact syntax, arguments and defaults
=DEVSQ(number1,number2,…)
| Argument | Type and meaning | Required/default |
|---|---|---|
number1 |
First numeric value or a range of numeric observations (such as A2:A9) |
Required; no default. |
number2, … |
Further numeric values or ranges included in the same dataset | Additional arguments; no default. |
Examples:
=DEVSQ(A2:A9)
=DEVSQ(A2:A5,C2:C5)
=DEVSQ(2,4,4,4,5,5,7,9)
The release-matched source help uses number1 then number2; its implementation takes a variable number of expression arguments. It has no separate mean, sample, population or degrees_freedom argument. It returns the raw squared-deviation sum; dividing by n or n−1 is a separate step, not an optional DEVSQ mode. 1.12.62 function help
These demonstrations use English names, periods for decimals and commas as argument separators. Locale changes can affect formula punctuation and number display, so verify what your local Gnumeric installation accepts. The release version researched is 1.12.62, not a claim of execution on every platform or edition. Gnumeric release · Function catalogue
Reproduce the calculation: delivery-time variation
Enter these numeric day counts into column A:
| Cell | Value | value − 5 |
Squared distance |
|---|---|---|---|
| A2 | 2 | −3 | 9 |
| A3 | 4 | −1 | 1 |
| A4 | 4 | −1 | 1 |
| A5 | 4 | −1 | 1 |
| A6 | 5 | 0 | 0 |
| A7 | 5 | 0 | 0 |
| A8 | 7 | 2 | 4 |
| A9 | 9 | 4 | 16 |
Enter =AVERAGE(A2:A9) into E2 (expected 5). In B2, enter =A2-$E$2 and fill down through B9. In C2, enter =B2^2 and fill down through C9. Finally, calculate =DEVSQ(A2:A9) in E3 and =SUM(C2:C9) in E4. Both E3 and E4 should be 32 for these inputs. This equality is a mathematical expectation, independently checked, not a claimed screenshot or native Gnumeric run. DEVSQ, AVERAGE, SUM source definitions · Official function inventory
Why 32? The mean is (2+4+4+4+5+5+7+9)/8 = 5. Squaring each deviation produces 9+1+1+1+0+0+4+16 = 32. DEVSQ adds these squares; it does not divide by a sample-size term. Documented function definition
Advanced uses and companion statistics
Calculate sample and population variance explicitly
Use the eight-value dataset above:
=DEVSQ(A2:A9)/(COUNT(A2:A9)-1)
=DEVSQ(A2:A9)/COUNT(A2:A9)
The first formula’s expected result is 32/7 = 4.5714285714 (sample variance), and the second is 32/8 = 4 (population variance). Mathematically these should correspond to =VAR(A2:A9) and =VARP(A2:A9) for these purely numeric inputs, subject to floating-point rounding. The choice of denominator reflects the study design, not a switch inside DEVSQ. A sample variance is undefined with fewer than two usable observations: guard COUNT before dividing by COUNT-1. Gnumeric VAR/VARP/DEVSQ catalogue · Release source function help
Calculate the related standard deviations
=SQRT(DEVSQ(A2:A9)/(COUNT(A2:A9)-1))
=SQRT(DEVSQ(A2:A9)/COUNT(A2:A9))
Expected sample standard deviation: approximately 2.1380899353. Expected population standard deviation: 2. The difference comes from the sample’s denominator 7 versus the population’s denominator 8, not an inconsistency in the original DEVSQ. These are arithmetic transformations you construct using existing Gnumeric functions, not special DEVSQ output modes. Gnumeric registered functions
Combine discontinuous ranges without double-counting
If A2:A5 contains 2,4,4,4 and C2:C5 contains 5,5,7,9, enter:
=DEVSQ(A2:A5,C2:C5)
Expected result: 32, because the calculation pools all eight observations before calculating one overall mean. It does not simply add DEVSQ(A2:A5) and DEVSQ(C2:C5): those separate groups have different means, so their within-group sums of squares omit the between-group difference. Verify exactly which cells are included to avoid overlap. Multi-input function help
Understand outlier effects
Replace A9’s 9 with 20. The new mean is 6.375, and the sum of squared deviations increases to 225.875, compared with 32 originally. With the same altered inputs, independently calculated AVEDEV is 3.5625. This contrast demonstrates how the square in DEVSQ magnifies large excursions. Both results are independently computed predictions, not observed Gnumeric output. Gnumeric AVEDEV and DEVSQ catalogue
Errors, limits and troubleshooting
| Problem | Explanation / remedy | Evidence |
|---|---|---|
| The result seems larger than expected | Each difference is squared before summing. You may be confusing DEVSQ with the absolute-deviation average or variance. Reproduce column C. | Mathematical definition. |
| A blank numeric cell appears not to contribute | The 1.12.62 DEVSQ collector is configured to ignore blank cells. Use COUNT to show actual numeric observations. |
Source collection flags. |
An imported value such as text "7" is skipped |
Check its underlying type: text stored in a range is ignored by DEVSQ’s collector. Convert legitimate measurements to numbers; avoid treating missing codes as zeros without justification. | Release-specific collector flags. |
| A TRUE/FALSE cell is present | The source’s range collection ignores Boolean cells for DEVSQ; do not assume those cells mean 1/0 merely because some other statistical functions do. | Release-specific flags. |
| A text or Boolean is typed directly as an argument | 1.12.62 has explicit direct-argument collector flags beyond those for cell ranges. This guide does not extrapolate exact coercion or error outcomes without executing the case. Use well-typed numeric cells for reliable exercises. | 1.12.62 source, native behavior pending. |
| No usable numeric observations | Squared deviation from an undefined mean has no meaningful result. The source passes GNM_ERROR_VALUE as an error fallback; the actual visible error and propagation in a workbook have not been tested here. |
Source implementation; native confirmation pending. |
| Only one numeric observation | Mathematically the squared-deviation sum is zero, but sample variance is not defined (n-1=0). Avoid dividing DEVSQ by zero in companion formulas. |
Arithmetic; exact native single-item display pending. |
Source cells contain #N/A or #VALUE! |
Diagnose the upstream error; we have not verified every propagation branch and do not claim that error cells are silently omitted. | Execution not performed. |
| Precision varies in the final digit | Display formats and floating-point rounding differ. Compare results with a practical tolerance, not exact text representations of rounded decimals. | General numerical caution, not a software-specific accuracy benchmark. |
| Formula is rejected | Check the spelling DEVSQ, =, English/locale formula separators, valid ranges and source cell types. |
Official function registration/help. |
What DEVSQ does not tell you
The raw sum of squares depends on how many observations are included as well as how variable they are. Comparing DEVSQ totals of different-sized groups without accounting for sample size can be misleading. Use a variance (VAR, VARP) or a standard deviation (STDEV, STDEVP) when comparing spreads across groups with different counts, and choose sample versus population consistently. Do not conflate the function with regression residual sums of squares unless the deviations are specifically defined against the appropriate estimated model, rather than against this data’s arithmetic mean. Related functions
Compatibility and version-specific evidence
The official Gnumeric function catalogue classifies DEVSQ as Complete with Basic upstream testing. The 1.12.62 source help contains an Excel-compatibility label and states that strings and empty cells are ignored. An implementation flag specifies how range strings, Booleans and blanks are treated. This is stronger evidence than assuming another spreadsheet’s behavior; it still does not prove that every direct argument, error branch, XLSX export or localized installation behaves identically. The 1.12.62 release announcement mentions improved Excel compatibility more generally but is not proof of a particular DEVSQ workbook round-trip. GNOME catalogue · September 2026 release · Version-matched source
No current Windows build, Linux desktop or other spreadsheet application was executed. Validation on the precise Gnumeric package, locale and file interchange route is a separate validation step. Official release documentation
Related Gnumeric guides
Dated sources and validation notes
Sources checked 2026-10-13 (UTC): Official catalogue and release documentation were checked. Function help, implementation callbacks and collector flags were independently inspected in plugins/fn-stat/functions.c from the official Gnumeric 1.12.62 source archive, verified against GNOME’s published SHA-256 checksum. Source inspection is not a native application test.
Validation limits: Examples were checked by independent arithmetic and the checksum-verified official Gnumeric 1.12.62 source. No native Gnumeric execution, screenshots, locale regression or workbook round-trip was performed.