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
Example 1. Column number
=COLUMN(D2)D is the fourth column, so 4.
Example 2. With VLOOKUP
=VLOOKUP($A2, table, COLUMN(B1), FALSE)Copied sideways, the column number becomes 2, 3, 4.
Example 3. Columns and their numbers
=COLUMN(D2)Only the column position counts, whatever the row.
Formula Result =COLUMN(A1) 1 =COLUMN(Z1) 26 =COLUMN(AA1) 27 =COLUMN() (entered in column D) 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
Expecting a letter
It returns the number 4, not "D".
Confusing it with the row number
Use ROW for rows.
Numbers shift when the table moves
=COLUMN()-1 depends on where the formula sits. =COLUMN()-COLUMN($A$1) anchors it to a cell instead.
FAQ
- Number of columns?
- Use COLUMNS.
- Column AA?
- 27.