COLUMN Function (LibreOffice Calc)
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.
Compatibility
▾| Excel | ✔ |
| Gnumeric | ✔ |
| Google_sheets | ✔ |
| Libreoffice | ✔ |
| Numbers | ✔ |
| Onlyoffice | ✔ |
| Openoffice | ✔ |
| Wps | ✔ |
| Zoho | ✔ |
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.
Related Patterns and Alternatives ▾
- 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.