{
  "category": "Statistical functions",
  "display_name": "MODE.SNGL",
  "entry_kind": "built_in_function",
  "eval_api": {
    "method": "POST",
    "url": "https://handbook.dnacalc.com/api/eval"
  },
  "function_id": "FUNC.MODE.SNGL",
  "implementation_state": {
    "answer_bank": null,
    "detail": "Recorded: 22 workbook cells.",
    "dnacalc_commit": "9e1884369a678158dd82d3d74188daf986995e87",
    "in_catalogue": true,
    "state": "matches",
    "state_label": "Matches every recorded Excel answer",
    "summary": "Matches all 22 recorded answers",
    "workbook_corpus": {
      "cells": 22,
      "matched": 22
    }
  },
  "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#L283-L288"
      ],
      "repository": "https://github.com/DnaCalc/DnaCalc",
      "shared_code": [
        "catalogue/statistics::all",
        "catalogue/statistics::modes"
      ],
      "source": "https://github.com/DnaCalc/DnaCalc/blob/9e1884369a678158dd82d3d74188daf986995e87/crates/calc-func/src/catalogue/statistics.rs#L283-L288",
      "state": "matches",
      "suite": null,
      "summary": "Matches all 22 recorded answers"
    }
  ],
  "json_url": "https://handbook.dnacalc.com/api/functions/FUNC.MODE.SNGL.json",
  "name": "MODE.SNGL",
  "notes": [
    {
      "basis": "30 recorded formula readings across the three functions, and 21 readings each of MODE and MODE.SNGL covering direct text, logicals and errors.",
      "documentation": {
        "claim": "Arguments that are error values or text that can't be translated into numbers cause errors.",
        "source": "https://support.microsoft.com/en-us/office/mode-function-e45192ce-9122-4980-82ed-4bdc34973120"
      },
      "evidence": [
        {
          "commit": "c5defbd38b292450d7baf6f4bb1e81b9f2fc91bc",
          "locator": "delivered_fn4_mode_ignores_text_and_logicals",
          "note": "recorded answers pinned",
          "path": "apps/dna-onecalc/tests/acceptance.rs",
          "repository": "DnaCalc"
        },
        {
          "commit": "2d0eddcac86413014643af81d646581d54ba57bc",
          "locator": "sheets ql104 to ql133",
          "note": "30 recorded readings",
          "path": "crates/calc-func/tests/captures/fn4_questions/functions-fn4-list-controls.capture.json",
          "repository": "DnaCalc"
        },
        {
          "commit": "2d0eddcac86413014643af81d646581d54ba57bc",
          "locator": null,
          "note": "21 recorded readings",
          "path": "crates/calc-func/tests/captures/fn4_questions/MODE.reading.json",
          "repository": "DnaCalc"
        },
        {
          "commit": "2d0eddcac86413014643af81d646581d54ba57bc",
          "locator": null,
          "note": "21 recorded readings",
          "path": "crates/calc-func/tests/captures/fn4_questions/MODE.SNGL.reading.json",
          "repository": "DnaCalc"
        }
      ],
      "functions": [
        "FUNC.MODE",
        "FUNC.MODE.MULT",
        "FUNC.MODE.SNGL"
      ],
      "inferred": null,
      "kind": "documentation-differs",
      "note_id": "FN-MODE-001",
      "open": [
        "How a reference to one empty cell counts is not settled by these readings."
      ],
      "recorded_on": "2026-11-04",
      "repros": [
        {
          "call": "=MODE(\"2\",2)",
          "correct": null,
          "excel": {
            "bits": null,
            "display": "#N/A",
            "kind": "error"
          },
          "input_route": "formula-literal",
          "inputs": [],
          "recorded_in": "Excel 16.0.20527.20088 Current Channel, Windows 64-bit (NT 10.0.26200), x86-64, AMD Ryzen 7 4800H, en-ZA",
          "source": {
            "commit": "2d0eddcac86413014643af81d646581d54ba57bc",
            "locator": "sheet ql111, row 20, column 10",
            "note": null,
            "path": "crates/calc-func/tests/captures/fn4_questions/functions-fn4-list-controls.capture.json",
            "repository": "DnaCalc"
          }
        },
        {
          "call": "=MODE(TRUE,1)",
          "correct": null,
          "excel": {
            "bits": null,
            "display": "#N/A",
            "kind": "error"
          },
          "input_route": "formula-literal",
          "inputs": [],
          "recorded_in": "Excel 16.0.20527.20088 Current Channel, Windows 64-bit (NT 10.0.26200), x86-64, AMD Ryzen 7 4800H, en-ZA",
          "source": {
            "commit": "2d0eddcac86413014643af81d646581d54ba57bc",
            "locator": "sheet ql112, row 20, column 10",
            "note": null,
            "path": "crates/calc-func/tests/captures/fn4_questions/functions-fn4-list-controls.capture.json",
            "repository": "DnaCalc"
          }
        },
        {
          "call": "=MODE(\"x\",2,2)",
          "correct": null,
          "excel": {
            "bits": "0x4000000000000000",
            "display": "2",
            "kind": "number"
          },
          "input_route": "formula-literal",
          "inputs": [],
          "recorded_in": "Excel 16.0.20527.20088 Current Channel, Windows 64-bit (NT 10.0.26200), x86-64, AMD Ryzen 7 4800H, en-ZA",
          "source": {
            "commit": "2d0eddcac86413014643af81d646581d54ba57bc",
            "locator": "sheet ql110, row 20, column 10",
            "note": null,
            "path": "crates/calc-func/tests/captures/fn4_questions/functions-fn4-list-controls.capture.json",
            "repository": "DnaCalc"
          }
        },
        {
          "call": "=MODE(\"x\")",
          "correct": null,
          "excel": {
            "bits": null,
            "display": "#N/A",
            "kind": "error"
          },
          "input_route": "formula-literal",
          "inputs": [],
          "recorded_in": "Excel 16.0.20527.20088 Current Channel, Windows 64-bit (NT 10.0.26200), x86-64, AMD Ryzen 7 4800H, en-ZA",
          "source": {
            "commit": "2d0eddcac86413014643af81d646581d54ba57bc",
            "locator": "sheet ql105, row 20, column 10",
            "note": null,
            "path": "crates/calc-func/tests/captures/fn4_questions/functions-fn4-list-controls.capture.json",
            "repository": "DnaCalc"
          }
        },
        {
          "call": "=MODE.SNGL(\"x\",2,2)",
          "correct": null,
          "excel": {
            "bits": "0x4000000000000000",
            "display": "2",
            "kind": "number"
          },
          "input_route": "formula-literal",
          "inputs": [],
          "recorded_in": "Excel 16.0.20527.20088 Current Channel, Windows 64-bit (NT 10.0.26200), x86-64, AMD Ryzen 7 4800H, en-ZA",
          "source": {
            "commit": "2d0eddcac86413014643af81d646581d54ba57bc",
            "locator": "sheet ql120, row 20, column 10",
            "note": null,
            "path": "crates/calc-func/tests/captures/fn4_questions/functions-fn4-list-controls.capture.json",
            "repository": "DnaCalc"
          }
        },
        {
          "call": "=MODE.MULT(\"x\",2,2)",
          "correct": null,
          "excel": {
            "bits": "0x4000000000000000",
            "display": "2",
            "kind": "number"
          },
          "input_route": "formula-literal",
          "inputs": [],
          "recorded_in": "Excel 16.0.20527.20088 Current Channel, Windows 64-bit (NT 10.0.26200), x86-64, AMD Ryzen 7 4800H, en-ZA",
          "source": {
            "commit": "2d0eddcac86413014643af81d646581d54ba57bc",
            "locator": "sheet ql130, row 20, column 10",
            "note": null,
            "path": "crates/calc-func/tests/captures/fn4_questions/functions-fn4-list-controls.capture.json",
            "repository": "DnaCalc"
          }
        },
        {
          "call": "MODE(2, 2, A3)",
          "correct": null,
          "excel": {
            "bits": null,
            "display": "#DIV/0!",
            "kind": "error"
          },
          "input_route": "cell-value2",
          "inputs": [
            {
              "name": "number1",
              "value": {
                "bits": "0x4000000000000000",
                "display": "2",
                "kind": "number"
              }
            },
            {
              "name": "number2",
              "value": {
                "bits": "0x4000000000000000",
                "display": "2",
                "kind": "number"
              }
            },
            {
              "name": "number3",
              "value": {
                "bits": null,
                "display": "#DIV/0!",
                "kind": "error"
              }
            }
          ],
          "recorded_in": "Excel 16.0.20527.20088, Windows, bitness and CPU not recorded in this reading file",
          "source": {
            "commit": "2d0eddcac86413014643af81d646581d54ba57bc",
            "locator": "fn7-MODE-error-after-duplicates",
            "note": null,
            "path": "crates/calc-func/tests/captures/fn4_questions/MODE.reading.json",
            "repository": "DnaCalc"
          }
        }
      ],
      "schema": "efh.function-note/v1",
      "statement": "MODE, MODE.SNGL and MODE.MULT take only numbers from their arguments, even when text or a logical is typed directly into the call. A direct \"2\" or TRUE is not converted, so MODE(\"2\",2) and MODE(TRUE,1) are #N/A: one number, no repeat. Text that is not a number gives no error either: MODE(\"x\",2,2) is 2, and MODE(\"x\") is #N/A. Error values do come through: MODE(2,2,A3) with #DIV/0! in A3 is #DIV/0!, and of two errors the first is returned.",
      "status": "measured",
      "title": "MODE ignores direct text and logicals instead of converting them or giving an error"
    }
  ],
  "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- **`MODE.MULT`** is the honest sibling: it returns the whole set `A` as a\n  vertical array, which is what the mathematics actually produces. Where `MODE.SNGL` hides a\n  tie, `MODE.MULT` exposes it. If you care whether your data has one mode or several, that is\n  the function to use, and `COUNT(MODE.MULT(…))` is the direct test.\n- **`MEDIAN`** and **`AVERAGE`** are the other two classical centres. Only `MODE.SNGL` can fail\n  to exist; only `MODE.SNGL` is unchanged by an arbitrary monotone relabelling of the values;\n  only `AVERAGE` uses every observation.\n- **Confused with**: `MAX` (largest value, not most frequent) and `COUNTIF` (how many times a\n  *given* value occurs, which is `m(v)` for one `v` rather than the argmax over `v`).\n\n\n",
    "how-to-implement": "\n### Numerical notes\n\n\nThere is no floating-point approximation here — no series, no argument reduction, no\ncancellation. Everything difficult about `MODE.SNGL` is discrete.\n\n1. **The equality predicate is the algorithm's only real decision.** Multiplicity counting is\n   parameterized by \"same value\", and a tolerant comparison is not an equivalence relation on\n   the reals: if `a ≈ b` and `b ≈ c` under a fixed absolute-or-relative tolerance, `a ≈ c` can\n   fail. An implementation that groups by a tolerant predicate therefore has to define what a\n   group *is* — chaining, or clustering around a representative — and different definitions\n   give different multiplicities on the same data. An implementation that groups by exact bits\n   has no such problem and a different one: values that a user regards as equal are counted\n   apart.\n2. **The tie-break falls out of the data structure, not out of a decision.** A sort-then-scan\n   implementation naturally reports the smallest tied value; a hash-map implementation reports\n   whichever key the iteration order surfaces; a first-pass-wins scan reports the earliest in\n   argument order. All three are `O(n log n)` or better and all three are defensible, and they\n   disagree. This is the classic case where an implementation detail becomes an observable\n   semantic, and the only correct response is to pin the rule deliberately and test it.\n3. **`-0.0` and `0.0`** compare equal under IEEE 754 `==` but have different bit patterns. A\n   bitwise grouping separates them; a numeric grouping does not. The same question arises for\n   values arriving from different cells with different formats.\n4. **Stability under argument regrouping.** `MODE.SNGL(A, B)` and `MODE.SNGL(B, A)` should\n   agree; under a first-encountered tie-break they need not. That is a cheap invariant to test\n   and a cheap one to get wrong.\n\n\n",
    "quirks": "\n### Result and edge cases\n\n\nReturns `Number`.\n\n- **No repeated value.** The documented result is `#N/A`. This is the common case for\n  measured data and it is not an error in the sense of a mistake; it is the correct report\n  that the sample has no mode.\n- **Ties among several modes.** The selection rule is not stated on Microsoft's page and this\n  Handbook does not know it. The two natural candidates are *smallest tied value* and *first\n  tied value in argument order*, and they are distinguishable with a two-argument probe. See\n  the probe list below.\n- **Arrays.** `MODE.SNGL` is an aggregate, not a lift kernel: an array argument is consumed by\n  scanning, and the function returns a scalar.\n\n\n\n### Errors\n\n\n| Error | Condition |\n|---|---|\n| `#N/A` | The data set contains no value that occurs more than once |\n| propagated | An error value among the admitted values surfaces as that error; of two errors the first is returned |\n\nThe `#N/A` row is documented by Microsoft on the page cited in Sources. Retrieval of that page\nwas refused by the upstream host while this page was written, so the row is published as\ndocumented behaviour with its source named and should be re-checked against the page. The\npropagation row is measured. There is no `#VALUE!` row: a direct argument that does not convert\nto a number is ignored, so `MODE.SNGL(\"x\",2,2)` is 2 (FN-MODE-001).\n\n\n",
    "sources": "- Microsoft, \"MODE.SNGL function\" —\n  <https://support.microsoft.com/en-us/office/mode-sngl-function-f1267c16-66c6-4386-959f-8fba5f8bb7f8>\n  (signature and the no-duplicate `#N/A` rule). Retrieval was refused by the upstream host\n  when this page was written; documented behaviour above is stated as such and should be\n  re-checked against the page.\n- Handbook, [The value universe](../model/01-value-universe.md) — value kinds and the\n  raw-versus-published boundary.\n- Handbook, [Coercion and lifting](../model/02-coercion-and-lifting.md) — the\n  direct-argument versus range-scan asymmetry and error propagation.\n- `data/presence/FUNC.MODE.SNGL.json` — implementing module\n  `earlier-implementation/mode_sngl_fn.rs`, shared with no other surface.\n\n\n",
    "version-differences": "No comparison between specific Excel builds is recorded here yet. This does not establish that all builds behave alike.",
    "what-it-does": "\n`MODE.SNGL(number1, [number2], …)` returns a most frequently occurring value in the data.\n\nWrite the admitted values as a multiset `S` over the reals, and let `m(v)` be the multiplicity\nof `v` in `S`. Define\n\n    M = max { m(v) : v in S }\n    A = { v in S : m(v) = M }        the set of modes\n\nThen:\n\n- if `M = 1` — every value occurs once — the mode is not defined and the function reports\n  `#N/A`;\n- if `M > 1` and `|A| = 1`, the answer is the unique element of `A`;\n- if `M > 1` and `|A| > 1`, **the mathematics does not pick a winner and the function must**.\n\nThat third line is the whole substance of this page. The mode is the one classical measure of\ncentral tendency that is not a function of the data in the ordinary sense: it is\nset-valued. `MEDIAN` resolves its even-`n` ambiguity by a stated rule (average the two middle\nvalues). `MODE.SNGL` resolves a genuine multiplicity of maxima by an unstated one, and the\nselection rule is the fact a reader most needs and is least likely to find written down.\n\nThe mode is also not a statistic of the underlying distribution in any stable sense. For a\ncontinuous population the sample mode is almost surely `#N/A` (no value repeats), and where it\nis not, it is an artefact of rounding or of a measurement grid rather than of the distribution.\n`MODE.SNGL` is a function about the *recorded* data, not about the process that produced it.\n\n\n\n### Arguments\n\n\n| Argument | Meaning | Default |\n|---|---|---|\n| `number1` | The first argument: a number, a reference, an array, or a name. Required. | — |\n| `number2`, … | Further arguments of the same kinds. Optional, repeating. | — |\n\nWhich values reach the multiset is not the usual worksheet asymmetry: the function takes only\nnumbers from its arguments, even when text or a logical is typed directly into the call\n(FN-MODE-001). See [Coercion and lifting](../model/02-coercion-and-lifting.md), which states the\nusual asymmetry once and explains why there is deliberately no global precedence rule.\n\n\n"
  },
  "signature": {
    "display": "MODE.SNGL(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": "Custom",
        "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": "Most frequent number",
        "short_source": "dna-calc-own"
      },
      "docs": {
        "english_description": "Returns the most common value in a data set",
        "microsoft_url": "https://support.microsoft.com/en-us/office/mode-sngl-function-f1267c16-66c6-4386-959f-8fba5f8bb7f8"
      },
      "entry_kind": "built_in_function",
      "localized_family_names": null,
      "localized_names": [
        {
          "locale": "ar-SA",
          "name": "MODE.SNGL"
        },
        {
          "locale": "bg-BG",
          "name": "MODE.SNGL"
        },
        {
          "locale": "cs-CZ",
          "name": "MODE.SNGL"
        },
        {
          "locale": "da-DK",
          "name": "HYPPIGST.ENKELT"
        },
        {
          "locale": "de-DE",
          "name": "MODE.SNGL"
        },
        {
          "locale": "el-GR",
          "name": "MODE.SNGL"
        },
        {
          "locale": "en-AU",
          "name": "MODE.SNGL"
        },
        {
          "locale": "en-GB",
          "name": "MODE.SNGL"
        },
        {
          "locale": "en-US",
          "name": "MODE.SNGL"
        },
        {
          "locale": "es-ES",
          "name": "MODA.UNO"
        },
        {
          "locale": "et-EE",
          "name": "MODE.SNGL"
        },
        {
          "locale": "fi-FI",
          "name": "MOODI.YKSI"
        },
        {
          "locale": "fr-FR",
          "name": "MODE.SIMPLE*"
        },
        {
          "locale": "he-IL",
          "name": "MODE.SNGL"
        },
        {
          "locale": "hr-HR",
          "name": "MODE.SNGL"
        },
        {
          "locale": "hu-HU",
          "name": "MÓDUSZ.EGY"
        },
        {
          "locale": "id-ID",
          "name": "MODE.SNGL"
        },
        {
          "locale": "it-IT",
          "name": "MODE.SNGL"
        },
        {
          "locale": "ja-JP",
          "name": "MODE.SNGL"
        },
        {
          "locale": "ko-KR",
          "name": "MODE.SNGL"
        },
        {
          "locale": "lt-LT",
          "name": "MODE.SNGL"
        },
        {
          "locale": "lv-LV",
          "name": "MODE.SNGL"
        },
        {
          "locale": "nb-NO",
          "name": "MODE.SNGL"
        },
        {
          "locale": "nl-NL",
          "name": "MODUS.ENKELV"
        },
        {
          "locale": "pl-PL",
          "name": "WYST.NAJCZĘŚCIEJ.WART"
        },
        {
          "locale": "pt-BR",
          "name": "MODE.SNGL"
        },
        {
          "locale": "pt-PT",
          "name": "MODO.SIMPLES"
        },
        {
          "locale": "ro-RO",
          "name": "MODE.SNGL"
        },
        {
          "locale": "ru-RU",
          "name": "МОДА.ОДН"
        },
        {
          "locale": "sk-SK",
          "name": "MODE.SNGL"
        },
        {
          "locale": "sl-SI",
          "name": "MODE.SNGL"
        },
        {
          "locale": "sr-Latn-RS",
          "name": "MODE.SNGL"
        },
        {
          "locale": "sv-SE",
          "name": "TYPVÄRDE.ETT"
        },
        {
          "locale": "th-TH",
          "name": "MODE.SNGL"
        },
        {
          "locale": "tr-TR",
          "name": "ENÇOK_OLAN.TEK"
        },
        {
          "locale": "uk-UA",
          "name": "MODE.SNGL"
        },
        {
          "locale": "vi-VN",
          "name": "MODE.SNGL"
        },
        {
          "locale": "zh-CN",
          "name": "MODE.SNGL"
        },
        {
          "locale": "zh-HK",
          "name": "MODE.SNGL"
        },
        {
          "locale": "zh-TW",
          "name": "MODE.SNGL"
        }
      ],
      "signature": {
        "display": "MODE.SNGL(number1, [number2], ...)",
        "parameters": [
          {
            "description": null,
            "name": "number1",
            "optional": false,
            "repeats": false
          },
          {
            "description": null,
            "name": "number2",
            "optional": true,
            "repeats": true
          }
        ],
        "trailing_repeats": true
      },
      "surface_name": "MODE.SNGL",
      "version_marker": null,
      "xlcall": {
        "code": "498",
        "symbol": "xlfMode_sngl"
      }
    },
    "microsoft": "https://support.microsoft.com/en-us/office/mode-sngl-function-f1267c16-66c6-4386-959f-8fba5f8bb7f8"
  },
  "try_it": {
    "formula": "=MODE.SNGL(\"x\",2,2)"
  },
  "url": "https://handbook.dnacalc.com/functions/MODE.SNGL.html",
  "variants": [],
  "versions": [
    {
      "behaviour": "=MODE.SNGL(\"x\",2,2) returned 2 (0x4000000000000000). Inputs were supplied through formula literals. These are controls from this environment, not a same-input comparison with another build.",
      "excel_build": "16.0.20527.20088",
      "observations": [
        {
          "call": "=MODE.SNGL(\"x\",2,2)",
          "excel": {
            "bits": "0x4000000000000000",
            "display": "2",
            "kind": "number"
          },
          "input_route": "formula-literal",
          "inputs": [],
          "recorded_in": "Excel 16.0.20527.20088 Current Channel, Windows 64-bit (NT 10.0.26200), x86-64, AMD Ryzen 7 4800H, en-ZA"
        }
      ],
      "platform": "Windows 64-bit (NT 10.0.26200), x86-64, AMD Ryzen 7 4800H, en-ZA",
      "sources": [
        "https://github.com/DnaCalc/ExcelFunctionsHandbook/blob/3345a87/content/notes/FN-MODE-001.json"
      ]
    }
  ]
}