{
  "category": "Operators",
  "display_name": "Intersection of references (space)",
  "entry_kind": "built_in_operator",
  "eval_api": {
    "method": "POST",
    "url": "https://handbook.dnacalc.com/api/eval"
  },
  "function_id": "FUNC.OP_INTERSECTION_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": [
    {
      "commit": "9e1884369a678158dd82d3d74188daf986995e87",
      "flavour": "excel-compatibility-candidate",
      "language": "Rust",
      "name": "CalcFunc",
      "own_code": [
        "https://github.com/DnaCalc/DnaCalc/blob/9e1884369a678158dd82d3d74188daf986995e87/crates/calc-fml/src/eval/refops.rs#L76-L98"
      ],
      "repository": "https://github.com/DnaCalc/DnaCalc",
      "shared_code": [
        "eval/refops::reference",
        "eval/refops::references",
        "eval/refops::bounds",
        "eval/refops::area"
      ],
      "source": "https://github.com/DnaCalc/DnaCalc/blob/9e1884369a678158dd82d3d74188daf986995e87/crates/calc-fml/src/eval/refops.rs#L76-L98",
      "state": "unmeasured",
      "suite": null,
      "summary": "Implemented; no recorded answers are attributed to this entry"
    }
  ],
  "json_url": "https://handbook.dnacalc.com/api/functions/FUNC.OP_INTERSECTION_REF.json",
  "name": "OP_INTERSECTION_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 join; this operator is the meet.\n- [`FUNC.OP_UNION_REF`](FUNC.OP_UNION_REF.md) — the list constructor.\n- [`FUNC.OP_IMPLICIT_INTERSECTION`](FUNC.OP_IMPLICIT_INTERSECTION.md) — a *different*\n  operation with a confusingly similar name. `@` scalarizes one operand relative to the\n  calling cell; this operator intersects two references with each other. They are not\n  variants of one idea.\n- [`FUNC.OP_TRIM_REF_LEADING`](FUNC.OP_TRIM_REF_LEADING.md) and its siblings — the\n  whitespace-normalization operators, which exist because whitespace around references is\n  meaningful enough to need identities of its own.\n- `INDEX`, `OFFSET`, `XLOOKUP` — the modern, explicit ways to name a cell at the crossing of\n  two coordinates, and what most workbooks should use instead.\n- `IFERROR` — because `#NULL!` is an error like any other and can be trapped.\n\n\n",
    "how-to-implement": "\n### Notes for implementers\n\n- The empty check must come before any dereference. Producing an empty area and letting a\n  consumer fail on it gives the wrong error code.\n- Whitespace handling is a parser responsibility, but the operator identity must not be lost\n  in it: a formula's stored form records the spacing, which is exactly why the trim-reference\n  operators exist as separate identities.\n- Sheet-qualified and multi-area operands are outside the contract's admitted slice; an\n  implementation should state what it does rather than assume.\n\n\n",
    "quirks": "\n### Result and edge cases\n\n- **No overlap.** `#NULL!`.\n- **Partial overlap.** The overlapping rectangle, which may be a single cell, a row segment,\n  a column segment, or a block.\n- **Whole-row against whole-column.** `1:1 A:A` is the single cell at their crossing — the\n  mechanism behind the defined-name idiom above.\n- **Multi-area operands.** Intersecting a multi-area reference (from\n  [`FUNC.OP_UNION_REF`](FUNC.OP_UNION_REF.md)) with an area is not in the contract's admitted\n  slice, and the result shape is not settled here.\n- **Non-reference operands.** No intersection exists; the result is an error.\n- **Cross-sheet operands.** Not covered by the admitted slice.\n\n\n\n### Errors\n\n\n| Error | Condition |\n|---|---|\n| `#NULL!` | The operands designate no common cell. |\n| `#REF!` | An operand is not a usable reference, or is no longer valid. |\n| any incoming error | An error operand propagates. |\n\n",
    "sources": "- `data/presence/FUNC.OP_INTERSECTION_REF.json` — implementing module\n  `earlier-implementation/operator_reference_family.rs`.\n- Handbook `content/model/01-value-universe.md` — the `#NULL!` definition (\"the intersection\n  of ranges that do not intersect (the space operator)\") and the reference shapes.\n- Handbook `content/model/03-call-pipeline.md` — operators as functions; reference-visible\n  argument preparation.\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 B` — two references separated by a space — returns the reference designating the cells\nbelonging to both.\n\n**When the operands do not overlap, the result is `#NULL!`.** The contract records this\ndirectly, and chapter 01's error table defines `#NULL!` as exactly that: the intersection of\nranges that do not intersect, produced by the space operator. This is the only place in the\nentire function surface where `#NULL!` originates. If a workbook shows `#NULL!`, an\nintersection somewhere came up empty — very often an accidental one, because the operator is\nspelled with a character that is otherwise invisible.\n\nThat invisibility is the operator's defining hazard. `=SUM(A1:A5 B1:B5)` looks like a typo\nfor a comma and evaluates as an intersection; `=A1 A2` is a valid expression. Whitespace\ninside a formula is not always insignificant, and this is why.\n\nThe classic *intentional* use is with defined names: if `Revenue` names a column and `Q2`\nnames a row, then `=Revenue Q2` reads the cell where they cross. That idiom is the reason the\noperator exists and is worth knowing even if you never write another one.\n\n\n\n### Arguments\n\n\n| Position | Name | Meaning |\n|---|---|---|\n| 0 | `A` | First reference. Required. |\n| 1 | `B` | Second reference. Required. |\n\nArity is exactly 2; no optional arguments, no defaults. Intersection is commutative and\nassociative on areas, so chains behave as expected. Both operands must be reference-shaped;\nthe contract records the admitted operand shapes as A1-style cells, areas, whole rows and\nwhole columns.\n\n\n"
  },
  "signature": {
    "display": "A B",
    "parameters": [
      {
        "description": null,
        "name": "A",
        "optional": false,
        "repeats": false
      },
      {
        "description": null,
        "name": "B",
        "optional": false,
        "repeats": false
      }
    ],
    "trailing_repeats": false
  },
  "sources": {
    "metadata": {
      "admission": {
        "label": "formula_layer",
        "reason": null
      },
      "arity": {
        "max": 2,
        "min": 2
      },
      "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 B",
        "parameters": [
          {
            "description": null,
            "name": "A",
            "optional": false,
            "repeats": false
          },
          {
            "description": null,
            "name": "B",
            "optional": false,
            "repeats": false
          }
        ],
        "trailing_repeats": false
      },
      "surface_name": "OP_INTERSECTION_REF",
      "version_marker": null,
      "xlcall": null
    },
    "microsoft": null
  },
  "try_it": {
    "formula": "=SUM(B2:C3 B3:C4)",
    "inputs": {
      "B2": 1,
      "B3": 2,
      "B4": 3,
      "C2": 10,
      "C3": 20,
      "C4": 30
    }
  },
  "url": "https://handbook.dnacalc.com/functions/OP_INTERSECTION_REF.html",
  "variants": [],
  "versions": []
}