HomeGoogle DocsSpreadsheetColumn Function In Google Sheets - Advanced Use

Column Function In Google Sheets – Advanced Use

Published on

The COLUMN function in Google Sheets returns the column number of the active cell, a specified cell, or a range of cells.

It can be the backbone of many complex worksheet formulas in Google Sheets.

Here are a few examples.

  1. With ADDRESS to return cell addresses.
  2. Sequential column numbering.
  3. In horizontal running calculation formulas.
  4. With INDIRECT to increment row number when dragging across.
  5. With SUMIF for getting the sum of matrix rows or columns.
  6. To return an entire row in Vlookup, etc.

Among the above, I’ll leave examples for the first two in the COLUMN formula example below.

As a side note, there are two functions related to column numbers in Google Sheets.

One is the COLUMN, and the other is the COLUMNS. So, avoid accidentally using one in the place of another.

Column Function – Syntax and Arguments in Google Sheets

Syntax: COLUMN([cell_reference])

Argument:

cell_reference – The cell or range of cells (require ArrayFormula) for which you want to return the column number. Column A corresponds to 1, B to 2, and so on.

There is only one argument in the COLUMN function in Google Sheets. If omitted, it will return the column number of the formula applied cell.

Basic Examples

You will get #1 if you refer to any column A cell reference, e.g., A50 within the COLUMN function.

=column(A50)

So, no doubt, any column Z cell reference will return 26.

=column(Z100)
Column function explained in Google Sheets

Above, you can see six columns filled with different colors to make each of them stand out from the rest.

Let’s provide an array reference including these columns to return their corresponding numbers.

When you try with =column(A1:F1), you will get 1, because COLUMN is not an array function. It will consider only the first reference in the range.

You must use the ArrayFormula function together to return the numbers 1 to 6 horizontally.

=ArrayFormula(column(A1:F1))

If you use it in a cell, e.g., A5, empty A5:F5 beforehand to avoid the #REF error due to the data overwrite issue.

Most of the functions cause circular dependency detected issues when entering the formula in the cell reference used.

The COLUMN function is an exception to this. You can use the above formula in one of the cells in A1:F1 without any issue.

Advanced Use of the Column Function in Google Sheets

Other than the tutorial listed at the beginning, here are a few more examples of the advanced use of the COLUMN function in Google Sheets.

We can use =address(row(),column()) to return the current cell ID.

Another use case is sequential column numbers.

To get 26 sequential numbers across the columns, use can use the below formula.

=ArrayFormula(column(A1:Z1))

Actually, we can use SEQUENCE or TRANSPOSE+ROW combination for the same and which seems better to me.

=ArrayFormula(transpose(row(A1:A26)))

or

=sequence(1,26)

That’s all about the COLUMN function in Google Sheets.

Thanks for the stay. Enjoy!

Prashanth KV
Prashanth KV
Your Trusted Google Sheets and Excel Guide Prashanth KV brings a wealth of experience in Google Sheets and Excel, cultivated through years of work with multinational corporations in Mumbai and Dubai. As a recognized Google Product Expert in Docs Editors, Prashanth shares his expertise through insightful blogging since 2012. Explore his blog for practical tips and guidance on maximizing your spreadsheet skills.

Excel Word Count: Beyond SUBSTITUTE

You might want to count the number of words in a cell in Excel...

Sum by Quarter in Excel: New and Efficient Techniques

Knowing how to sum by quarter is crucial in Excel because quarterly reporting has...

Sum By Month in Excel: New and Efficient Techniques

Suppose you prefer to sum by month in Excel using a formula. In that...

How to Create An In-Cell Progress Bar in Excel

In-cell progress bars in Excel refer to bars that are within a cell, not...

More like this

Count Distinct Values in Google Sheets Pivot Table

There is a built-in function for counting distinct values in a Google Sheets Pivot...

Conditional Formatting for Pivot Tables in Google Sheets

Do you know how to dynamically restrict conditional formatting within the Pivot Table area...

XLOOKUP in Merged Cells in Google Sheets

In Google Sheets, merging cells is not a good idea if you intend to...

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.