Excel function

COLUMNfunction

Returns the column number of a cell.

All versions
=COLUMN(C3)
A
B
C
D
1
2
3
4
5
6

Click a cell in the table to change reference. Click a cell in column D to get 4. It turns a column letter into a number. Try breaking it on purpose to see the errors.

Result

3

reference
C3You can also click a cell in the table

The cell whose column number you want. Click any cell. If omitted, the cell containing the formula is used.

What is the COLUMN function?

=COLUMN([reference])

COLUMN returns the column number of a cell: column A is 1, column B is 2.

Put COLUMN in the col_index_num of VLOOKUP and the column number changes automatically when you copy the formula sideways.

COLUMN is most often a number that changes as a formula is copied to the right. Build the column index of VLOOKUP or INDEX from COLUMN and you no longer rewrite each copy by hand. Because it returns a position, the number follows the reference when columns are inserted.

Arguments

reference
Optional. The cell whose column number you want. If omitted, the column of the formula cell.

COLUMN examples

  1. Example 1. Column number

    =COLUMN(D2)

    D is the fourth column, so 4.

  2. Example 2. With VLOOKUP

    =VLOOKUP($A2, table, COLUMN(B1), FALSE)

    Copied sideways, the column number becomes 2, 3, 4.

  3. Example 3. Columns and their numbers

    =COLUMN(D2)

    Only the column position counts, whatever the row.

    FormulaResult
    =COLUMN(A1)1
    =COLUMN(Z1)26
    =COLUMN(AA1)27
    =COLUMN() (entered in column D)4
  4. Example 4. Column number to letter

    =SUBSTITUTE(ADDRESS(1, COLUMN(), 4), "1", "")

    In column D it returns "D": ADDRESS builds "D1" and the 1 is removed.

Common mistakes

FAQ

Number of columns?
Use COLUMNS.
Column AA?
27.