LocalExcelTool
Get started

Excel COLUMN function

COLUMN is ROW turned sideways: it returns a number for the column. Two jobs dominate — automatic numbering across a row (=COLUMN()-1 dragged right), and generating a dynamic column index for INDEX or VLOOKUP so that inserting a column does not mean editing numbers.

Lookup & reference · Available in: Excel 97 and every desktop version since

Syntax

COLUMN([reference])

What it returns The column number of the reference (A=1, B=2…); with no argument, the current column.

Arguments
referenceoptionalThe cell or range whose column number you want; omitted means the current column.

Examples

Number columns 1, 2, 3 across a row

123
JanFebMar
= COLUMN()-1

→ 1(在 A1 单元格里)

A1 is column 1, so COLUMN()-1 gives 0; if the first column holds a label, start the formula in B1 and it gives 1. Drag right and it counts up.

A dynamic column index for VLOOKUP

SKUQ1Q2Q3
A-100121518
= VLOOKUP("A-100",$A$2:$D$2,COLUMN(B1),FALSE)

→ 12

COLUMN(B1) is 2, and filling right turns it into 3 and 4 — exactly the positions of Q1, Q2 and Q3 inside the range. Insert a column and nothing needs editing.

Common mistakes

  • 1.Expecting the column letter. It returns a number; for the letter use ADDRESS or the SUBSTITUTE(ADDRESS(...)) trick.
  • 2.Using it for numbering in a sheet with hidden columns — hidden columns still hold their number, so the sequence appears to skip.
  • 3.Confusing COLUMN with COLUMNS: one returns a column number, the other returns how many columns a range has.

How to use it

  1. 1.Click the cell where the result should appear.
  2. 2.Type = then the function name, and press Tab to accept it.
  3. 3.Enter each argument separated by commas; ranges can be dragged with the mouse.
  4. 4.Press Enter. Drag the fill handle down if the same formula applies to more rows.

Frequently asked questions

What is the syntax of COLUMN?

COLUMN([reference]). What it returns: The column number of the reference (A=1, B=2…); with no argument, the current column.

Which Excel versions support COLUMN?

Excel 97 and every desktop version since. It is available in every desktop version unless the note above says otherwise.

Why does COLUMN return an error instead of a value?

Expecting the column letter. It returns a number; for the letter use ADDRESS or the SUBSTITUTE(ADDRESS(...)) trick.

Related functions

More in this group

Need to get the data in first?

← All Excel formulas