{
  "category": "Date and time functions",
  "display_name": "YEAR",
  "entry_kind": "built_in_function",
  "eval_api": {
    "method": "POST",
    "url": "https://handbook.dnacalc.com/api/eval"
  },
  "function_id": "FUNC.YEAR",
  "implementation_state": {
    "answer_bank": {
      "excel_builds": [
        "20430"
      ],
      "larger_numeric": 0,
      "last_bit": 0,
      "matched": 10153,
      "other_mismatch": 0,
      "refused": 0,
      "rows": 10153,
      "unread": 0,
      "worst_ulp": 0
    },
    "detail": "Recorded: 10,153 in the answer bank and 14 workbook cells.",
    "dnacalc_commit": "9e1884369a678158dd82d3d74188daf986995e87",
    "in_catalogue": true,
    "state": "matches",
    "state_label": "Matches every recorded Excel answer",
    "summary": "Matches all 10,167 recorded answers",
    "workbook_corpus": {
      "cells": 14,
      "matched": 14
    }
  },
  "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/dates.rs#L236-L238"
      ],
      "repository": "https://github.com/DnaCalc/DnaCalc",
      "shared_code": [
        "catalogue/dates::environment",
        "catalogue/dates::system",
        "catalogue/dates::to_1900",
        "catalogue/dates::date_arg",
        "catalogue/dates::of_date",
        "ported/date_kernels::days_from_civil",
        "ported/date_kernels::civil_from_days",
        "ported/date_kernels::ymd_1900",
        "ported/date_kernels::serial_to_ymd"
      ],
      "source": "https://github.com/DnaCalc/DnaCalc/blob/9e1884369a678158dd82d3d74188daf986995e87/crates/calc-func/src/catalogue/dates.rs#L236-L238",
      "state": "matches",
      "suite": null,
      "summary": "Matches all 10,167 recorded answers"
    }
  ],
  "json_url": "https://handbook.dnacalc.com/api/functions/FUNC.YEAR.json",
  "name": "YEAR",
  "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\n- **[MONTH](FUNC.MONTH.md), [DAY](FUNC.DAY.md)** — the other two components of the same\n  decomposition. Together with `YEAR` they invert [DATE](FUNC.DATE.md).\n- **[DATE](FUNC.DATE.md)** — the constructor. `DATE(YEAR(s),MONTH(s),DAY(s))` should return\n  `⌊s⌋`; that round trip is the obvious metamorphic test for this family.\n- **[YEARFRAC](FUNC.YEARFRAC.md)** — despite the shared prefix, unrelated in kind: `YEARFRAC`\n  measures an interval in years, `YEAR` names a year.\n- **[DATEDIF](FUNC.DATEDIF.md)** with unit `\"Y\"` — counts *complete years between* two dates, which\n  is not `YEAR(b) − YEAR(a)`. The difference of years and the number of elapsed years disagree\n  whenever the anniversary has not yet passed; this is the most frequent age-calculation bug in\n  spreadsheets.\n\n\n",
    "how-to-implement": "\n### Notes for implementers\n\n\n1. **Floor, do not truncate.** The fractional part must be removed by flooring so that the\n   behaviour is defined the same way for the (error-bound) negative region as for the positive\n   one. Truncation and flooring differ exactly where the range check is supposed to fire.\n2. **The year is not derivable by division.** No `1900 + s/365.25`-style shortcut is correct; the\n   mapping has to go through a real calendar, adjusted for the leap-year artefact.\n3. **The date system is context, not a constant.** See [FUNC.DATE](FUNC.DATE.md).\n\n\n",
    "quirks": "\n### Result and edge cases\n\n\nReturns a `Number`: a four-digit year.\n\n- **Fractional serials.** The time-of-day component is discarded. `YEAR(43831.75)` is the same as\n  `YEAR(43831)`.\n- **Serial 0.** Under the 1900 system, serial 0 is the phantom \"0 January 1900\". Whether Excel\n  reports 1900 for it is an artefact question, not a calendrical one — see below.\n- **Serial 60.** The phantom 29 February 1900. `YEAR` returns 1900 for it under any sane reading,\n  so it is the *least* diagnostic of the three decomposers here; [DAY](FUNC.DAY.md) is where the\n  artefact shows.\n\n\n\n### Errors\n\n\nAs documented for this category, and on the page linked below:\n\n- `#NUM!` when `serial_number` is out of range for the workbook's date-base value — negative\n  serials being the clear case.\n- `#VALUE!` when the argument cannot be converted to a number (ordinary coercion behaviour, not a\n  `YEAR`-specific rule).\n- An error value passed in propagates.\n\n\n",
    "sources": "\n- Microsoft 365 support, **YEAR function** —\n  <https://support.microsoft.com/en-us/office/year-function-c64f017a-1354-490d-981f-578e8ec8d3b9>.\n- [FUNC.DATE](FUNC.DATE.md) — the serial-number model, the leap-year artefact and the 1900/1904\n  systems, with their own Microsoft citations.\n- Handbook call-model chapter [02 coercion and lifting](../model/02-coercion-and-lifting.md).\n- `data/functions/FUNC.YEAR.json`, `data/presence/FUNC.YEAR.json`, `data/battery/FUNC.YEAR.json`.\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 | 10,153 |\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.YEAR.json).",
    "what-it-does": "\n`YEAR` projects a date serial onto its calendar-year component. Given a serial `s`, it discards\nthe fractional part, finds the calendar day that `⌊s⌋` denotes under the workbook's date system,\nand returns that day's year as an integer in the range 1900–9999 (1904–9999 in a 1904-system\nworkbook).\n\n\n### Arguments\n\n\n`YEAR(serial_number)` — one required argument.\n\n**serial_number** — the date whose year is wanted. Microsoft's documentation is emphatic across\nthis whole category that dates should be supplied as serials, from `DATE`, from another formula,\nor from a cell already holding a date, and *not* as text, because text dates are locale-dependent\nand can be misparsed. `YEAR` accepts what the ordinary scalar coercion rules accept (see\n[coercion and lifting](../model/02-coercion-and-lifting.md)): numbers, numeric text, logicals.\n\nThe commonly misunderstood point is that `serial_number` is a *number*, not a \"date object\". Any\nnumber in range is a legal argument, including numbers that no user would call a date.\n\n\n"
  },
  "signature": {
    "display": "YEAR(serial_number)",
    "parameters": [
      {
        "description": null,
        "name": "serial_number",
        "optional": false,
        "repeats": false
      }
    ],
    "trailing_repeats": false
  },
  "sources": {
    "metadata": {
      "admission": {
        "label": "implemented",
        "reason": null
      },
      "arity": {
        "max": 1,
        "min": 1
      },
      "category": "Date and time 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": "Year of a date",
        "short_source": "dna-calc-own"
      },
      "docs": {
        "english_description": "Converts a serial number to a year",
        "microsoft_url": "https://support.microsoft.com/en-us/office/year-function-c64f017a-1354-490d-981f-578e8ec8d3b9"
      },
      "entry_kind": "built_in_function",
      "localized_family_names": null,
      "localized_names": [
        {
          "locale": "ar-SA",
          "name": "YEAR"
        },
        {
          "locale": "bg-BG",
          "name": "YEAR"
        },
        {
          "locale": "cs-CZ",
          "name": "ROK"
        },
        {
          "locale": "da-DK",
          "name": "YEAR"
        },
        {
          "locale": "de-DE",
          "name": "YEAR"
        },
        {
          "locale": "el-GR",
          "name": "YEAR"
        },
        {
          "locale": "en-AU",
          "name": "YEAR"
        },
        {
          "locale": "en-GB",
          "name": "YEAR"
        },
        {
          "locale": "en-US",
          "name": "YEAR"
        },
        {
          "locale": "es-ES",
          "name": "YEAR"
        },
        {
          "locale": "et-EE",
          "name": "AASTA"
        },
        {
          "locale": "fi-FI",
          "name": "VUOSI"
        },
        {
          "locale": "fr-FR",
          "name": "YEAR"
        },
        {
          "locale": "he-IL",
          "name": "YEAR"
        },
        {
          "locale": "hr-HR",
          "name": "YEAR"
        },
        {
          "locale": "hu-HU",
          "name": "YEAR"
        },
        {
          "locale": "id-ID",
          "name": "YEAR"
        },
        {
          "locale": "it-IT",
          "name": "YEAR"
        },
        {
          "locale": "ja-JP",
          "name": "YEAR"
        },
        {
          "locale": "ko-KR",
          "name": "YEAR"
        },
        {
          "locale": "lt-LT",
          "name": "YEAR"
        },
        {
          "locale": "lv-LV",
          "name": "YEAR"
        },
        {
          "locale": "nb-NO",
          "name": "ÅR"
        },
        {
          "locale": "nl-NL",
          "name": "YEAR"
        },
        {
          "locale": "pl-PL",
          "name": "YEAR (rok)"
        },
        {
          "locale": "pt-BR",
          "name": "YEAR"
        },
        {
          "locale": "pt-PT",
          "name": "ANO"
        },
        {
          "locale": "ro-RO",
          "name": "YEAR"
        },
        {
          "locale": "ru-RU",
          "name": "YEAR"
        },
        {
          "locale": "sk-SK",
          "name": "ROK"
        },
        {
          "locale": "sl-SI",
          "name": "LETO"
        },
        {
          "locale": "sr-Latn-RS",
          "name": "GODINA"
        },
        {
          "locale": "sv-SE",
          "name": "YEAR"
        },
        {
          "locale": "th-TH",
          "name": "ปี"
        },
        {
          "locale": "tr-TR",
          "name": "YIL"
        },
        {
          "locale": "uk-UA",
          "name": "РІК"
        },
        {
          "locale": "vi-VN",
          "name": "YEAR"
        },
        {
          "locale": "zh-CN",
          "name": "YEAR"
        },
        {
          "locale": "zh-HK",
          "name": "YEAR"
        },
        {
          "locale": "zh-TW",
          "name": "YEAR"
        }
      ],
      "signature": {
        "display": "YEAR(serial_number)",
        "parameters": [
          {
            "description": null,
            "name": "serial_number",
            "optional": false,
            "repeats": false
          }
        ],
        "trailing_repeats": false
      },
      "surface_name": "YEAR",
      "version_marker": null,
      "xlcall": {
        "code": "69",
        "symbol": "xlfYear"
      }
    },
    "microsoft": "https://support.microsoft.com/en-us/office/year-function-c64f017a-1354-490d-981f-578e8ec8d3b9"
  },
  "try_it": {
    "formula": "=YEAR(45000)"
  },
  "url": "https://handbook.dnacalc.com/functions/YEAR.html",
  "variants": [],
  "versions": [
    {
      "behaviour": "10,153 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.YEAR.json"
      ]
    }
  ]
}