{
  "category": "Information functions",
  "display_name": "N",
  "entry_kind": "built_in_function",
  "eval_api": {
    "method": "POST",
    "url": "https://handbook.dnacalc.com/api/eval"
  },
  "function_id": "FUNC.N",
  "implementation_state": {
    "answer_bank": {
      "excel_builds": [
        "20430"
      ],
      "larger_numeric": 0,
      "last_bit": 0,
      "matched": 1225,
      "other_mismatch": 0,
      "refused": 2,
      "rows": 1227,
      "unread": 0,
      "worst_ulp": 0
    },
    "detail": "Of 1,385 recorded answers (1,227 in the answer bank and 158 workbook cells), 3 do not match: 3 are refused.",
    "dnacalc_commit": "9e1884369a678158dd82d3d74188daf986995e87",
    "in_catalogue": true,
    "state": "differs",
    "state_label": "Known larger differences",
    "summary": "Refuses 3 of 1,385 recorded calls; the rest match",
    "workbook_corpus": {
      "cells": 159,
      "matched": 157,
      "pending": 1,
      "refused": 1
    }
  },
  "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/information.rs#L105-L105"
      ],
      "repository": "https://github.com/DnaCalc/DnaCalc",
      "shared_code": [
        "catalogue/aggregate::reader",
        "catalogue/aggregate::read_reference",
        "catalogue/information::unary",
        "catalogue/information::scalar",
        "catalogue/information::known",
        "catalogue/information::each",
        "catalogue/information::n",
        "catalogue/information::n_of",
        "catalogue/information::referenced"
      ],
      "source": "https://github.com/DnaCalc/DnaCalc/blob/9e1884369a678158dd82d3d74188daf986995e87/crates/calc-func/src/catalogue/information.rs#L105-L105",
      "state": "differs",
      "suite": null,
      "summary": "Refuses 3 of 1,385 recorded calls; the rest match"
    }
  ],
  "json_url": "https://handbook.dnacalc.com/api/functions/FUNC.N.json",
  "name": "N",
  "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- **`VALUE(text)`** is the function that actually parses. Use it when non-numeric text should be\n  an error rather than a zero.\n- **`NUMBERVALUE(text, decimal_separator, group_separator)`** is the locale-explicit parser and\n  the right choice for text that came from another locale.\n- **`ISNUMBER`** is the test that tells you which branch you are in before you commit to `N`.\n- **`--` (double unary)** is the idiomatic modern replacement for `N` on boolean masks; it\n  coerces through arithmetic, which means it *errors* on non-numeric text where `N` returns\n  zero. The two are not interchangeable on messy data.\n- **`SUM` and the aggregate family** show the same numeric-text asymmetry from the other side:\n  `SUM(\"3\")` is 3 as a direct argument but a text cell in a scanned range contributes nothing\n  ([coercion and lifting](../model/02-coercion-and-lifting.md)). `N` is stricter than direct\n  argument coercion and matches the range-scan outcome.\n\n\n",
    "how-to-implement": "\n### Notes for implementers\n\n\n1. **Do not implement `N` by calling the general to-number coercion.** The general primitive\n   parses numeric text; `N` must not. Routing `N` through it is an easy mistake that makes\n   `N(\"19\")` return 19 and passes every test written by someone who expected that.\n2. **Errors must pass through, not be caught.** `N` is not an inspection function; the error row\n   in the table is a pass-through, not a classification.\n3. **`Empty` and `Missing` both land on `0`,** but they arrive by different routes and should be\n   handled explicitly rather than by falling through a default.\n4. **The array decision is load-bearing and undocumented.** Whichever way an engine goes —\n   elementwise map, or take the first element — it should be recorded as a decision awaiting\n   evidence, because the documentation does not settle it.\n\n\n",
    "quirks": "\n### Result and edge cases\n\n\nReturns a `Number`, an `Error` (when the input was an error), or an array of those.\n\n- **No conversion failure exists.** `N` never returns `#VALUE!` for a value it can be given.\n  Where `VALUE(\"abc\")` errors, `N(\"abc\")` is `0`. That difference — error versus silent zero —\n  is the whole reason to prefer `VALUE` when you actually want a parse.\n- **Text is always 0**, regardless of content, including the empty string and including\n  `\"TRUE\"`.\n- **Logicals convert**, unlike in most range-scan contexts where logicals are skipped. `N(TRUE)`\n  is `1`; this is the documented behaviour and is the usual way to turn a boolean into a\n  summable number, alongside the double-unary `--`.\n- **Percentages, currency and times** are numbers already; `N` returns the stored value, so\n  `N(50%)` is `0.5` and `N` of a cell showing `12:00` is `0.5` as well.\n- **Errors propagate** rather than becoming a number.\n\n\n\n### Errors\n\nEvery other error on a page featuring `N` came from somewhere else and was passed through.\n\n\n",
    "sources": "- Microsoft, \"N function\" —\n  <https://support.microsoft.com/en-us/office/n-function-a624cad1-3635-4208-b54a-29733d1278c9>.\n  Read for this page: the syntax, the `value` argument description, the full conversion table\n  verbatim, and both remarks (the compatibility statement and the date-serial explanation).\n- Handbook, [the value universe](../model/01-value-universe.md) — dates as formatted numbers,\n  the `Empty`/`Missing` distinction, rich-value core projections.\n- Handbook, [coercion and lifting](../model/02-coercion-and-lifting.md) — the to-number\n  primitive `N` deliberately does not use, and the direct-argument versus range-scan asymmetry.\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,227 |\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.N.json).",
    "what-it-does": "\n`N(value)` maps a value to a number by a fixed table. It is a **total function on the scalar\nkinds** — it always produces something, and for one class of input that something is a silent\nzero.\n\nMicrosoft's table, verbatim:\n\n| If value is or refers to | `N` returns |\n|---|---|\n| A number | That number |\n| A date, in one of the built-in date formats available in Microsoft Excel | The serial number of that date |\n| `TRUE` | 1 |\n| `FALSE` | 0 |\n| An error value, such as `#DIV/0!` | The error value |\n| Anything else | 0 |\n\nTwo rows carry all the risk.\n\n**\"Anything else\" is 0, and it includes text that reads as a number.** `N(\"19\")` is `0`, not\n19. `N` is not a parser. This is the single fact that makes `N` dangerous in a formula that was\nmeant to salvage imported data: it converts every text cell — meaningful or not, numeric-looking\nor not — to zero, with no error and no signal.\n\n**The date row is not a special case.** A date *is* a number in Excel's value universe\n([the value universe](../model/01-value-universe.md)); the built-in date format is presentation.\nThe row exists in Microsoft's table because a reader thinks of a date cell as holding a date, but\nmechanically it collapses into the first row. What `N` returns for a date is the serial number\nthat was already there.\n\n**Errors pass through unchanged.** `N` is not an error-masking function. `N(#DIV/0!)` is\n`#DIV/0!`, documented explicitly.\n\nMicrosoft's own remark on the function's purpose is worth quoting because it sets expectations\ncorrectly: \"It is not generally necessary to use the N function in a formula, because Excel\nautomatically converts values as necessary. This function is provided for compatibility with\nother spreadsheet programs.\"\n\n\n\n### Arguments\n\n\n`value` — required, exactly one. The published signature is `N(value)`.\n\nEvery scalar kind is admissible; none is rejected. The interesting positions are the ones\nMicrosoft's table does not name:\n\n- **An empty cell.** Falls under \"anything else\" — `0`. It is the same output as text, which is\n  why `N(A1)=0` cannot distinguish a blank from a label.\n\n\n"
  },
  "signature": {
    "display": "N(value)",
    "parameters": [
      {
        "description": null,
        "name": "value",
        "optional": false,
        "repeats": false
      }
    ],
    "trailing_repeats": false
  },
  "sources": {
    "metadata": {
      "admission": {
        "label": "implemented",
        "reason": null
      },
      "arity": {
        "max": 1,
        "min": 1
      },
      "category": "Information 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": "Custom",
        "rich_value_usage": "RichBlind",
        "surface_fec_dependency_profile": "RefOnly",
        "thread_safety_class": "SafePure",
        "volatility_class": "NonVolatile"
      },
      "descriptions": {
        "long": null,
        "short": "A value as a number: numbers as they are, dates as serials, TRUE as 1, everything else 0",
        "short_source": "dna-calc-own"
      },
      "docs": {
        "english_description": "Returns a value converted to a number",
        "microsoft_url": "https://support.microsoft.com/en-us/office/n-function-a624cad1-3635-4208-b54a-29733d1278c9"
      },
      "entry_kind": "built_in_function",
      "localized_family_names": null,
      "localized_names": [
        {
          "locale": "ar-SA",
          "name": "N"
        },
        {
          "locale": "bg-BG",
          "name": "N"
        },
        {
          "locale": "cs-CZ",
          "name": "N"
        },
        {
          "locale": "da-DK",
          "name": "N"
        },
        {
          "locale": "de-DE",
          "name": "N"
        },
        {
          "locale": "el-GR",
          "name": "Ε"
        },
        {
          "locale": "en-AU",
          "name": "N"
        },
        {
          "locale": "en-GB",
          "name": "N"
        },
        {
          "locale": "en-US",
          "name": "N"
        },
        {
          "locale": "es-ES",
          "name": "N"
        },
        {
          "locale": "et-EE",
          "name": "N"
        },
        {
          "locale": "fi-FI",
          "name": "N"
        },
        {
          "locale": "fr-FR",
          "name": "N"
        },
        {
          "locale": "he-IL",
          "name": "N"
        },
        {
          "locale": "hr-HR",
          "name": "N"
        },
        {
          "locale": "hu-HU",
          "name": "N"
        },
        {
          "locale": "id-ID",
          "name": "N"
        },
        {
          "locale": "it-IT",
          "name": "N"
        },
        {
          "locale": "ja-JP",
          "name": "N"
        },
        {
          "locale": "ko-KR",
          "name": "N 키"
        },
        {
          "locale": "lt-LT",
          "name": "N"
        },
        {
          "locale": "lv-LV",
          "name": "N"
        },
        {
          "locale": "nb-NO",
          "name": "N"
        },
        {
          "locale": "nl-NL",
          "name": "N"
        },
        {
          "locale": "pl-PL",
          "name": "N"
        },
        {
          "locale": "pt-BR",
          "name": "N"
        },
        {
          "locale": "pt-PT",
          "name": "N"
        },
        {
          "locale": "ro-RO",
          "name": "N"
        },
        {
          "locale": "ru-RU",
          "name": "N"
        },
        {
          "locale": "sk-SK",
          "name": "N"
        },
        {
          "locale": "sl-SI",
          "name": "N"
        },
        {
          "locale": "sr-Latn-RS",
          "name": "N"
        },
        {
          "locale": "sv-SE",
          "name": "N"
        },
        {
          "locale": "th-TH",
          "name": "N"
        },
        {
          "locale": "tr-TR",
          "name": "N"
        },
        {
          "locale": "uk-UA",
          "name": "N"
        },
        {
          "locale": "vi-VN",
          "name": "N"
        },
        {
          "locale": "zh-CN",
          "name": "N"
        },
        {
          "locale": "zh-HK",
          "name": "N"
        },
        {
          "locale": "zh-TW",
          "name": "N"
        }
      ],
      "signature": {
        "display": "N(value)",
        "parameters": [
          {
            "description": null,
            "name": "value",
            "optional": false,
            "repeats": false
          }
        ],
        "trailing_repeats": false
      },
      "surface_name": "N",
      "version_marker": null,
      "xlcall": {
        "code": "131",
        "symbol": "xlfN"
      }
    },
    "microsoft": "https://support.microsoft.com/en-us/office/n-function-a624cad1-3635-4208-b54a-29733d1278c9"
  },
  "try_it": {
    "formula": "=N(\"19\")"
  },
  "url": "https://handbook.dnacalc.com/functions/N.html",
  "variants": [],
  "versions": [
    {
      "behaviour": "1,227 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.N.json"
      ]
    }
  ]
}