{
  "category": "Statistical functions",
  "display_name": "AVEDEV",
  "entry_kind": "built_in_function",
  "eval_api": {
    "method": "POST",
    "url": "https://handbook.dnacalc.com/api/eval"
  },
  "function_id": "FUNC.AVEDEV",
  "implementation_state": {
    "answer_bank": {
      "excel_builds": [
        "20430"
      ],
      "larger_numeric": 0,
      "last_bit": 0,
      "matched": 1212,
      "other_mismatch": 0,
      "refused": 0,
      "rows": 1212,
      "unread": 0,
      "worst_ulp": 0
    },
    "detail": "Recorded: 1,212 in the answer bank and 6 workbook cells.",
    "dnacalc_commit": "9e1884369a678158dd82d3d74188daf986995e87",
    "in_catalogue": true,
    "state": "matches",
    "state_label": "Matches every recorded Excel answer",
    "summary": "Matches all 1,218 recorded answers",
    "workbook_corpus": {
      "cells": 6,
      "matched": 6
    }
  },
  "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#L188-L196"
      ],
      "repository": "https://github.com/DnaCalc/DnaCalc",
      "shared_code": [
        "catalogue/statistics::all"
      ],
      "source": "https://github.com/DnaCalc/DnaCalc/blob/9e1884369a678158dd82d3d74188daf986995e87/crates/calc-func/src/catalogue/statistics.rs#L188-L196",
      "state": "matches",
      "suite": null,
      "summary": "Matches all 1,218 recorded answers"
    }
  ],
  "json_url": "https://handbook.dnacalc.com/api/functions/FUNC.AVEDEV.json",
  "name": "AVEDEV",
  "notes": [],
  "schema": "efh.function-reference/v1",
  "section_order": [
    "what-it-does",
    "try-it",
    "quirks",
    "how-to-implement",
    "version-differences",
    "alternatives"
  ],
  "sections": {
    "alternatives": "\n### Relationships\n\n- **`DEVSQ`** — the same construction with squares instead of absolute values:\n  \\(\\sum (x_i - x̄)^2\\), *unnormalised*. `DEVSQ`, `VAR.P` and `AVEDEV` are three normalisations\n  of the same deviation scan.\n- **`STDEV.S` / `STDEV.P`** — the squared-deviation dispersion measures. See the \\(\\sqrt{2/\\pi}\\)\n  scale factor above before comparing them to `AVEDEV` numerically.\n- **`MEDIAN`** — the centre that would actually minimise the absolute-deviation sum. There is\n  no built-in that computes the median absolute deviation; it needs an array formula.\n- **Confused with**: the robust MAD estimator. They share an abbreviation and almost nothing\n  else.\n\n\n",
    "how-to-implement": "\n### Numerical notes\n\n\n`AVEDEV` is a **two-pass** statistic and cannot be made one-pass: the mean must be known before\nany deviation can be formed, and unlike the variance there is no algebraic expansion\n(\\(\\sum x^2 - n x̄^2\\)) that lets a single accumulator stand in, because \\(|\\cdot|\\) does not\nexpand. Every implementation therefore either stores the data or reads it twice. The reference\nengine stores it.\n\nThe interesting error analysis is the interaction of two stages:\n\n1. **The mean.** A plain left-to-right accumulation of \\(\\sum x_i\\) has a worst-case relative\n   error bound growing like \\(n u\\) (with \\(u\\) the unit roundoff) and, in the standard\n   analysis, a bound proportional to \\(\\sum |x_i| / |\\sum x_i|\\) — the condition number of\n   summation. Data of mixed sign, or data with a large common offset, is where this bites.\n   Higham's *Accuracy and Stability of Numerical Algorithms* chapter 4 is the standard\n   treatment; pairwise summation reduces the growth to \\(\\log_2 n\\), and compensated\n   (Kahan/Neumaier) summation removes the \\(n\\) dependence almost entirely.\n2. **The deviations.** \\(x_i - x̄\\) is a subtraction of nearby quantities. When the data has a\n   large offset relative to its spread — say values around \\(10^9\\) that differ in the third\n   decimal — the subtraction is exact in IEEE arithmetic (Sterbenz's lemma applies when the\n   operands are within a factor of two), but the *input* \\(x̄\\) already carries the error of\n   stage 1, and that error is inherited by every deviation.\n\nThere is a mitigating structure worth knowing. Write\n\\(g(c) = \\sum_i |x_i - c|\\). Away from ties, \\(g'(c) = \\#\\{i : x_i < c\\} - \\#\\{i : x_i > c\\}\\).\nSo an error \\(\\delta\\) in the computed mean perturbs the deviation sum by roughly\n\\(\\delta \\cdot (\\text{below} - \\text{above})\\). On data that is roughly symmetric about its\nmean this factor is small, and `AVEDEV` is far less sensitive to the accuracy of \\(x̄\\) than\none might fear. On strongly skewed data the factor approaches \\(\\pm n\\), and the mean's error\nis amplified by the sample size. This is the analysis that tells you which datasets to build a\nprobe suite from.\n\nExcel's statistical lane has a documented history of exactly this class of weakness; Morten\nWelinder's work on Gnumeric's statistical functions, and the accompanying published critiques\nof Excel's statistical accuracy, are the standard entry point to that literature and are worth\nreading before assuming any spreadsheet's dispersion statistic is well conditioned.\n\n\n",
    "quirks": "\n### Result and edge cases\n\n\nReturns `Number`.\n\n- **One admitted value.** \\(x̄ = x_1\\), so the result is exactly `0`. This is a real answer,\n  not a degenerate one, and it is why a one-cell `AVEDEV` never errors.\n- **All values equal.** Exactly `0`, and exactly the IEEE zero — every deviation is a true\n  zero before summation.\n- **Arrays.** The surface lifts natively (`lift_broadcast_profile: surface_native`) — it is a\n  reduction, so array arguments are consumed rather than broadcast over.\n\n\n\n### Errors\n\n| Error | Condition |\n|---|---|\n| `#NUM!` | No value was admitted (every slot was empty, or every value was skipped by the dual policy) |\n| `#VALUE!` | A directly-supplied text argument could not be converted to a number; or the call carries no argument slots |\n| propagated | An error value anywhere in the admitted data is returned as the function's result |\n\n",
    "sources": "- Microsoft, \"AVEDEV function\" —\n  <https://support.microsoft.com/en-us/office/avedev-function-58fe8d65-2a84-4dc7-8052-f3f87b5c6639>\n  (the defining formula; the 1-to-255 argument count; the unit-sensitivity caution; the\n  directly-typed logicals-and-numeric-text rule; the ignored-in-array-or-reference rule with\n  its zero-cells-included clause; and the absence of any documented error condition).\n- Microsoft, \"AVERAGE function\" —\n  <https://support.microsoft.com/en-us/office/average-function-047bac88-d466-426c-a32b-8f33eb960cf6>\n  (quoted here only for the contradicting direct-argument rule).\n- Handbook, [The value universe](../model/01-value-universe.md) and\n  [Coercion and lifting](../model/02-coercion-and-lifting.md) — value kinds, empty versus\n  missing, and the coercion rules this page links rather than restates.\n- N. J. Higham, *Accuracy and Stability of Numerical Algorithms*, 2nd ed., chapter 4\n  (summation: error bounds, pairwise and compensated schemes) — the analysis behind the\n  numerical notes above.\n- M. Welinder's work on the Gnumeric statistical functions, and the published critiques of\n  spreadsheet statistical accuracy that surround it — named here as the standard entry point\n  to the literature on this failure class, not as evidence about this surface.\n- Handbook `CHARTER.md` sections 1, 3 and 7; `content/model/06-claim-language.md`.\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 | 1,212 |\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.AVEDEV.json).",
    "what-it-does": "\n`AVEDEV(number1, [number2], …)` returns the **mean absolute deviation about the mean** of the\nadmitted values. For a finite sample \\(x_1,\\dots,x_n\\),\n\n    x̄     = (1/n) · Σ_{i=1..n} x_i\n    AVEDEV = (1/n) · Σ_{i=1..n} |x_i − x̄|\n\nBoth sums run over the same \\(n\\); the divisor is \\(n\\), not \\(n-1\\). There is no\n\"population versus sample\" pair for this statistic in Excel — `AVEDEV` is the only member.\n\nThree properties are worth having in front of you, because they are the ones that get\nmisremembered:\n\n1. **It is a deviation about the mean, not about the median.** The functional\n   \\(c \\mapsto \\sum_i |x_i - c|\\) is minimised at the *median*, not the mean. So `AVEDEV` is\n   not the smallest achievable mean absolute deviation of the sample, and it is not the\n   statistic usually written MAD in the robust-statistics literature (which is the median\n   absolute deviation about the median). Excel has no function for that one.\n2. **It is not on the same scale as a standard deviation.** For a sample drawn from a normal\n   distribution with standard deviation \\(\\sigma\\), the expected absolute deviation is\n   \\(\\sigma\\sqrt{2/\\pi} \\approx 0.7979\\,\\sigma\\). Comparing an `AVEDEV` against a `STDEV.S` on\n   the same data and concluding the data is \"less spread than expected\" is a scale error, not\n   a finding.\n3. **It is not differentiable in the data.** \\(|x_i - x̄|\\) has a corner wherever\n   \\(x_i = x̄\\). Two datasets that differ by an arbitrarily small perturbation can have\n   `AVEDEV` values whose derivative with respect to that perturbation flips sign. This matters\n   for anything that optimises through `AVEDEV`, and it matters for last-bit comparison: near a\n   tie the branch taken by \\(|\\cdot|\\) is decided by the low bits of \\(x_i - x̄\\).\n\nRange: `AVEDEV` is non-negative, and zero exactly when every admitted value is equal.\nUnits are the units of the data, unlike a variance.\n\n\n\n### Arguments\n\n\n| Argument | Meaning | Default |\n|---|---|---|\n| `number1` | The first value, range or array to include. Required. | — |\n| `number2 …` | Further values, ranges or arrays. Optional, repeating. | — |\n\n- A value written **directly** at the call site — `AVEDEV(TRUE, \"2\")` — is coerced. \"Logical\n  values and text representations of numbers that you type directly into the list of arguments\n  are counted.\"\n- The same value arriving **through a reference or array** is **skipped**, not coerced. \"If an\n  array or reference argument contains text, logical values, or empty cells, those values are\n  ignored; however, cells with the value zero are included.\"\n\nSo `AVEDEV(A1:A2)` and `AVEDEV(A1, A2)` are not interchangeable when the cells hold anything\nother than numbers. See [Coercion and lifting](../model/02-coercion-and-lifting.md) for the\ngeneral shape of this rule.\n\nMicrosoft also documents 1 to 255 arguments, and the caution that \"AVEDEV is influenced by the\nunit of measurement in the input data\" — which is the documentation's way of saying what the\n\\(\\sqrt{2/\\pi}\\) remark above says: this statistic carries the data's units and is not\nstandardised.\n\nEmpty cells and omitted argument slots contribute nothing and do not enter \\(n\\); see\n[Missing versus Empty](../model/01-value-universe.md#missing-versus-empty).\n\n\n"
  },
  "signature": {
    "display": "AVEDEV(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": "Mean of the absolute distances of the values from their mean",
        "short_source": "dna-calc-own"
      },
      "docs": {
        "english_description": "Returns the average of the absolute deviations of data points from their mean",
        "microsoft_url": "https://support.microsoft.com/en-us/office/avedev-function-58fe8d65-2a84-4dc7-8052-f3f87b5c6639"
      },
      "entry_kind": "built_in_function",
      "localized_family_names": null,
      "localized_names": [
        {
          "locale": "ar-SA",
          "name": "AVEDEV"
        },
        {
          "locale": "bg-BG",
          "name": "AVEDEV"
        },
        {
          "locale": "cs-CZ",
          "name": "PRŮMODCHYLKA"
        },
        {
          "locale": "da-DK",
          "name": "MAD"
        },
        {
          "locale": "de-DE",
          "name": "AVEDEV"
        },
        {
          "locale": "el-GR",
          "name": "AVEDEV"
        },
        {
          "locale": "en-AU",
          "name": "AVEDEV"
        },
        {
          "locale": "en-GB",
          "name": "AVEDEV"
        },
        {
          "locale": "en-US",
          "name": "AVEDEV"
        },
        {
          "locale": "es-ES",
          "name": "DESVPROM"
        },
        {
          "locale": "et-EE",
          "name": "AVEDEV"
        },
        {
          "locale": "fi-FI",
          "name": "KESKIPOIKKEAMA"
        },
        {
          "locale": "fr-FR",
          "name": "ECART.MOYEN*"
        },
        {
          "locale": "he-IL",
          "name": "AVEDEV"
        },
        {
          "locale": "hr-HR",
          "name": "AVEDEV"
        },
        {
          "locale": "hu-HU",
          "name": "ÁTL.ELTÉRÉS"
        },
        {
          "locale": "id-ID",
          "name": "AVEDEV"
        },
        {
          "locale": "it-IT",
          "name": "AVEDEV"
        },
        {
          "locale": "ja-JP",
          "name": "AVEDEV"
        },
        {
          "locale": "ko-KR",
          "name": "AVEDEV"
        },
        {
          "locale": "lt-LT",
          "name": "AVEDEV"
        },
        {
          "locale": "lv-LV",
          "name": "AVEDEV"
        },
        {
          "locale": "nb-NO",
          "name": "GJENNOMSNITTSAVVIK"
        },
        {
          "locale": "nl-NL",
          "name": "AVEDEV"
        },
        {
          "locale": "pl-PL",
          "name": "ODCH.ŚREDNIE"
        },
        {
          "locale": "pt-BR",
          "name": "AVEDEV"
        },
        {
          "locale": "pt-PT",
          "name": "DESV.MÉDIO"
        },
        {
          "locale": "ro-RO",
          "name": "AVEDEV"
        },
        {
          "locale": "ru-RU",
          "name": "СРОТКЛ"
        },
        {
          "locale": "sk-SK",
          "name": "AVEDEV"
        },
        {
          "locale": "sl-SI",
          "name": "AVEDEV"
        },
        {
          "locale": "sr-Latn-RS",
          "name": "AVEDEV"
        },
        {
          "locale": "sv-SE",
          "name": "MEDELAVV"
        },
        {
          "locale": "th-TH",
          "name": "AVEDEV"
        },
        {
          "locale": "tr-TR",
          "name": "ORTSAP işlevi"
        },
        {
          "locale": "uk-UA",
          "name": "AVEDEV"
        },
        {
          "locale": "vi-VN",
          "name": "AVEDEV"
        },
        {
          "locale": "zh-CN",
          "name": "AVEDEV"
        },
        {
          "locale": "zh-HK",
          "name": "AVEDEV"
        },
        {
          "locale": "zh-TW",
          "name": "AVEDEV"
        }
      ],
      "signature": {
        "display": "AVEDEV(number1, [number2], ...)",
        "parameters": [
          {
            "description": null,
            "name": "number1",
            "optional": false,
            "repeats": false
          },
          {
            "description": null,
            "name": "number2",
            "optional": true,
            "repeats": true
          }
        ],
        "trailing_repeats": true
      },
      "surface_name": "AVEDEV",
      "version_marker": null,
      "xlcall": {
        "code": "269",
        "symbol": "xlfAvedev"
      }
    },
    "microsoft": "https://support.microsoft.com/en-us/office/avedev-function-58fe8d65-2a84-4dc7-8052-f3f87b5c6639"
  },
  "try_it": {
    "formula": "=AVEDEV(1, 2, 3)"
  },
  "url": "https://handbook.dnacalc.com/functions/AVEDEV.html",
  "variants": [],
  "versions": [
    {
      "behaviour": "1,212 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.AVEDEV.json"
      ]
    }
  ]
}