Lookup and reference functions

COLUMN

Matches all 9 recorded answers

Recorded: 9 workbook cells. How we measure this · See the Rust code

Local names in 40 languages
LanguageName in Excel
ArabicCOLUMN
BulgarianCOLUMN
CzechCOLUMN
DanishCOLUMN
GermanCOLUMN
GreekCOLUMN
English (Australia)COLUMN
English (United Kingdom)COLUMN
English (United States)COLUMN
SpanishCOLUMN
EstonianCOLUMN
FinnishSARAKE
FrenchCOLUMN
HebrewCOLUMN
CroatianCOLUMN
HungarianCOLUMN
IndonesianCOLUMN
ItalianCOLUMN
JapaneseCOLUMN
KoreanCOLUMN
LithuanianCOLUMN
LatvianCOLUMN
NorwegianCOLUMN
DutchCOLUMN
PolishCOLUMN
Portuguese (Brazil)COLUMN
Portuguese (Portugal)COLUMN
RomanianCOLUMN
RussianCOLUMN
SlovakCOLUMN
SlovenianCOLUMN
Serbian (Latin)COLUMN
SwedishCOLUMN
ThaiCOLUMN
TurkishSÜTUN
UkrainianCOLUMN
VietnameseCOLUMN
Chinese (Simplified)COLUMN
Chinese (Hong Kong)COLUMN
Chinese (Traditional)COLUMN

Names from Microsoft's support site.

What it does

COLUMN([reference])

COLUMN([reference]) returns the column coordinate of a reference as a number: column A is 1, B is 2, and so on. Called with no argument it returns the column coordinate of the cell containing the formula.

Microsoft documents that when reference is a range of cells, COLUMN returns the column numbers of that range as a horizontal array. In modern Excel that array spills; in pre-dynamic-array Excel it required array entry. This is the property that makes COLUMN a sequence generator in older workbooks — COLUMN(A1:E1) as a stand-in for SEQUENCE.

Arguments

ArgumentMeaning
referenceOptional. The cell or range whose column number you want. Omitted means the calling cell.

Two things about this single argument are commonly misunderstood.

Omitted is not the same as empty. COLUMN() delivers the Missing marker and selects the caller-context behaviour; COLUMN(A1) where A1 is blank delivers a perfectly good reference to an empty cell and returns 1. The value model keeps Missing and Empty distinct precisely so that functions like this one can branch on the difference — see the value universe.

The documentation for the sibling ROW states that its reference cannot refer to multiple areas, and the same restriction should be expected here; the Handbook has not established what COLUMN does with a union reference.

Try it

Input cells (optional)

Example: {"B2": 3, "B3": 4}. A1 holds the formula. Other cells need values before a formula can read them.

Enter a formula, then calculate.

Runs locally in your browser with OneCalc. Its answer may differ from Excel. Use English function names and commas between arguments.

Quirks

Result and edge cases

Return kind: Number for a single cell; Array (a horizontal array of column numbers) for a multi-column range, per Microsoft's documentation.

Edge cases specific to this function:

  • A multi-row, single-column range. The column number is constant down the range. Whether the result is a single number or an array of repeated numbers is a shape question the Handbook has not settled.
  • A whole-column reference (A:A) — one column, so presumably 1, but the interaction with the array-returning rule is untested here.
  • A three-dimensional reference (Sheet1:Sheet3!A1) — the coordinate is well defined but the reference shape is distinct in the value model.
  • A spill anchor (B1#) — the referenced range's extent is dynamic, so the result's shape is too.
  • Inside a lifted or iterated context (a LAMBDA body, BYCOL, a defined name evaluated from several cells) the "calling cell" that COLUMN() reports is a question about the execution context, not about this function's kernel — and it is exactly where caller-aware functions get surprising.

Errors

Microsoft's page does not publish an error table for COLUMN. The expected failure is a non-reference argument — COLUMN(5), COLUMN("A1") — for which #VALUE! is this family's conventional code; the Handbook records that as expected, not verified. An error value passed as the argument propagates under the universal rule in coercion and lifting.

How to implement

Notes for implementers

  • COLUMN() is not evaluable without a host. The reference implementation classifies it HostSerialized and dependent on caller context; an implementation with no notion of a calling cell cannot answer the no-argument form at all, and should say so rather than invent a default. This is a real fault line between a function library and a calculation engine.
  • The relative/absolute distinction is irrelevant here. $A$1 and A1 have the same column number; COLUMN reads the resolved coordinate, not the formula text.
  • Copying a formula changes the answer in the no-argument form and, through relative reference adjustment, usually in the argument form as well. Any caching layer keyed on formula text rather than on cell position will be wrong for this function.

Rust code

Show the CalcFunc source of this function

Quoted from the public repository DnaCalc/DnaCalc, crates calc-func and calc-fml, at commit 9e1884369a67. Comments are the source's own. A kernel shared with other functions appears once, on its module page.

COLUMN · 7 lines · calc-func/src/catalogue/lookup.rs on GitHub
eager(
    COLUMN,
    "COLUMN",
    CallableArityShape::range(0, 1),
    &[Parameter::value_or_reference("reference")],
    column,
)

Kernels shared with other functions

Argument and result plumbing

No implementation has been published with a Handbook test suite for this function.

Version differences

No comparison between specific Excel builds is recorded here yet. This does not establish that all builds behave alike.

Alternatives

Relationships

  • ROW is the same function on the other axis and shares every structural property: the optional argument, the caller-context default, the array result over a range.
  • COLUMNS counts columns; COLUMN locates them. COLUMNS(A1:E1) is 5, COLUMN(A1:E1) is the array 1…5. The near-identical names for genuinely different operations are a standing source of confusion, and the same trap exists for ROW/ROWS.
  • SEQUENCE replaces the historical use of COLUMN(range) as a horizontal counter, and does so without depending on where the range happens to sit.
  • ADDRESS consumes coordinates; COLUMN produces them.
  • CELL("col", ref) answers the same question through the workbook-metadata route.
  • OFFSET and INDEX are the functions you feed a computed column number to.

Named variants

No named variants are recorded yet.

Suggest a correction or contribute an implementation · For agents