Google Sheets COLUMN Function: How to Use It
In this article
The COLUMN function in Google Sheets returns the column number of a cell reference, or the column number of the cell containing the formula if no reference is given. It is the horizontal counterpart to ROW, and it is most useful when you need a formula that knows where it is sitting, such as building sequential column labels, creating dynamic references, or feeding numbers into functions like INDEX, ADDRESS, or OFFSET. To use it, type =COLUMN() for the current column, or =COLUMN(B5) to return the column number of B5 (which is 2). That is the whole function; the rest of this guide covers the syntax, practical examples, and the mistakes that trip people up.
What You'll Need
- A Google account with access to Google Sheets (the free web version or the mobile app both work).
- A spreadsheet open in edit mode, or a blank one you can experiment in.
- Basic familiarity with typing formulas that begin with an equals sign.
No add-ons or extensions are required. COLUMN is a built-in function available in every version of Sheets.
Step-by-Step
- Open your spreadsheet. In Google Sheets, click into any empty cell where you want the result to appear. The formula bar at the top is where you will type.
- Type the basic formula. Enter
=COLUMN()and press Enter. If you typed it in cell D7, the result is 4, because D is the fourth column. The empty parentheses tell Sheets to look at the cell the formula lives in. - Reference a specific cell instead. Type
=COLUMN(B5)and press Enter. The result is 2, because B is the second column. The row number in the reference is ignored; COLUMN only cares about the letter. - Reference a whole range. Type
=COLUMN(C1:E1). Sheets returns 3, the column number of the first column in the range. If you want all the numbers, enter the formula as an array formula by wrapping it in ARRAYFORMULA:=ARRAYFORMULA(COLUMN(C1:E1)), which spills 3, 4, and 5 across three cells. - Use it to build sequential column numbers. In cell A1, type
=COLUMN(). Then drag the fill handle to the right. Each copied cell returns its own column number, giving you 1, 2, 3, and so on without typing anything manually. - Combine it with other functions. A common pattern is
=ADDRESS(1, COLUMN()), which builds a reference to row 1 of the current column. Another is=INDEX($A$1:$Z$1, COLUMN()), which pulls the header from the current column. These are useful when you copy a formula across many columns and want it to adapt automatically. - Check the result. Column A returns 1, B returns 2, and so on through Z (26), AA (27), AB (28), and beyond. If you see a different number than expected, confirm which cell the formula is actually in by clicking it and reading the cell reference in the top-left corner of the sheet.
Menu labels and formula behaviour can differ slightly between the desktop web version and the mobile app, and between regions, but COLUMN itself works the same everywhere. The mobile app supports typing the formula in the formula bar; there is no separate function wizard.
Common Mistakes
- Forgetting the parentheses. Typing
=COLUMNwithout parentheses returns a #NAME? error or is treated as text. Always include()even when there is no argument. - Expecting a letter instead of a number. COLUMN returns 2, not "B". If you need the letter, wrap it:
=SUBSTITUTE(ADDRESS(1, COLUMN(), 4), "1", "")returns the column letter. - Confusing COLUMN with COLUMNS. COLUMN gives the number of one column; COLUMNS counts how many columns are in a range.
=COLUMNS(A1:E1)returns 5. - Assuming the reference row matters.
=COLUMN(B99)and=COLUMN(B1)both return 2. The row is irrelevant. - Dragging a formula and getting the same number. If you copy
=COLUMN(B5)across, it returns 2 every time because the reference is relative but still points at column B. Use=COLUMN()with no argument if you want each cell to report its own column. - Using it on a different sheet without a sheet name.
=COLUMN(Sheet2!C3)works, but=COLUMN(C3)typed on Sheet1 refers to Sheet1's C3. Include the sheet name when referencing another tab.
Tips
- Use
=COLUMN()as a quick way to number columns in a header row without manual counting. - Pair COLUMN with ROW to build a grid of coordinates, useful for generating cell addresses or designing lookup tables.
- When you need the column letter rather than the number, combine COLUMN with ADDRESS and SUBSTITUTE as shown above, or use
=CHAR(64 + COLUMN())for single-letter columns A through Z. - Remember that COLUMN is volatile in the sense that it recalculates when the sheet changes, but it is cheap and will not slow down a normal spreadsheet.
- If you are building a formula that must survive inserting or deleting columns, COLUMN is often safer than hard-coded numbers because it updates automatically.
Troubleshooting
If COLUMN returns an error, work through these checks in order. First, confirm the formula starts with an equals sign and that the parentheses are present. A #NAME? error usually means the function name is misspelled or the equals sign is missing. A #REF! error means the referenced cell or range no longer exists, often after deleting a column; undo the deletion or update the reference. If the result is a date or a strange number, check that the cell is formatted as a number, not as a date or currency; select the cell and use Format > Number > Automatic. If you see the formula as text instead of a result, the cell may be formatted as plain text; change the format to Automatic and re-enter the formula. If dragging the formula gives unexpected numbers, verify whether you used a cell reference (which stays fixed) or empty parentheses (which follow the cell). Finally, if the formula works on desktop but not in the mobile app, update the app from the official app store; older versions may not support every function, though COLUMN has been supported for years.
Frequently Asked Questions
What does the COLUMN function return?
It returns the column number of a cell reference, or of the cell containing the formula if no reference is given. Column A is 1, B is 2, and so on.
How do I get the column letter instead of the number?
Use =SUBSTITUTE(ADDRESS(1, COLUMN(), 4), "1", ""). The ADDRESS function with the 4 argument returns a relative reference like B1, and SUBSTITUTE removes the row number.
What is the difference between COLUMN and COLUMNS?
COLUMN returns the number of a single column. COLUMNS returns the total number of columns in a range, for example =COLUMNS(A1:E1) returns 5.
Can COLUMN work with a range?
Yes, but it returns only the first column's number unless you wrap it in ARRAYFORMULA. =ARRAYFORMULA(COLUMN(A1:C1)) spills 1, 2, and 3.
Does COLUMN work in the Google Sheets mobile app?
Yes. Type the formula in the formula bar the same way as on desktop. The app does not have a separate function menu for it, but the formula works identically.
Why does COLUMN return the same number when I copy it across?
Because you used a cell reference such as =COLUMN(B5), which always points to column B. Use =COLUMN() with no argument so each copied cell reports its own column.