{
  "category": "Operators",
  "display_name": "Spill reference (#)",
  "entry_kind": "built_in_operator",
  "eval_api": {
    "method": "POST",
    "url": "https://handbook.dnacalc.com/api/eval"
  },
  "function_id": "FUNC.OP_SPILL_REF",
  "implementation_state": {
    "answer_bank": null,
    "detail": "Handled by the formula layer, which owns references; answers are recorded through whole formulas, not attributed to the operator.",
    "dnacalc_commit": "9e1884369a678158dd82d3d74188daf986995e87",
    "in_catalogue": false,
    "state": "unmeasured",
    "state_label": "Implemented, no recorded answers attributed to it",
    "summary": "Implemented; no recorded answers are attributed to this entry",
    "workbook_corpus": null
  },
  "implementations": [],
  "json_url": "https://handbook.dnacalc.com/api/functions/FUNC.OP_SPILL_REF.json",
  "name": "OP_SPILL_REF",
  "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- [`FUNC.OP_RANGE_REF`](FUNC.OP_RANGE_REF.md) — the static way to name a region, by corners.\n  `A1#` and `A1:C3` may designate the same cells today and different cells tomorrow.\n- [`FUNC.OP_IMPLICIT_INTERSECTION`](FUNC.OP_IMPLICIT_INTERSECTION.md) — the operator that\n  goes the other way, collapsing an array-or-reference result to a single value. `@` and `#`\n  are the two halves of the dynamic-array compatibility story: one refuses spilling, the\n  other consumes it.\n- `SINGLE`/`_xlfn.SINGLE` is recorded in chapter 05 as the compatibility/serialization\n  representation of `@`. This Handbook has **not** recorded the corresponding\n  compatibility-serialization name for `#`, and does not assert one here.\n- `ANCHORARRAY` — commonly reported as the serialized form of `#` in older builds. Not\n  recorded in this Handbook's data, and stated here only as a pointer for someone probing the\n  file format, not as a claim.\n- `ROWS`, `COLUMNS`, `COUNTA`, `SUMPRODUCT` — typical consumers that resolve the region.\n- `TAKE`, `DROP`, `CHOOSEROWS`, `SORT`, `FILTER` — the modern array functions whose results\n  are usually what `#` is pointed at.\n\n\n",
    "how-to-implement": "\n### Notes for implementers\n\n\n- Keep formation and resolution separate, exactly as the contract does. An implementation\n  that resolves the spill region inside the operator cannot represent \"the anchor exists but\n  the spill does not yet\", and will report the wrong error at the wrong time.\n- Validate anchor shape at formation: single cell, or an already-tagged anchor. Reject\n  multi-cell operands rather than silently taking their top-left.\n- Make the reference re-resolve on recalculation. A cached extent is a correctness bug that\n  looks like a stale-value bug.\n- Record the dependency on the anchor's spill extent, not merely on the anchor cell, or the\n  calculation chain will miss updates when the spill grows.\n- The operator interacts with workbook state (`HostInteractionClass::WorkbookState`); it is\n  not a pure value function even though it takes one operand.\n\n\n",
    "quirks": "\n### Result and edge cases\n\n- **Nothing spilled at the anchor.** The reference still forms; the failure surfaces\n  downstream when the region is resolved. The contract records downstream dereference\n  failures as resolver-level `#REF!` behaviour.\n- **Anchor cell holds a scalar.** A single-cell result is a spill of size 1 in the dynamic-\n  array model; whether `A#` on such a cell is valid is not settled here.\n- **Invalid anchor shape.** A multi-cell operand is rejected in the admitted slice, surfacing\n  as `#REF!`.\n- **The reference is live.** The extent is whatever the spill currently is, so a formula\n  consuming `A#` recalculates when the spill's size changes. That is the operator's purpose,\n  and also its main performance consideration.\n- **No coercion, no lifting.** This operator sits outside the scalar coercion story\n  entirely.\n\n\n\n### Errors\n\n\n| Error | Condition |\n|---|---|\n| `#REF!` | The operand is not a usable anchor (including a multi-cell operand in the admitted slice), or a downstream dereference of the formed reference fails. |\n| `#SPILL!` | Not produced by this operator. It is the error of a spill that *could not happen* — something blocking the target region — and belongs to the formula that spills, not to the operator that names the result. |\n| any incoming error | An error operand propagates. |\n\n",
    "sources": "- `data/presence/FUNC.OP_SPILL_REF.json` — implementing module\n  `earlier-implementation/op_spill_ref.rs`, the family slug for this page.\n- Handbook `content/model/01-value-universe.md` (reference shapes including spill anchor;\n  `#SPILL!` and `#REF!`), `03-call-pipeline.md`, `05-version-axes.md` (the `@` /\n  `_xlfn.SINGLE` compatibility-representation record, cited for contrast).\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`A#` takes a reference to a cell that anchors a spilled dynamic-array result and returns a\nreference to the whole spilled region — however large it currently is.\n\nThe essential idea is *deferred extent*. `B1#` does not mean \"B1 through B10\"; it means \"the\nregion B1 spilled\", and that region is resolved when the reference is used. A formula written\nagainst `B1#` follows the spill as it grows and shrinks, which is what makes dynamic arrays\ncomposable without helper columns or volatile functions.\n\n- The operator **forms spill-anchor reference identity**. Successful evaluation returns a\n  `Reference` whose shape is `SpillAnchor` (chapter 01's reference-shape table).\n- The operator does **not** resolve spill size or even spill existence. \"Spill existence and\n  spill-range materialization are downstream resolver concerns, not operator-formation\n  concerns.\"\n\nSo `A#` is a constructor, not a lookup. Asking whether anything actually spilled at `A1`\nhappens later, in whatever consumes the reference.\n\nThe contract also records that an already-spill-anchor target remains stable under a second\napplication, so `A1##` does not compound into anything new.\n\n\n\n### Arguments\n\n\n| Position | Name | Meaning |\n|---|---|---|\n| 0 | `A` | The anchor reference: the top-left cell of a spilled result. Required. |\n\nArity is exactly 1; no optional arguments, no defaults. The operator is postfix.\n\nThe operand must be an anchor-shaped reference. The contract records the admitted runtime\nslice as A1-style *single-cell* anchors, already-tagged spill anchors, and non-A1 symbolic\nanchor names passed through as spill-anchor text — and records that multi-cell A1 areas are\nrejected as invalid anchors. A range is not an anchor: `A1:B2#` has no meaning under that\nslice.\n\n"
  },
  "signature": {
    "display": "A#",
    "parameters": [],
    "trailing_repeats": null
  },
  "sources": {
    "metadata": {
      "admission": {
        "label": "formula_layer",
        "reason": null
      },
      "arity": {
        "max": 1,
        "min": 1
      },
      "category": "Operators",
      "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": "SafePure",
        "volatility_class": "NonVolatile"
      },
      "descriptions": {
        "long": null,
        "short": null,
        "short_source": "no-short-description"
      },
      "docs": null,
      "entry_kind": "built_in_operator",
      "localized_family_names": null,
      "localized_names": [],
      "signature": {
        "display": "A#",
        "parameters": [],
        "trailing_repeats": null
      },
      "surface_name": "OP_SPILL_REF",
      "version_marker": null,
      "xlcall": null
    },
    "microsoft": null
  },
  "try_it": {
    "formula": "=SUM(B2#)",
    "inputs": {
      "B2": 1
    },
    "note": "The spill operator needs a worksheet spill. OneCalc cannot provide a spilled worksheet range in this preview.",
    "preview_status": "worksheet-error"
  },
  "url": "https://handbook.dnacalc.com/functions/OP_SPILL_REF.html",
  "variants": [],
  "versions": []
}