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 =COLUMN(D1) returns 4
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()
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 =COLUMN(D1) returns 4
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.
reference is optional.
=COLUMN(D1) returns 4.=COLUMN() returns the column of the cell holding the formula.=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.
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.
=IF(MOD(COLUMN(),2)=0, ..., ...) picks every other column.=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.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.
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.Each example is a live sheet. Change the inputs or the formula and watch the result.
Example 1
B2 =COLUMN(D1)
Result: 4
D is the fourth letter, so the column number is 4. The row doesn't matter.
B2 =COLUMN(D1) returns 4
Example 2
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 =VLOOKUP($A7,$A$1:$E$4,COLUMN(B1),FALSE) returns 42900
Example 3
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 =COLUMN(B1:D1) returns 2, 3, 4
Example 4
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 =COLUMN(D1)-COLUMN($B$1)+1 returns 3
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.
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.$A7 and $A$1:$E$4. Without them the formula drifts as it is copied.#SPILL!. Use MIN(COLUMN(range)) to get a single number.The column number of the cell holding the formula. In C5, `=COLUMN()` returns 3.
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.
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")`.
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.
Tracks take you from the basics to modelling, one graded exercise at a time.