Skip to content

COLUMN

Returns the column number of a reference, or of the cell the formula is in. Use it to make a lookup formula that fills across.

Syntax

=COLUMN()

Lookup and reference

Every version of Excel, including Microsoft 365, Excel 2024, 2021, 2019, 2016 and earlier, Excel for the web and the mobile apps.

Try it

Edit the formula in B2 or change the inputs. The sheet recalculates as you type.

B2
A
B
C
D
1
Cell
Column number
2
D1
4
3
4

B2 =COLUMN(D1) returns 4

How COLUMN works

COLUMN returns a column number, counting from A as 1. =COLUMN(D1) returns 4, and =COLUMN() returns the column number of the cell that holds the formula. It is the horizontal twin of ROW.

The argument

reference is optional.

  • With a single cell, =COLUMN(D1) returns 4.
  • With nothing, =COLUMN() returns the column of the cell holding the formula.
  • With a multi-column range, such as =COLUMN(B2:D2), older versions of Excel return only the first column number, 2. Microsoft 365 and Excel 2021 or later return all of them as an array, {2,3,4}, which spills across.

The row of the reference doesn't matter: COLUMN(D1) and COLUMN(D500) are both 4.

The main use: lookups that fill across

VLOOKUP needs a column number as its third argument, and typing a different number into every cell is slow and error-prone. COLUMN gives you a number that counts up as the formula is copied to the right:

=VLOOKUP($A9, $A$1:$E$6, COLUMN(B1), FALSE)

In the first cell, COLUMN(B1) is 2. Copied one cell right it becomes COLUMN(C1), which is 3, and so on. Lock the lookup value's column and the table with dollar signs so only the column number moves. COLUMNS does the same job with a range that grows, such as COLUMNS($B1:B1), and it doesn't break if columns are inserted to the left of the table.

When the column number must follow a header, the more reliable approach is MATCH: MATCH(B$8, $A$1:$E$1, 0) finds the column from the header text, and it can't drift when columns move. Or use XLOOKUP, which doesn't need a column number at all.

Other uses

  • Alternating columns. =IF(MOD(COLUMN(),2)=0, ..., ...) picks every other column.
  • Position within a range. =COLUMN(D1)-COLUMN($A$1)+1 is the position of D1 within a list that starts at A1, and doesn't change if columns are inserted before the table.
  • Building addresses. ADDRESS takes a row number and a column number. COLUMN and ROW are the usual way to feed it.

Things to be careful about

COLUMN reports the position on the sheet. If someone inserts a column to the left of your table, COLUMN(B1) still returns 2 and the formula points at the wrong column. COLUMN is not volatile, and it recalculates only when its reference changes.

Arguments

referenceoptional
The cell or range whose column number you want, such as D1. If you leave it out, COLUMN returns the column of the cell the formula is in. For a multi-column range, current Excel returns every column number as an array that spills.

Examples

Each example is a live sheet. Change the inputs or the formula and watch the result.

Example 1

The column number of a cell

B2 =COLUMN(D1)

Result: 4

D is the fourth letter, so the column number is 4. The row doesn't matter.

B2
A
B
C
D
1
Cell
Column number
2
D1
4
3
4

B2 =COLUMN(D1) returns 4

Example 2

A lookup that fills across

B7 =VLOOKUP($A7,$A$1:$E$4,COLUMN(B1),FALSE)

Result: 42900

COLUMN(B1) is 2, so VLOOKUP returns the second column. Copied to C7 the formula uses COLUMN(C1), which is 3, and so on across to E7, with no edits.

B7
A
B
C
D
E
1
Region
Q1
Q2
Q3
Q4
2
North
48,200
51,400
49,800
57,900
3
South
31,750
33,100
35,200
36,800
4
East
42,900
41,300
44,600
47,100
5
6
Region
Q1
Q2
Q3
Q4
7
East
42,900
8
9
10

B7 =VLOOKUP($A7,$A$1:$E$4,COLUMN(B1),FALSE) returns 42900

Example 3

Every column number in a range

A4 =COLUMN(B1:D1)

Result: 2, 3, 4

In Microsoft 365 and Excel 2021 or later, a multi-column reference returns an array of column numbers that spills to the right of A4. In Excel 2019 and earlier, the result would be only 2.

A4
A
B
C
D
E
F
1
Region
Q1
Q2
Q3
2
3
Column numbers of B1:D1
4
2
3
4

A4 =COLUMN(B1:D1) returns 2, 3, 4

Example 4

Column position that survives inserted columns

B3 =COLUMN(D1)-COLUMN($B$1)+1

Result: 3

D1 is column 4 and the list starts in column 2, so Mar is the 3rd item. Because the list start is part of the formula, the position is relative to the table, not to column A.

B3
A
B
C
D
E
F
1
Jan
Feb
Mar
Apr
2
3
Position of Mar
3
4

B3 =COLUMN(D1)-COLUMN($B$1)+1 returns 3

Your turn.

Solve it in the sheet. Every answer is checked, with hints if you need them.

Task 1 of 2

In B8, return West's Q1 revenue with VLOOKUP, using COLUMN to supply the column number, so the same formula filled across to D8 returns Q2 and Q3.

Answer in B8, then it fills down to D8.

B8
A
B
C
D
E
1
Region
Q1
Q2
Q3
2
North
48,200
51,400
49,800
3
South
31,750
33,100
35,200
4
East
42,900
41,300
44,600
5
West
37,400
39,800
38,900
6
7
Region
Q1
Q2
Q3
8
West
9
10

Common mistakes

  • COLUMN(B1) returns a fixed column number. If someone inserts a column in front of your table, the number no longer matches the table's column. Use MATCH on the header or COLUMNS with an anchored range for a lookup that survives layout changes.
  • When you fill a lookup across, lock the lookup value's column and the table with dollar signs, such as $A7 and $A$1:$E$4. Without them the formula drifts as it is copied.
  • A multi-column range spills in current Excel. If neighbouring cells aren't empty you get #SPILL!. Use MIN(COLUMN(range)) to get a single number.
  • In Excel 2019 and earlier, a multi-column range returns only the first column number unless the formula is entered as an array formula.
  • COLUMN returns the position on the sheet, not the position within a table. Subtract the table's first column and add 1 if you need the position.

Questions people ask

What does COLUMN() return with no argument?

The column number of the cell holding the formula. In C5, `=COLUMN()` returns 3.

How do I use COLUMN with VLOOKUP?

Use `COLUMN(B1)` as the third argument. As you copy the formula to the right, it counts 2, 3, 4 and so on, so each cell returns the next column. Anchor the lookup value's column and the table with dollar signs.

How do I convert a column number to a letter?

Use ADDRESS and SUBSTITUTE: `=SUBSTITUTE(ADDRESS(1, 27, 4), "1", "")` returns AA. In Microsoft 365 you can also use `=TEXTBEFORE(ADDRESS(1, 27, 4), "1")`.

What is the difference between COLUMN and COLUMNS?

COLUMN returns the column number of a cell, such as 4 for D1. COLUMNS returns how many columns a range has, such as 4 for A1:D1.

Learn COLUMN in a real sheet.

Tracks take you from the basics to modelling, one graded exercise at a time.