Excel COLUMN Function: Definition and How to Use It
In this article
The COLUMN function in Excel returns the column number of a reference. For example, =COLUMN(B5) returns 2 because B is the second column. If you leave the parentheses empty, =COLUMN() returns the column number of the cell that contains the formula. This guide shows exactly how to use it, what it returns in different situations, and how to avoid the mistakes that trip people up.
What You'll Need
- Excel for Microsoft 365, Excel 2021, 2019, 2016, or Excel for Mac. The function works the same in all modern versions.
- A worksheet with at least a few columns of data, or just an empty sheet to experiment on.
- Basic familiarity with typing formulas that start with an equals sign.
Step-by-Step
- Open your workbook and click the cell where you want the result. For a first test, click any empty cell, such as D1.
- Type the formula. Enter
=COLUMN()and press Enter. The result is the column number of the cell you typed it in. If you typed it in D1, you get 4. - Reference a specific cell. Click another empty cell and type
=COLUMN(B5). Press Enter. The result is 2, the column number of column B. The row number (5) is ignored because COLUMN only cares about the column. - Reference a range. Type
=COLUMN(B2:D2)in a cell. In Excel for Microsoft 365 and Excel 2021, this spills and returns three values: 2, 3, and 4. In older versions that do not support dynamic arrays, it returns only the first column number (2) unless you enter it as an array formula with Ctrl+Shift+Enter. If you see a single number instead of three, that is why. - Use it to build a column counter. Suppose you want a sequence 1, 2, 3 across row 1. In A1 type
=COLUMN()and press Enter. Copy that cell across to B1 and C1. The results become 1, 2, and 3 automatically because each cell reports its own column. This is handy for creating dynamic numbering that survives inserting or deleting columns. - Combine it with other functions. A common pattern is
=COLUMN()-1to start numbering at zero, or=ADDRESS(1,COLUMN())to return a cell address like $A$1. You can also nest it inside INDEX to pick a column by position:=INDEX(A1:Z1,1,COLUMN(C1))returns the value in the third cell of the range. - Check the result and adjust. Press F2 to edit the formula if the number is not what you expected. Remember that COLUMN counts from the left edge of the sheet, so column A is always 1, B is 2, and so on, regardless of how many columns you have hidden or scrolled past.
Menu labels and formula behavior can differ slightly by Excel version, device, and region. The steps above apply to the desktop versions of Excel on Windows and Mac; Excel for the web supports COLUMN the same way for single-cell references.
Common Mistakes
- Confusing COLUMN with COLUMNS. COLUMN returns the number of one column. COLUMNS returns how many columns are in a range.
=COLUMN(B5)gives 2, while=COLUMNS(B5:D5)gives 3. Mixing them up is the most frequent error. - Expecting an array from an old version. If you reference a range and get only one number, your Excel version may not support dynamic arrays. Use Ctrl+Shift+Enter or reference a single cell instead.
- Forgetting the parentheses. Typing
=COLUMNwithout parentheses may return a #NAME? error or be interpreted as a named range. Always include the opening and closing parentheses, even when empty. - Assuming hidden columns change the result. Hiding column C does not make column D report 3. COLUMN always returns the true sheet position, so D remains 4.
- Using it on a cell in another workbook that is closed. COLUMN can reference a closed workbook only if the workbook is open or the reference is external and supported. If you get a #REF! error, open the source workbook or copy the value instead.
Tips
- Use
=COLUMN()without arguments when you want a formula that adapts automatically as you copy it across columns. - Combine COLUMN with ROW to build a two-dimensional counter:
=COLUMN()+ROW()*10creates unique numbers across a grid. - To get a column letter instead of a number, wrap it:
=SUBSTITUTE(ADDRESS(1,COLUMN(),4),"1","")returns the letter for the current column. - When building dashboards, COLUMN is useful inside conditional formatting rules to highlight every nth column without hard-coding letters.
- Test formulas in a scratch area before applying them to a large model, so you can see exactly what each reference returns.
Troubleshooting
If COLUMN returns an unexpected number, first check the reference. A formula like =COLUMN(A1) always returns 1, even if you copied it from column D. If you meant to get the current column, remove the argument and use =COLUMN().
If you see #NAME?, the function name may be misspelled or the parentheses are missing. Type the formula again from scratch rather than editing, to rule out hidden characters.
If you see #VALUE!, the reference may point to text that looks like a cell address but is not a valid reference. Confirm the cell exists and is spelled correctly.
If a range reference returns only one value in an older Excel version, enter the formula as an array formula: select the output cells, type the formula, and press Ctrl+Shift+Enter. In Excel for Microsoft 365, dynamic arrays handle this automatically, so no special keystroke is needed.
If the formula worked yesterday and now returns an error, check whether rows or columns were deleted. Deleting the referenced column can produce a #REF! error. Undo the deletion or update the reference to a valid column.
Frequently Asked Questions
What does COLUMN() with empty parentheses return?
It returns the column number of the cell that contains the formula. In cell C7, =COLUMN() returns 3.
Does COLUMN work with a named range?
Yes. If you have a named range called SalesData that refers to B2:D10, =COLUMN(SalesData) returns 2, the first column of the range. To get all columns, use COLUMNS instead.
Can COLUMN return the column letter?
Not directly. COLUMN returns a number. To convert it to a letter, combine ADDRESS and SUBSTITUTE as shown in the Tips section.
Why does COLUMN(B5:D5) return only one number in my Excel?
Your version likely does not support dynamic arrays. Enter it as an array formula with Ctrl+Shift+Enter, or reference a single cell.
Is COLUMN available in Excel for the web and Excel for Mac?
Yes, COLUMN is available in Excel for the web and Excel for Mac. The behavior for single-cell references is the same; dynamic array spill behavior depends on the version.
What is the difference between COLUMN and COLUMNS?
COLUMN returns the column number of a single reference. COLUMNS returns the count of columns in a range. For example, COLUMN(C1) is 3, while COLUMNS(A1:C1) is 3 as well, but they answer different questions.