{
  "category": "Our 10 featured functions",
  "display_name": "SUM",
  "entry_kind": "built_in_function",
  "eval_api": {
    "method": "POST",
    "url": "https://handbook.dnacalc.com/api/eval"
  },
  "function_id": "FUNC.SUM",
  "implementation_state": {
    "answer_bank": {
      "excel_builds": [
        "20430"
      ],
      "larger_numeric": 0,
      "last_bit": 0,
      "matched": 1211,
      "other_mismatch": 0,
      "refused": 0,
      "rows": 1211,
      "unread": 0,
      "worst_ulp": 0
    },
    "detail": "Recorded: 1,211 in the answer bank and 153 workbook cells.",
    "dnacalc_commit": "9e1884369a678158dd82d3d74188daf986995e87",
    "in_catalogue": true,
    "state": "matches",
    "state_label": "Matches every recorded Excel answer",
    "summary": "Matches all 1,364 recorded answers",
    "workbook_corpus": {
      "cells": 162,
      "matched": 153,
      "pending": 9
    }
  },
  "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/aggregate.rs#L96-L96",
        "https://github.com/DnaCalc/DnaCalc/blob/9e1884369a678158dd82d3d74188daf986995e87/crates/calc-func/src/catalogue/aggregate.rs#L120-L149"
      ],
      "repository": "https://github.com/DnaCalc/DnaCalc",
      "shared_code": [
        "catalogue/aggregate::aggregate",
        "catalogue/aggregate::direct_first",
        "catalogue/aggregate::holds_held_arrays",
        "catalogue/aggregate::read_through_held_arrays",
        "catalogue/aggregate::flatten",
        "catalogue/aggregate::read_held_references",
        "catalogue/aggregate::number_of",
        "catalogue/aggregate::each_number",
        "catalogue/aggregate::read_values",
        "catalogue/aggregate::reader",
        "catalogue/aggregate::read_reference"
      ],
      "source": "https://github.com/DnaCalc/DnaCalc/blob/9e1884369a678158dd82d3d74188daf986995e87/crates/calc-func/src/catalogue/aggregate.rs#L96-L96",
      "state": "matches",
      "suite": null,
      "summary": "Matches all 1,364 recorded answers"
    }
  ],
  "json_url": "https://handbook.dnacalc.com/api/functions/FUNC.SUM.json",
  "name": "SUM",
  "notes": [],
  "schema": "efh.function-reference/v1",
  "section_order": [
    "what-it-does",
    "try-it",
    "quirks",
    "how-to-implement",
    "version-differences",
    "alternatives"
  ],
  "sections": {
    "alternatives": "\nUse [SUMIFS](FUNC.SUMIFS.md) for conditions, [SUMPRODUCT](FUNC.SUMPRODUCT.md) for weighted products, or [SUBTOTAL](FUNC.SUBTOTAL.md) when filtering and hidden-row rules matter.\n\n\n",
    "how-to-implement": "\n1. Preserve each argument's origin: direct scalar, reference or array. Validate direct arguments through numeric conversion first, in argument order, before processing held errors.\n2. Visit arguments in order. For a reference visit areas in order and cells in row order; for an array visit elements in row order. Admit held numbers, skip held text/logicals/blanks, and propagate errors under the priority above.\n3. Begin with `total=0`. For each admitted number x, assign `total=R(total+x)`, where [R](../model/09-staged-arithmetic.md) rounds to a 64-bit significand and then stores to binary64. Keep one store per addition. Publish the final number under the worksheet finite/subnormal policy.\n\nFor `7,-2,5`, the accumulator is `0 → 7 → 5 → 10`. A direct scalar that converts successfully must still be added at its original traversal position; the initial validation pass is not an instruction to sum scalars ahead of ranges. The current implementation also reads arrays boxed inside a GROUPBY result through to their elements. Keep that extension distinct from ordinary rectangular-array collection. The cited source and captures establish these specific routes; no published Handbook suite is supplied here.\n\n\n",
    "quirks": "\nReferenced text, logical values and blanks are skipped; numeric zero participates. Direct logicals and numeric text convert, while unconvertible direct text causes `#VALUE!`.\n\nRecorded error controls give direct-argument failures priority over errors held inside ranges or arrays. For example, `SUM({1,#REF!},\"a\")` gives `#VALUE!`. Among held errors, reading order matters. A later worksheet error can also determine the result after the numeric accumulator has overflowed.\n\nChanging the order of large positive and negative terms can change a floating-point sum. Compensation or sorting is a different numerical recipe, even when it is more accurate mathematically.\n\n\n",
    "sources": "\n- [Aggregate fold and error controls](https://github.com/DnaCalc/DnaCalc/blob/da3ecc4fb19a3a5529708c311d0e8f05688ac165/crates/calc-func/src/catalogue/aggregate.rs).\n- [Stored addition primitive](https://github.com/DnaCalc/DnaCalc/blob/da3ecc4fb19a3a5529708c311d0e8f05688ac165/crates/calc-func/src/kernel.rs).\n- [Microsoft: SUM function](https://support.microsoft.com/en-us/office/sum-function-043e1c7d-7726-4e80-8f32-07b23e057f89), opened 6 November 2026; syntax, documented argument rules and errors.\n\n",
    "try-it": "\n`=SUM(7,-2,5)` returns `10`. With B2:B4 containing `7`, the text `pending`, and `5`, `=SUM(B2:B4)` returns `12` because the referenced text is skipped.\n\nDirect constants use a different admission rule: `=SUM(1,TRUE,\"2\")` adds one, one and two to give four. Putting those three values in an array, `=SUM({1,TRUE,\"2\"})`, admits only the numeric one. A cell's numeric value and its text spelling are different inputs.\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 | 1,211 |\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.SUM.json).",
    "what-it-does": "\n`SUM(number1, [number2], ...)` adds individual numbers and numbers held in ranges or arrays. A range keeps a total tied to the cells that contain the data; mixing a range with further scalar arguments adds all of them.\n\n\n"
  },
  "signature": {
    "display": "SUM(number1, [number2], ...)",
    "parameters": [
      {
        "description": "Starts the additive fold and admits ordinary scalar and reference-fed lanes.",
        "name": "number1",
        "optional": false,
        "repeats": false
      },
      {
        "description": "Represents the repeated optional additive arguments for the bounded witness slice.",
        "name": "number2",
        "optional": true,
        "repeats": true
      }
    ],
    "trailing_repeats": true
  },
  "sources": {
    "metadata": {
      "admission": {
        "label": "implemented",
        "reason": null
      },
      "arity": {
        "max": 255,
        "min": 1
      },
      "category": "Our 10 featured functions",
      "classification": {
        "arg_preparation_profile": "ValuesOnlyPreAdapter",
        "coercion_lift_profile": "AggregateDirectAndRangeDualPolicy",
        "determinism_class": "Deterministic",
        "error_collapse_profile": "ReductionFold",
        "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": "The first mixed tranche treats SUM as the ordinary scalar/aggregate anchor for downstream witness rendering.",
        "short": "Total of the numbers",
        "short_source": "dna-calc-own"
      },
      "docs": {
        "english_description": "Use this function to add the values in cells.",
        "microsoft_url": "https://support.microsoft.com/en-us/office/sum-function-043e1c7d-7726-4e80-8f32-07b23e057f89"
      },
      "entry_kind": "built_in_function",
      "localized_family_names": null,
      "localized_names": [
        {
          "locale": "ar-SA",
          "name": "SUM"
        },
        {
          "locale": "bg-BG",
          "name": "SUM"
        },
        {
          "locale": "cs-CZ",
          "name": "SUMA"
        },
        {
          "locale": "da-DK",
          "name": "SUM"
        },
        {
          "locale": "de-DE",
          "name": "SUMME"
        },
        {
          "locale": "el-GR",
          "name": "SUM"
        },
        {
          "locale": "en-AU",
          "name": "SUM"
        },
        {
          "locale": "en-GB",
          "name": "SUM"
        },
        {
          "locale": "en-US",
          "name": "SUM"
        },
        {
          "locale": "es-ES",
          "name": "SUMA"
        },
        {
          "locale": "et-EE",
          "name": "SUM"
        },
        {
          "locale": "fi-FI",
          "name": "SUMMA"
        },
        {
          "locale": "fr-FR",
          "name": "SOMME"
        },
        {
          "locale": "he-IL",
          "name": "SUM"
        },
        {
          "locale": "hr-HR",
          "name": "SUM"
        },
        {
          "locale": "hu-HU",
          "name": "SZUM"
        },
        {
          "locale": "id-ID",
          "name": "SUM"
        },
        {
          "locale": "it-IT",
          "name": "SOMMA"
        },
        {
          "locale": "ja-JP",
          "name": "SUM"
        },
        {
          "locale": "ko-KR",
          "name": "SUM"
        },
        {
          "locale": "lt-LT",
          "name": "SUM"
        },
        {
          "locale": "lv-LV",
          "name": "SUM"
        },
        {
          "locale": "nb-NO",
          "name": "SUMMER"
        },
        {
          "locale": "nl-NL",
          "name": "SOM"
        },
        {
          "locale": "pl-PL",
          "name": "SUMA"
        },
        {
          "locale": "pt-BR",
          "name": "SOMA"
        },
        {
          "locale": "pt-PT",
          "name": "SOMA"
        },
        {
          "locale": "ro-RO",
          "name": "SUM"
        },
        {
          "locale": "ru-RU",
          "name": "СУММ"
        },
        {
          "locale": "sk-SK",
          "name": "SUM"
        },
        {
          "locale": "sl-SI",
          "name": "SUM"
        },
        {
          "locale": "sr-Latn-RS",
          "name": "SUM"
        },
        {
          "locale": "sv-SE",
          "name": "SUMMA"
        },
        {
          "locale": "th-TH",
          "name": "SUM"
        },
        {
          "locale": "tr-TR",
          "name": "TOPLA"
        },
        {
          "locale": "uk-UA",
          "name": "SUM"
        },
        {
          "locale": "vi-VN",
          "name": "Hàm SUM"
        },
        {
          "locale": "zh-CN",
          "name": "SUM"
        },
        {
          "locale": "zh-HK",
          "name": "SUM"
        },
        {
          "locale": "zh-TW",
          "name": "SUM"
        }
      ],
      "signature": {
        "display": "SUM(number1, [number2], ...)",
        "parameters": [
          {
            "description": "Starts the additive fold and admits ordinary scalar and reference-fed lanes.",
            "name": "number1",
            "optional": false,
            "repeats": false
          },
          {
            "description": "Represents the repeated optional additive arguments for the bounded witness slice.",
            "name": "number2",
            "optional": true,
            "repeats": true
          }
        ],
        "trailing_repeats": true
      },
      "surface_name": "SUM",
      "version_marker": null,
      "xlcall": {
        "code": "4",
        "symbol": "xlfSum"
      }
    },
    "microsoft": "https://support.microsoft.com/en-us/office/sum-function-043e1c7d-7726-4e80-8f32-07b23e057f89"
  },
  "try_it": {
    "formula": "=SUM(7,-2,5)"
  },
  "url": "https://handbook.dnacalc.com/functions/SUM.html",
  "variants": [],
  "versions": [
    {
      "behaviour": "1,211 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.SUM.json"
      ]
    }
  ]
}