{
  "category": "Lookup and reference functions",
  "display_name": "FORMULATEXT",
  "entry_kind": "built_in_function",
  "eval_api": {
    "method": "POST",
    "url": "https://handbook.dnacalc.com/api/eval"
  },
  "function_id": "FUNC.FORMULATEXT",
  "implementation_state": {
    "answer_bank": null,
    "detail": "Recorded: 4 workbook cells.",
    "dnacalc_commit": "9e1884369a678158dd82d3d74188daf986995e87",
    "in_catalogue": true,
    "state": "matches",
    "state_label": "Matches every recorded Excel answer",
    "summary": "Matches all 4 recorded answers",
    "workbook_corpus": {
      "cells": 5,
      "matched": 4,
      "pending": 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/host_facts.rs#L451-L451",
        "https://github.com/DnaCalc/DnaCalc/blob/9e1884369a678158dd82d3d74188daf986995e87/crates/calc-func/src/catalogue/host_facts.rs#L353-L364"
      ],
      "repository": "https://github.com/DnaCalc/DnaCalc",
      "shared_code": [
        "catalogue/host_facts::first_cell",
        "catalogue/host_facts::cell_value",
        "catalogue/host_facts::column_letters",
        "catalogue/host_facts::facts",
        "catalogue/host_facts::qualified_sheet",
        "catalogue/host_facts::cell",
        "catalogue/host_facts::s_number",
        "catalogue/host_facts::info",
        "catalogue/host_facts::sheet",
        "format/cell_info::sections",
        "format/cell_info::tokens",
        "format/cell_info::is_date_time",
        "format/cell_info::date_time_class",
        "format/cell_info::places",
        "format/cell_info::number_class",
        "format/cell_info::classify",
        "ported/a1_refs::split_prefix",
        "ported/a1_refs::parse_cell_token",
        "ported/a1_refs::parse_column_token",
        "ported/a1_refs::parse_row_token",
        "ported/a1_refs::parse_a1_reference",
        "ported/address::address_name_character",
        "ported/address::address_name_is_reference",
        "ported/address::quote_sheet_text_if_needed"
      ],
      "source": "https://github.com/DnaCalc/DnaCalc/blob/9e1884369a678158dd82d3d74188daf986995e87/crates/calc-func/src/catalogue/host_facts.rs#L451-L451",
      "state": "matches",
      "suite": null,
      "summary": "Matches all 4 recorded answers"
    }
  ],
  "json_url": "https://handbook.dnacalc.com/api/functions/FUNC.FORMULATEXT.json",
  "name": "FORMULATEXT",
  "notes": [],
  "schema": "efh.function-reference/v1",
  "section_order": [
    "what-it-does",
    "try-it",
    "quirks",
    "how-to-implement",
    "version-differences",
    "alternatives"
  ],
  "sections": {
    "alternatives": "\n[ISFORMULA](FUNC.ISFORMULA.md) checks whether a cell contains a formula. [TEXT](FUNC.TEXT.md) formats its calculated value rather than returning its formula text.\n\n\n",
    "how-to-implement": "\nResolve the reference to its first cell and ask the workbook host for its stored formula text. Do not evaluate that formula to obtain the text and do not reconstruct spelling from the result. The current host interface distinguishes “known cell without formula” (`#N/A`) from “formula information unavailable” (a typed refusal); it also rejects a closed external workbook as `#N/A`. The host must supply formula length/protection policy and formula-bar spelling. This is a host-backed function, not a pure numeric kernel.\n\n\n",
    "quirks": "\nMicrosoft documents `#N/A` when the target has no formula, the formula exceeds 8192 characters, worksheet protection hides it, or an external source workbook is closed. Invalid argument types give `#VALUE!`. A multi-cell reference selects its upper-left cell. A self-reference can return its own text without normal circular calculation.\n\n\n",
    "sources": "\n- [Microsoft: FORMULATEXT function](https://support.microsoft.com/en-us/excel/functions/formulatext-function), opened 6 November 2026; syntax, documented argument rules and errors.\n- [DnaCalc implementation](https://github.com/DnaCalc/DnaCalc/blob/da3ecc4fb19a3a5529708c311d0e8f05688ac165/crates/calc-func/src/catalogue/host_facts.rs); implementation steps and the limits identified in the text.\n\n",
    "try-it": "\nIn Excel put `=7*6` in B2, then enter `=FORMULATEXT(B2)` elsewhere. It returns the text `\"=7*6\"`, while B2 displays 42. The preview input grid currently supplies cell values, so its B2=1 control returns a worksheet error instead of an authored formula.\n\n\n",
    "version-differences": "\nNo same-input comparison between named Excel builds is recorded for this function here. The documented behaviour below is not a measurement of every Excel release.\n\n\n",
    "what-it-does": "\n`FORMULATEXT(reference)` returns the stored formula text of the referenced cell, including the leading equals sign. It inspects the workbook’s formula rather than converting the cell’s calculated value back into an expression.\n\n\n"
  },
  "signature": {
    "display": "FORMULATEXT(reference)",
    "parameters": [
      {
        "description": null,
        "name": "reference",
        "optional": false,
        "repeats": false
      }
    ],
    "trailing_repeats": false
  },
  "sources": {
    "metadata": {
      "admission": {
        "label": "implemented",
        "reason": null
      },
      "arity": {
        "max": 1,
        "min": 1
      },
      "category": "Lookup and reference functions",
      "classification": {
        "arg_preparation_profile": "RefsVisibleInAdapter",
        "coercion_lift_profile": "Custom",
        "determinism_class": "Deterministic",
        "error_collapse_profile": "None",
        "fec_dependency_profile": "RefOnly",
        "host_interaction_class": "WorkbookState",
        "kernel_signature_class": "Custom",
        "rich_value_usage": "RichBlind",
        "surface_fec_dependency_profile": "RefOnly",
        "thread_safety_class": "HostSerialized",
        "volatility_class": "NonVolatile"
      },
      "descriptions": {
        "long": null,
        "short": "The formula of a cell, as text",
        "short_source": "dna-calc-own"
      },
      "docs": {
        "english_description": "Returns the formula at the given reference as text",
        "microsoft_url": "https://support.microsoft.com/en-us/office/formulatext-function-0a786771-54fd-4ae2-96ee-09cda35439c8"
      },
      "entry_kind": "built_in_function",
      "localized_family_names": null,
      "localized_names": [
        {
          "locale": "ar-SA",
          "name": "FORMULATEXT"
        },
        {
          "locale": "bg-BG",
          "name": "FORMULATEXT"
        },
        {
          "locale": "cs-CZ",
          "name": "FORMULATEXT"
        },
        {
          "locale": "da-DK",
          "name": "FORMELTEKST"
        },
        {
          "locale": "de-DE",
          "name": "FORMULATEXT"
        },
        {
          "locale": "el-GR",
          "name": "FORMULATEXT"
        },
        {
          "locale": "en-AU",
          "name": "FORMULATEXT"
        },
        {
          "locale": "en-GB",
          "name": "FORMULATEXT"
        },
        {
          "locale": "en-US",
          "name": "FORMULATEXT"
        },
        {
          "locale": "es-ES",
          "name": "FORMULATEXTO"
        },
        {
          "locale": "et-EE",
          "name": "FORMULATEXT"
        },
        {
          "locale": "fi-FI",
          "name": "KAAVA.TEKSTI"
        },
        {
          "locale": "fr-FR",
          "name": "FORMULETEXTE*"
        },
        {
          "locale": "he-IL",
          "name": "FORMULATEXT"
        },
        {
          "locale": "hr-HR",
          "name": "FORMULATEXT"
        },
        {
          "locale": "hu-HU",
          "name": "KÉPLETSZÖVEG"
        },
        {
          "locale": "id-ID",
          "name": "FORMULATEXT"
        },
        {
          "locale": "it-IT",
          "name": "FORMULATEXT"
        },
        {
          "locale": "ja-JP",
          "name": "FORMULATEXT"
        },
        {
          "locale": "ko-KR",
          "name": "FORMULATEXT"
        },
        {
          "locale": "lt-LT",
          "name": "FORMULATEXT"
        },
        {
          "locale": "lv-LV",
          "name": "FORMULATEXT"
        },
        {
          "locale": "nb-NO",
          "name": "FORMULATEXT"
        },
        {
          "locale": "nl-NL",
          "name": "FORMULETEKST"
        },
        {
          "locale": "pl-PL",
          "name": "FORMUŁA.TEKST"
        },
        {
          "locale": "pt-BR",
          "name": "FORMULATEXT"
        },
        {
          "locale": "pt-PT",
          "name": "FÓRMULA.TEXTO"
        },
        {
          "locale": "ro-RO",
          "name": "FORMULATEXT"
        },
        {
          "locale": "ru-RU",
          "name": "Ф.ТЕКСТ"
        },
        {
          "locale": "sk-SK",
          "name": "FORMULATEXT"
        },
        {
          "locale": "sl-SI",
          "name": "FORMULATEXT"
        },
        {
          "locale": "sr-Latn-RS",
          "name": "FORMULATEXT"
        },
        {
          "locale": "sv-SE",
          "name": "FORMELTEXT"
        },
        {
          "locale": "th-TH",
          "name": "FORMULATEXT"
        },
        {
          "locale": "tr-TR",
          "name": "FORMÜLMETNİ"
        },
        {
          "locale": "uk-UA",
          "name": "FORMULATEXT"
        },
        {
          "locale": "vi-VN",
          "name": "FORMULATEXT"
        },
        {
          "locale": "zh-CN",
          "name": "FORMULATEXT"
        },
        {
          "locale": "zh-HK",
          "name": "FORMULATEXT"
        },
        {
          "locale": "zh-TW",
          "name": "FORMULATEXT"
        }
      ],
      "signature": {
        "display": "FORMULATEXT(reference)",
        "parameters": [
          {
            "description": null,
            "name": "reference",
            "optional": false,
            "repeats": false
          }
        ],
        "trailing_repeats": false
      },
      "surface_name": "FORMULATEXT",
      "version_marker": null,
      "xlcall": {
        "code": "588",
        "symbol": "xlfFormulatext"
      }
    },
    "microsoft": "https://support.microsoft.com/en-us/office/formulatext-function-0a786771-54fd-4ae2-96ee-09cda35439c8"
  },
  "try_it": {
    "formula": "=FORMULATEXT(B2)",
    "inputs": {
      "B2": 1
    },
    "note": "Input cells in this preview hold values rather than authored formulas, so FORMULATEXT cannot retrieve a stored formula here.",
    "preview_status": "worksheet-error"
  },
  "url": "https://handbook.dnacalc.com/functions/FORMULATEXT.html",
  "variants": [],
  "versions": []
}