{
  "category": "Lookup and reference functions",
  "display_name": "COLUMN",
  "entry_kind": "built_in_function",
  "eval_api": {
    "method": "POST",
    "url": "https://handbook.dnacalc.com/api/eval"
  },
  "function_id": "FUNC.COLUMN",
  "implementation_state": {
    "answer_bank": null,
    "detail": "Recorded: 9 workbook cells.",
    "dnacalc_commit": "9e1884369a678158dd82d3d74188daf986995e87",
    "in_catalogue": true,
    "state": "matches",
    "state_label": "Matches every recorded Excel answer",
    "summary": "Matches all 9 recorded answers",
    "workbook_corpus": {
      "cells": 10,
      "matched": 9,
      "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/lookup.rs#L211-L217"
      ],
      "repository": "https://github.com/DnaCalc/DnaCalc",
      "shared_code": [
        "catalogue/lookup::eager",
        "catalogue/lookup::pattern",
        "catalogue/lookup::matches",
        "catalogue/lookup::Line::len",
        "catalogue/lookup::Line::scan",
        "catalogue/lookup::reader",
        "catalogue/lookup::cell_value",
        "catalogue/lookup::rows",
        "catalogue/lookup::columns",
        "catalogue/lookup::value",
        "catalogue/lookup::span",
        "catalogue/lookup::shape",
        "catalogue/lookup::index_number",
        "catalogue/lookup::index",
        "catalogue/lookup::selector",
        "catalogue/lookup::indexed",
        "catalogue/lookup::select",
        "catalogue/lookup::row",
        "catalogue/lookup::column",
        "catalogue/lookup::position_of",
        "catalogue/lookup::areas"
      ],
      "source": "https://github.com/DnaCalc/DnaCalc/blob/9e1884369a678158dd82d3d74188daf986995e87/crates/calc-func/src/catalogue/lookup.rs#L211-L217",
      "state": "matches",
      "suite": null,
      "summary": "Matches all 9 recorded answers"
    }
  ],
  "json_url": "https://handbook.dnacalc.com/api/functions/FUNC.COLUMN.json",
  "name": "COLUMN",
  "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- **`ROW`** is the same function on the other axis and shares every structural property: the\n  optional argument, the caller-context default, the array result over a range.\n- **`COLUMNS`** counts columns; `COLUMN` locates them. `COLUMNS(A1:E1)` is 5, `COLUMN(A1:E1)` is\n  the array 1…5. The near-identical names for genuinely different operations are a standing\n  source of confusion, and the same trap exists for `ROW`/`ROWS`.\n- **`SEQUENCE`** replaces the historical use of `COLUMN(range)` as a horizontal counter, and\n  does so without depending on where the range happens to sit.\n- **`ADDRESS`** consumes coordinates; `COLUMN` produces them.\n- **`CELL(\"col\", ref)`** answers the same question through the workbook-metadata route.\n- **`OFFSET` and `INDEX`** are the functions you feed a computed column number to.\n\n\n",
    "how-to-implement": "\n### Notes for implementers\n\n- **`COLUMN()` is not evaluable without a host.** The reference implementation classifies it\n  `HostSerialized` and dependent on caller context; an implementation with no notion of a\n  calling cell cannot answer the no-argument form at all, and should say so rather than invent\n  a default. This is a real fault line between a function library and a calculation engine.\n- **The relative/absolute distinction is irrelevant here.** `$A$1` and `A1` have the same column\n  number; `COLUMN` reads the resolved coordinate, not the formula text.\n- **Copying a formula changes the answer** in the no-argument form and, through relative\n  reference adjustment, usually in the argument form as well. Any caching layer keyed on formula\n  text rather than on cell position will be wrong for this function.\n\n\n",
    "quirks": "\n### Result and edge cases\n\n\nReturn kind: `Number` for a single cell; `Array` (a horizontal array of column numbers) for a\nmulti-column range, per Microsoft's documentation.\n\nEdge cases specific to this function:\n\n- **A multi-row, single-column range.** The column number is constant down the range. Whether\n  the result is a single number or an array of repeated numbers is a shape question the\n  Handbook has not settled.\n- **A whole-column reference** (`A:A`) — one column, so presumably 1, but the interaction with\n  the array-returning rule is untested here.\n- **A three-dimensional reference** (`Sheet1:Sheet3!A1`) — the coordinate is well defined but\n  the reference shape is distinct in the value model.\n- **A spill anchor** (`B1#`) — the referenced range's extent is dynamic, so the result's shape\n  is too.\n- **Inside a lifted or iterated context** (a `LAMBDA` body, `BYCOL`, a defined name evaluated\n  from several cells) the \"calling cell\" that `COLUMN()` reports is a question about the\n  execution context, not about this function's kernel — and it is exactly where caller-aware\n  functions get surprising.\n\n\n\n### Errors\n\n\nMicrosoft's page does not publish an error table for `COLUMN`. The expected failure is a\nnon-reference argument — `COLUMN(5)`, `COLUMN(\"A1\")` — for which `#VALUE!` is this family's\nconventional code; the Handbook records that as expected, not verified. An error value passed as\nthe argument propagates under the universal rule in\n[coercion and lifting](../model/02-coercion-and-lifting.md).\n\n\n",
    "sources": "\n- Microsoft, COLUMN function —\n  <https://support.microsoft.com/en-us/office/column-function-44e8c754-711c-4df3-9da4-47a55042554b>\n  (optional argument, calling-cell default, and the horizontal-array result over a range).\n- Handbook `content/model/01-value-universe.md` (Missing versus Empty; reference shapes).\n- Handbook `content/model/02-coercion-and-lifting.md` (error propagation; reference resolution\n  as an explicit step).\n- Handbook `content/model/03-call-pipeline.md` (`RefsVisibleInAdapter`; caller-aware functions).\n- Handbook `data/functions/FUNC.COLUMN.json` and `data/presence/FUNC.COLUMN.json` (arity,\n  classification axes including `CallerContext` and `HostSerialized`, implementing module).\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`COLUMN([reference])` returns the column coordinate of a reference as a number: column `A` is 1,\n`B` is 2, and so on. Called with no argument it returns the column coordinate **of the cell\ncontaining the formula**.\n\nMicrosoft documents that when `reference` is a range of cells, `COLUMN` returns the column\nnumbers of that range as a horizontal array. In modern Excel that array spills; in\npre-dynamic-array Excel it required array entry. This is the property that makes `COLUMN` a\nsequence generator in older workbooks — `COLUMN(A1:E1)` as a stand-in for `SEQUENCE`.\n\n\n\n### Arguments\n\n\n| Argument | Meaning |\n|---|---|\n| `reference` | Optional. The cell or range whose column number you want. Omitted means the calling cell. |\n\nTwo things about this single argument are commonly misunderstood.\n\n**Omitted is not the same as empty.** `COLUMN()` delivers the Missing marker and selects the\ncaller-context behaviour; `COLUMN(A1)` where `A1` is blank delivers a perfectly good reference\nto an empty cell and returns 1. The value model keeps Missing and Empty distinct precisely so\nthat functions like this one can branch on the difference — see\n[the value universe](../model/01-value-universe.md).\n\n**The documentation for the sibling `ROW` states that its reference cannot refer to multiple\nareas**, and the same restriction should be expected here; the Handbook has not established what\n`COLUMN` does with a union reference.\n\n\n"
  },
  "signature": {
    "display": "COLUMN([reference])",
    "parameters": [
      {
        "description": null,
        "name": "reference",
        "optional": true,
        "repeats": false
      }
    ],
    "trailing_repeats": false
  },
  "sources": {
    "metadata": {
      "admission": {
        "label": "implemented",
        "reason": null
      },
      "arity": {
        "max": 1,
        "min": 0
      },
      "category": "Lookup and reference functions",
      "classification": {
        "arg_preparation_profile": "RefsVisibleInAdapter",
        "coercion_lift_profile": "Custom",
        "determinism_class": "Deterministic",
        "error_collapse_profile": "None",
        "fec_dependency_profile": "CallerContext",
        "host_interaction_class": "WorkbookState",
        "kernel_signature_class": "Custom",
        "rich_value_usage": "RichBlind",
        "surface_fec_dependency_profile": "CallerContext",
        "thread_safety_class": "HostSerialized",
        "volatility_class": "NonVolatile"
      },
      "descriptions": {
        "long": null,
        "short": "Column number of the first cell of a reference (of the formula's cell when left out)",
        "short_source": "dna-calc-own"
      },
      "docs": {
        "english_description": "Returns the column number of a reference",
        "microsoft_url": "https://support.microsoft.com/en-us/office/column-function-44e8c754-711c-4df3-9da4-47a55042554b"
      },
      "entry_kind": "built_in_function",
      "localized_family_names": null,
      "localized_names": [
        {
          "locale": "ar-SA",
          "name": "COLUMN"
        },
        {
          "locale": "bg-BG",
          "name": "COLUMN"
        },
        {
          "locale": "cs-CZ",
          "name": "COLUMN"
        },
        {
          "locale": "da-DK",
          "name": "COLUMN"
        },
        {
          "locale": "de-DE",
          "name": "COLUMN"
        },
        {
          "locale": "el-GR",
          "name": "COLUMN"
        },
        {
          "locale": "en-AU",
          "name": "COLUMN"
        },
        {
          "locale": "en-GB",
          "name": "COLUMN"
        },
        {
          "locale": "en-US",
          "name": "COLUMN"
        },
        {
          "locale": "es-ES",
          "name": "COLUMN"
        },
        {
          "locale": "et-EE",
          "name": "COLUMN"
        },
        {
          "locale": "fi-FI",
          "name": "SARAKE"
        },
        {
          "locale": "fr-FR",
          "name": "COLUMN"
        },
        {
          "locale": "he-IL",
          "name": "COLUMN"
        },
        {
          "locale": "hr-HR",
          "name": "COLUMN"
        },
        {
          "locale": "hu-HU",
          "name": "COLUMN"
        },
        {
          "locale": "id-ID",
          "name": "COLUMN"
        },
        {
          "locale": "it-IT",
          "name": "COLUMN"
        },
        {
          "locale": "ja-JP",
          "name": "COLUMN"
        },
        {
          "locale": "ko-KR",
          "name": "COLUMN"
        },
        {
          "locale": "lt-LT",
          "name": "COLUMN"
        },
        {
          "locale": "lv-LV",
          "name": "COLUMN"
        },
        {
          "locale": "nb-NO",
          "name": "COLUMN"
        },
        {
          "locale": "nl-NL",
          "name": "COLUMN"
        },
        {
          "locale": "pl-PL",
          "name": "COLUMN"
        },
        {
          "locale": "pt-BR",
          "name": "COLUMN"
        },
        {
          "locale": "pt-PT",
          "name": "COLUMN"
        },
        {
          "locale": "ro-RO",
          "name": "COLUMN"
        },
        {
          "locale": "ru-RU",
          "name": "COLUMN"
        },
        {
          "locale": "sk-SK",
          "name": "COLUMN"
        },
        {
          "locale": "sl-SI",
          "name": "COLUMN"
        },
        {
          "locale": "sr-Latn-RS",
          "name": "COLUMN"
        },
        {
          "locale": "sv-SE",
          "name": "COLUMN"
        },
        {
          "locale": "th-TH",
          "name": "COLUMN"
        },
        {
          "locale": "tr-TR",
          "name": "SÜTUN"
        },
        {
          "locale": "uk-UA",
          "name": "COLUMN"
        },
        {
          "locale": "vi-VN",
          "name": "COLUMN"
        },
        {
          "locale": "zh-CN",
          "name": "COLUMN"
        },
        {
          "locale": "zh-HK",
          "name": "COLUMN"
        },
        {
          "locale": "zh-TW",
          "name": "COLUMN"
        }
      ],
      "signature": {
        "display": "COLUMN([reference])",
        "parameters": [
          {
            "description": null,
            "name": "reference",
            "optional": true,
            "repeats": false
          }
        ],
        "trailing_repeats": false
      },
      "surface_name": "COLUMN",
      "version_marker": null,
      "xlcall": {
        "code": "9",
        "symbol": "xlfColumn"
      }
    },
    "microsoft": "https://support.microsoft.com/en-us/office/column-function-44e8c754-711c-4df3-9da4-47a55042554b"
  },
  "try_it": {
    "formula": "=COLUMN(B3)",
    "inputs": {
      "B3": 2
    }
  },
  "url": "https://handbook.dnacalc.com/functions/COLUMN.html",
  "variants": [],
  "versions": []
}