{
  "category": "Statistical functions",
  "display_name": "DEVSQ",
  "entry_kind": "built_in_function",
  "eval_api": {
    "method": "POST",
    "url": "https://handbook.dnacalc.com/api/eval"
  },
  "function_id": "FUNC.DEVSQ",
  "implementation_state": {
    "answer_bank": {
      "excel_builds": [
        "20430",
        "20527"
      ],
      "larger_numeric": 0,
      "last_bit": 0,
      "matched": 23106,
      "other_mismatch": 0,
      "refused": 0,
      "rows": 23106,
      "unread": 0,
      "worst_ulp": 0
    },
    "detail": "Recorded: 23,106 in the answer bank and 66 workbook cells.",
    "dnacalc_commit": "9e1884369a678158dd82d3d74188daf986995e87",
    "in_catalogue": true,
    "state": "matches",
    "state_label": "Matches every recorded Excel answer",
    "summary": "Matches all 23,172 recorded answers",
    "workbook_corpus": {
      "cells": 66,
      "matched": 66
    }
  },
  "implementations": [
    {
      "commit": "9e1884369a678158dd82d3d74188daf986995e87",
      "flavour": "excel-compatibility-candidate",
      "language": "Rust",
      "name": "CalcFunc",
      "own_code": [
        "https://github.com/DnaCalc/DnaCalc/blob/9e1884369a678158dd82d3d74188daf986995e87/crates/calc-func/src/catalogue/statistics.rs#L197-L213"
      ],
      "repository": "https://github.com/DnaCalc/DnaCalc",
      "shared_code": [
        "catalogue/statistics::all",
        "catalogue/statistics::direct_first",
        "ported/excel_numeric::binary_with",
        "ported/excel_numeric::excel_x87_mul",
        "ported/excel_numeric/x87::mul"
      ],
      "source": "https://github.com/DnaCalc/DnaCalc/blob/9e1884369a678158dd82d3d74188daf986995e87/crates/calc-func/src/catalogue/statistics.rs#L197-L213",
      "state": "matches",
      "suite": null,
      "summary": "Matches all 23,172 recorded answers"
    }
  ],
  "json_url": "https://handbook.dnacalc.com/api/functions/FUNC.DEVSQ.json",
  "name": "DEVSQ",
  "notes": [],
  "schema": "efh.function-reference/v1",
  "section_order": [
    "what-it-does",
    "try-it",
    "quirks",
    "how-to-implement",
    "version-differences",
    "alternatives"
  ],
  "sections": {
    "alternatives": "\n[VAR.S](FUNC.VAR.S.md) divides a variance numerator by `n-1`; [VAR.P](FUNC.VAR.P.md) uses `n`. [SUMSQ](FUNC.SUMSQ.md) squares the original values without centering.\n\n\n",
    "how-to-implement": "\nThe current code uses a centered pass with a particular mixture of operations:\n\n1. Collect the numeric observations in their argument and traversal order. Reject an empty collection with `#NUM!`.\n2. Sum the observations in ordinary binary64 and divide that sum by `n` in binary64 to obtain `mean`.\n3. For each observation, store the ordinary binary64 subtraction `d=x-mean`.\n4. Compute the square using `R(d*d)`, where `R` rounds to a 64-bit significand and then stores to binary64. Replace a square below the minimum normal binary64 value by zero.\n5. Add these squares in ordinary binary64 and publish the sum. Do not divide it by `n` or `n-1`.\n\nFor `2,4,6`, the sum is 12 and the mean is four. Differences `-2,0,2` give squares `4,0,4` and total eight. By comparison, `SUMSQ(2,4,6)=56` squares the uncentered inputs.\n\nA direct calculation `sum(x*x)-sum(x)^2/n` is mathematically equivalent but can subtract two large, nearly equal quantities. It also has a different operation tree from this code. The stated mixed-store route is an implementation recipe; no whole-domain Excel stage identification is claimed.\n\n\n",
    "quirks": "\nReferenced or array text, logical values and blanks are skipped; a numeric zero is an observation. Direct logical values and numeric text can be converted. Worksheet errors propagate, and unconvertible direct text gives `#VALUE!`. In the current code, direct scalar errors are checked before errors reached through a reference or array.\n\nThe current implementation returns `#NUM!` for no collected numbers. A single number has zero deviation from its own mean and returns zero. Adding a constant to all observations leaves the mathematical answer unchanged, but a floating-point implementation can lose that property at extreme magnitudes.\n\n\n",
    "sources": "\n- [Microsoft: DEVSQ function](https://support.microsoft.com/en-us/excel/functions/devsq-function), opened 6 November 2026; syntax, documented argument rules and errors.\n- [DnaCalc implementation](https://github.com/DnaCalc/DnaCalc/blob/da3ecc4fb19a3a5529708c311d0e8f05688ac165/crates/calc-func/src/catalogue/statistics.rs); implementation steps and the limits identified in the text.\n\n",
    "try-it": "\n`=DEVSQ(2,4,6)` returns `8`: the mean is four and the squared deviations are four, zero and four.\n\n\n",
    "version-differences": "The recorded environments below distinguish a reading from a same-input comparison. Counts describe captured inputs in each environment; overlapping captures and comparisons are not totals of unique worksheet calls.\n\n| Excel 16.0 build | Platform and CPU | Captured inputs |\n|---|---|---:|\n| 20430 | Windows, 64-bit, CPU not recorded | 23,096 |\n\nThe record contains no same-input comparison between these environments. Reading different inputs on different builds does not establish either a version change or cross-build agreement.\n\n[Recorded environments and comparison details](https://github.com/DnaCalc/ExcelFunctionsHandbook/blob/5dc75391aa5125ccc5abdb095da85950980d6fd8/content/evidence/environments/FUNC.DEVSQ.json).",
    "what-it-does": "\n`DEVSQ(number1, [number2], ...)` returns the sum of squared distances from the data’s mean. It supplies a centered variance numerator without choosing either the sample or population divisor. If the observations are lengths, the result has squared-length units.\n\n\n"
  },
  "signature": {
    "display": "DEVSQ(number1, [number2], ...)",
    "parameters": [
      {
        "description": null,
        "name": "number1",
        "optional": false,
        "repeats": false
      },
      {
        "description": null,
        "name": "number2",
        "optional": true,
        "repeats": true
      }
    ],
    "trailing_repeats": true
  },
  "sources": {
    "metadata": {
      "admission": {
        "label": "implemented",
        "reason": null
      },
      "arity": {
        "max": 255,
        "min": 1
      },
      "category": "Statistical functions",
      "classification": {
        "arg_preparation_profile": "ValuesOnlyPreAdapter",
        "coercion_lift_profile": "AggregateDirectAndRangeDualPolicy",
        "determinism_class": "Deterministic",
        "error_collapse_profile": "None",
        "fec_dependency_profile": "None",
        "host_interaction_class": "None",
        "kernel_signature_class": "NumsToNum",
        "rich_value_usage": "RichBlind",
        "surface_fec_dependency_profile": "RefOnly",
        "thread_safety_class": "SafePure",
        "volatility_class": "NonVolatile"
      },
      "descriptions": {
        "long": null,
        "short": "Sum of the squared distances of the values from their mean",
        "short_source": "dna-calc-own"
      },
      "docs": {
        "english_description": "Returns the sum of squares of deviations",
        "microsoft_url": "https://support.microsoft.com/en-us/office/devsq-function-8b739616-8376-4df5-8bd0-cfe0a6caf444"
      },
      "entry_kind": "built_in_function",
      "localized_family_names": null,
      "localized_names": [
        {
          "locale": "ar-SA",
          "name": "DEVSQ"
        },
        {
          "locale": "bg-BG",
          "name": "DEVSQ"
        },
        {
          "locale": "cs-CZ",
          "name": "DEVSQ"
        },
        {
          "locale": "da-DK",
          "name": "SAK"
        },
        {
          "locale": "de-DE",
          "name": "DEVSQ"
        },
        {
          "locale": "el-GR",
          "name": "DEVSQ"
        },
        {
          "locale": "en-AU",
          "name": "DEVSQ"
        },
        {
          "locale": "en-GB",
          "name": "DEVSQ"
        },
        {
          "locale": "en-US",
          "name": "DEVSQ"
        },
        {
          "locale": "es-ES",
          "name": "DESVIA2"
        },
        {
          "locale": "et-EE",
          "name": "DEVSQ"
        },
        {
          "locale": "fi-FI",
          "name": "OIKAISTU.NELIÖSUMMA"
        },
        {
          "locale": "fr-FR",
          "name": "SOMME.CARRES.ECARTS*"
        },
        {
          "locale": "he-IL",
          "name": "DEVSQ"
        },
        {
          "locale": "hr-HR",
          "name": "DEVSQ"
        },
        {
          "locale": "hu-HU",
          "name": "SQ"
        },
        {
          "locale": "id-ID",
          "name": "DEVSQ"
        },
        {
          "locale": "it-IT",
          "name": "DEVSQ"
        },
        {
          "locale": "ja-JP",
          "name": "DEVSQ"
        },
        {
          "locale": "ko-KR",
          "name": "DEVSQ"
        },
        {
          "locale": "lt-LT",
          "name": "DEVSQ"
        },
        {
          "locale": "lv-LV",
          "name": "DEVSQ"
        },
        {
          "locale": "nb-NO",
          "name": "DEVSQ"
        },
        {
          "locale": "nl-NL",
          "name": "DEV.KWAD"
        },
        {
          "locale": "pl-PL",
          "name": "ODCH.KWADRATOWE"
        },
        {
          "locale": "pt-BR",
          "name": "DEVSQ"
        },
        {
          "locale": "pt-PT",
          "name": "DESVQ"
        },
        {
          "locale": "ro-RO",
          "name": "DEVSQ"
        },
        {
          "locale": "ru-RU",
          "name": "КВАДРОТКЛ"
        },
        {
          "locale": "sk-SK",
          "name": "DEVSQ"
        },
        {
          "locale": "sl-SI",
          "name": "DEVSQ"
        },
        {
          "locale": "sr-Latn-RS",
          "name": "DEVSQ"
        },
        {
          "locale": "sv-SE",
          "name": "KVADAVV"
        },
        {
          "locale": "th-TH",
          "name": "DEVSQ"
        },
        {
          "locale": "tr-TR",
          "name": "SAPKARE işlevi"
        },
        {
          "locale": "uk-UA",
          "name": "DEVSQ"
        },
        {
          "locale": "vi-VN",
          "name": "DEVSQ"
        },
        {
          "locale": "zh-CN",
          "name": "DEVSQ"
        },
        {
          "locale": "zh-HK",
          "name": "DEVSQ"
        },
        {
          "locale": "zh-TW",
          "name": "DEVSQ"
        }
      ],
      "signature": {
        "display": "DEVSQ(number1, [number2], ...)",
        "parameters": [
          {
            "description": null,
            "name": "number1",
            "optional": false,
            "repeats": false
          },
          {
            "description": null,
            "name": "number2",
            "optional": true,
            "repeats": true
          }
        ],
        "trailing_repeats": true
      },
      "surface_name": "DEVSQ",
      "version_marker": null,
      "xlcall": {
        "code": "318",
        "symbol": "xlfDevsq"
      }
    },
    "microsoft": "https://support.microsoft.com/en-us/office/devsq-function-8b739616-8376-4df5-8bd0-cfe0a6caf444"
  },
  "try_it": {
    "formula": "=DEVSQ(2,4,6)"
  },
  "url": "https://handbook.dnacalc.com/functions/DEVSQ.html",
  "variants": [],
  "versions": [
    {
      "behaviour": "23,096 captured inputs are indexed for this environment. Capture dates: 2026-09-29 to 2026-09-29. This is a reading count, not a comparison with another build.",
      "excel_build": "16.0 build 20430",
      "platform": "Windows, 64-bit, CPU not recorded",
      "sources": [
        "https://github.com/DnaCalc/ExcelFunctionsHandbook/blob/5dc75391aa5125ccc5abdb095da85950980d6fd8/content/evidence/environments/FUNC.DEVSQ.json"
      ]
    }
  ]
}