Contact

COLUMN Function (LibreOffice Calc)

Lookup & Reference Beginner LibreOffice Calc LibreOffice 3.0

The COLUMN function returns the column number of a reference. It is used for dynamic formulas, indexing, array construction, and building flexible lookup or offset logic.

Verification status: Consult the documentation and examples below. Native application testing has not been documented for this guide. How formula examples are checked

The **COLUMN** function returns the **column number** of a reference. It is a foundational function used in dynamic formulas, indexing, array construction, and lookup logic.

What the COLUMN Function Does

  • Returns the column index of a reference
  • Supports single cells, ranges, and omitted references
  • Useful for dynamic formulas, array generation, and lookup logic
  • Often paired with INDEX, MATCH, OFFSET, and CHOOSECOLS

Syntax

COLUMN(reference)

Arguments

  • reference (optional):
    A cell or range.
    If omitted, COLUMN returns the column of the cell containing the formula.

Basic Examples

Column of a single cell

=COLUMN(B5)
→ 2

Column of a range (returns first column)

=COLUMN(C3:E10)
→ 3

Omitted reference

=COLUMN()
→ returns the column of the formula cell

Using with cell references

=COLUMN(A1)
→ 1

Advanced Examples

Generate a sequence of column numbers

=COLUMN(A1:D1)
→ {1,2,3,4}

Convert column number to letter

=CHAR(64 + COLUMN(A1))
→ "A"

Dynamic indexing with INDEX

=INDEX(A1:Z1; COLUMN(A1))
→ returns the value in the first column

Create a dynamic header row

=TEXT(COLUMN(A1); "0")

Use with MATCH to build flexible lookups

=INDEX(A1:D100; 1; MATCH("Price"; A1:D1; 0))

Extract every nth column

=CHOOSECOLS(A1:Z10; COLUMN(A1:Z1) MOD 2 = 1)

Dynamic OFFSET logic

=OFFSET(A1; 0; COLUMN()-1)

Edge Cases and Behavior Details

COLUMN returns:

  • A single number for a single reference
  • A horizontal array for a multi‑column range

Behavior details

  • COLUMN is 1‑based
  • COLUMN of a range returns the first column
  • COLUMN() with no argument uses the formula’s location
  • Decimal references are not allowed
  • Errors in the reference propagate

Invalid reference → Err:502

Common Errors and Fixes

Err:502 — Invalid argument

Cause:

  • Reference is malformed
  • Reference is text that cannot be parsed

Fix:

  • Use INDIRECT for text references
  • Validate cell/range references

Unexpected array output

Cause:

  • Using COLUMN on a multi‑column range

Fix:

  • Wrap with INDEX or use COLUMN(reference;1) in other apps
  • Or select a single cell reference

Best Practices

  • Use COLUMN() for dynamic column indexing
  • Use with MATCH for flexible lookup logic
  • Use with OFFSET for dynamic ranges
  • Use CHOOSECOLS for explicit column extraction
  • Use ROW for row‑based indexing
COLUMN is one of the core building blocks of dynamic formulas — especially when constructing flexible lookups, offsets, and array‑driven logic.
  • COLUMNS — count number of columns
  • ROW / ROWS — row equivalents
  • INDEX — extract values by row/column
  • MATCH — find column positions
  • OFFSET — dynamic range shifting
  • CHOOSECOLS — extract specific columns

By mastering COLUMN, you can build dynamic, flexible, and scalable formulas in LibreOffice Calc.


Reproducible example (tested in LibreOffice Calc)

This standalone example was calculated in LibreOffice Calc 25.2.3.2 and matched the expected value. It is a practical cross-check of one usage, not proof that every example elsewhere on this page is correct.

=COLUMN(C9)

Expected result: 3.

Find the column number of cell C9.

If the result differs, check the referenced cells, argument separators and number formatting. For more information, consult the LibreOffice Calc official help.