{
  "category": "Information functions",
  "display_name": "TYPE",
  "entry_kind": "built_in_function",
  "eval_api": {
    "method": "POST",
    "url": "https://handbook.dnacalc.com/api/eval"
  },
  "function_id": "FUNC.TYPE",
  "implementation_state": {
    "answer_bank": {
      "excel_builds": [
        "20430"
      ],
      "larger_numeric": 0,
      "last_bit": 0,
      "matched": 1227,
      "other_mismatch": 0,
      "refused": 0,
      "rows": 1227,
      "unread": 0,
      "worst_ulp": 0
    },
    "detail": "Recorded: 1,227 in the answer bank and 355 workbook cells.",
    "dnacalc_commit": "9e1884369a678158dd82d3d74188daf986995e87",
    "in_catalogue": true,
    "state": "matches",
    "state_label": "Matches every recorded Excel answer",
    "summary": "Matches all 1,582 recorded answers",
    "workbook_corpus": {
      "cells": 357,
      "matched": 355,
      "pending": 2
    }
  },
  "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#L104-L104",
        "https://github.com/DnaCalc/DnaCalc/blob/9e1884369a678158dd82d3d74188daf986995e87/crates/calc-func/src/catalogue/information.rs#L363-L396",
        "https://github.com/DnaCalc/DnaCalc/blob/9e1884369a678158dd82d3d74188daf986995e87/crates/calc-func/src/catalogue/information.rs#L398-L408"
      ],
      "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::one_cell",
        "catalogue/information::referenced"
      ],
      "source": "https://github.com/DnaCalc/DnaCalc/blob/9e1884369a678158dd82d3d74188daf986995e87/crates/calc-func/src/catalogue/information.rs#L104-L104",
      "state": "matches",
      "suite": null,
      "summary": "Matches all 1,582 recorded answers"
    }
  ],
  "json_url": "https://handbook.dnacalc.com/api/functions/FUNC.TYPE.json",
  "name": "TYPE",
  "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- **The IS family** answers the same questions one bit at a time. The correspondence is exact\n  where both exist: `TYPE=1` matches `ISNUMBER`, `TYPE=2` matches `ISTEXT`, `TYPE=4` matches\n  `ISLOGICAL`, `TYPE=16` matches `ISERROR`. There is no IS function for `64`, which is why\n  `TYPE(x)=64` is the standard array test.\n- **`ERROR.TYPE`** refines `TYPE`'s `16` into a code 1–8. The two functions are complementary and\n  are often used together: `TYPE` to branch, `ERROR.TYPE` to diagnose.\n- **`ISBLANK`** covers the distinction `TYPE` erases — `Empty` versus `Number` — because both\n  report as `1`.\n- **`ISFORMULA`** covers the distinction Microsoft's remark says `TYPE` cannot make.\n- **`ISREF`** covers the reference case `TYPE` never sees.\n- **`CELL(\"type\", ref)`** is a different function with a confusingly similar name and a much\n  coarser answer: it reports `\"b\"`, `\"l\"` or `\"v\"` (blank, label, value) for a cell, is\n  host-dependent, and is not a substitute for `TYPE`.\n- **`N` and `T`** are the projections that pair with `TYPE`'s classification.\n\n\n",
    "how-to-implement": "\n### Notes for implementers\n\n\n1. **`TYPE` of an array is `64`, not an array of codes.** This is the axis on which `TYPE`\n   diverges from the entire IS family, and routing `TYPE` through a shared elementwise lift\n   helper silently breaks it. It is the single most likely implementation error on this function.\n2. **`Empty` and `Missing` need an explicit mapping.** Microsoft's table names neither. Whatever\n   an engine chooses should be a recorded decision awaiting evidence, not a fall-through.\n3. **Decide about 128 deliberately.** An engine that cannot produce compound data has no 128\n   case, which is defensible — but it should be recorded as \"unreachable here\", not as\n   \"documented code omitted\".\n4. **The codes are stable numbers, not an enum's ordinal.** They must be emitted as the literal\n   published values; there is no reordering freedom.\n5. **Errors are classified, not propagated.** As with the IS classifiers, the error has to reach\n   the kernel.\n\n\n",
    "quirks": "\n### Result and edge cases\n\n\nReturns a `Number` — one of the codes above.\n\n- **An error input returns `16`; it does not propagate.** `TYPE` is a classifier, so an error is\n  a subject, not a failure. `TYPE(#DIV/0!)` is `16`, and so is `TYPE(#N/A)`. `TYPE` cannot tell\n  you *which* error; `ERROR.TYPE` can.\n- **An array input returns `64` as a single scalar.** This is the behaviour that distinguishes\n  `TYPE` from every IS-family classifier: they lift elementwise over an array and return a mask,\n  while `TYPE` looks at the argument as a whole and reports \"this is an array\". The reference\n  engine implements exactly that. It makes `TYPE` the only cheap way to ask \"did this expression\n  produce an array?\".\n- **Code 128, \"compound data\", is in the documentation and is not reachable in the reference\n  engine**, whose declared code map has no 128 case. What produces a 128 in current Excel — if\n  anything still does — the Handbook does not know. This is the page's clearest documented /\n  implemented gap and is probe 1 below.\n- **Codes 8 and 32 do not appear** in Microsoft's table.\n\n\n",
    "sources": "- Microsoft, \"TYPE function\" —\n  <https://support.microsoft.com/en-us/office/type-function-45b4e688-4bc3-48b3-a105-ffa892995899>.\n  Read for this page: the full code table verbatim, including the 128 row, and both remarks —\n  the `ARGUMENT`/`INPUT` usage note and the statement that `TYPE` cannot detect a formula.\n- Microsoft, \"IS functions\" —\n  <https://support.microsoft.com/en-us/office/is-functions-0f2d7971-6019-40a0-a171-f2d869135665>.\n  Read for the classifier correspondences named above.\n- Handbook, [the value universe](../model/01-value-universe.md) — the kind inventory, the\n  Empty-at-publication rule, and rich values as an extension layer.\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.TYPE.json).",
    "what-it-does": "\n`TYPE(value)` returns a number naming the value's kind. Microsoft's table, verbatim:\n\n| If value is | `TYPE` returns |\n|---|---|\n| Number | 1 |\n| Text | 2 |\n| Logical value | 4 |\n| Error value | 16 |\n| Array | 64 |\n| Compound data | 128 |\n\nThe codes are **powers of two** — 1, 2, 4, 16, 64, 128 — with 8 and 32 unused in the published\ntable. That is not decoration: the numbering descends from a bit-flag encoding of admissible\nargument types in Excel's macro-sheet heritage, which is also why the documentation's own\nexamples of the function's usefulness are the macro-era `ARGUMENT` and `INPUT`. Nothing in\n`TYPE`'s worksheet behaviour requires you to know that, but it explains why the codes skip.\n\n`TYPE` answers the same question as the IS-family classifiers, in one call instead of five, and\nin a form you can `CHOOSE` or `SWITCH` on. Where `ISNUMBER` is a boolean, `TYPE` is a\ndiscriminator.\n\nMicrosoft states one limit explicitly and it is the one users trip over: \"You cannot use TYPE to\ndetermine whether a cell contains a formula. TYPE only determines the type of the resulting, or\ndisplayed, value. If value is a cell reference to a cell that contains a formula, TYPE returns\nthe type of the formula's resulting value.\" `ISFORMULA` is the function for that question.\n\n\n\n### Arguments\n\n\n`value` — required, exactly one. The published signature is `TYPE(value)`.\n\nThe values-only resolution is also why a single-cell reference and the value inside it are\nindistinguishable to `TYPE` — see [the call pipeline](../model/03-call-pipeline.md) on the 1x1\ncollapse.\n\n\n"
  },
  "signature": {
    "display": "TYPE(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": "Number saying what kind of value an argument is",
        "short_source": "dna-calc-own"
      },
      "docs": {
        "english_description": "Returns a number indicating the data type of a value",
        "microsoft_url": "https://support.microsoft.com/en-us/office/type-function-45b4e688-4bc3-48b3-a105-ffa892995899"
      },
      "entry_kind": "built_in_function",
      "localized_family_names": null,
      "localized_names": [
        {
          "locale": "ar-SA",
          "name": "النوع"
        },
        {
          "locale": "bg-BG",
          "name": "TYPE"
        },
        {
          "locale": "cs-CZ",
          "name": "TYPE (TYP)"
        },
        {
          "locale": "da-DK",
          "name": "TYPE"
        },
        {
          "locale": "de-DE",
          "name": "TYPE"
        },
        {
          "locale": "el-GR",
          "name": "TYPE"
        },
        {
          "locale": "en-AU",
          "name": "TYPE"
        },
        {
          "locale": "en-GB",
          "name": "TYPE"
        },
        {
          "locale": "en-US",
          "name": "TYPE"
        },
        {
          "locale": "es-ES",
          "name": "TIPO"
        },
        {
          "locale": "et-EE",
          "name": "TYPE"
        },
        {
          "locale": "fi-FI",
          "name": "TYPE (Tyyppi)"
        },
        {
          "locale": "fr-FR",
          "name": "TYPE (TYPE)"
        },
        {
          "locale": "he-IL",
          "name": "TYPE"
        },
        {
          "locale": "hr-HR",
          "name": "VRSTA"
        },
        {
          "locale": "hu-HU",
          "name": "TYPE (TÍPUS)"
        },
        {
          "locale": "id-ID",
          "name": "TIPE"
        },
        {
          "locale": "it-IT",
          "name": "TYPE"
        },
        {
          "locale": "ja-JP",
          "name": "TYPE"
        },
        {
          "locale": "ko-KR",
          "name": "TYPE(종류)"
        },
        {
          "locale": "lt-LT",
          "name": "TIPAS"
        },
        {
          "locale": "lv-LV",
          "name": "TIPS"
        },
        {
          "locale": "nb-NO",
          "name": "TYPE"
        },
        {
          "locale": "nl-NL",
          "name": "TYPE"
        },
        {
          "locale": "pl-PL",
          "name": "TYPE (TYP)"
        },
        {
          "locale": "pt-BR",
          "name": "TIPO"
        },
        {
          "locale": "pt-PT",
          "name": "TYPE"
        },
        {
          "locale": "ro-RO",
          "name": "TIP"
        },
        {
          "locale": "ru-RU",
          "name": "TYPE (ТИП)"
        },
        {
          "locale": "sk-SK",
          "name": "TYP"
        },
        {
          "locale": "sl-SI",
          "name": "TYPE (VRSTA)"
        },
        {
          "locale": "sr-Latn-RS",
          "name": "TIP"
        },
        {
          "locale": "sv-SE",
          "name": "TYP"
        },
        {
          "locale": "th-TH",
          "name": "ชนิด"
        },
        {
          "locale": "tr-TR",
          "name": "TÜR"
        },
        {
          "locale": "uk-UA",
          "name": "TYPE (ТИП)"
        },
        {
          "locale": "vi-VN",
          "name": "LOẠI"
        },
        {
          "locale": "zh-CN",
          "name": "TYPE"
        },
        {
          "locale": "zh-HK",
          "name": "TYPE (類型)"
        },
        {
          "locale": "zh-TW",
          "name": "TYPE (類型)"
        }
      ],
      "signature": {
        "display": "TYPE(value)",
        "parameters": [
          {
            "description": null,
            "name": "value",
            "optional": false,
            "repeats": false
          }
        ],
        "trailing_repeats": false
      },
      "surface_name": "TYPE",
      "version_marker": null,
      "xlcall": {
        "code": "86",
        "symbol": "xlfType"
      }
    },
    "microsoft": "https://support.microsoft.com/en-us/office/type-function-45b4e688-4bc3-48b3-a105-ffa892995899"
  },
  "try_it": {
    "formula": "=TYPE(0)"
  },
  "url": "https://handbook.dnacalc.com/functions/TYPE.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.TYPE.json"
      ]
    }
  ]
}