COLUMN Function in Google Sheets: Tips and Tricks

Published on

The COLUMN function returns the column number of a specified cell in Google Sheets. When used with ArrayFormula, it can handle cell ranges. The first column, column A, is numbered 1.

This function can be used as part of other functions, particularly with the ADDRESS function. It also plays a major role in conditional formatting, allowing you to dynamically refer to cells in another sheet. We’ll explore tips and tricks related to these uses.

Syntax

COLUMN([cell_reference])

The function has only one argument, cell_reference, which is optional. If omitted, the default reference is the cell containing the formula.

For example, if you enter =COLUMN() in cell A1 or anywhere in column A, it will return 1. If you enter it in column Z, it will return 26.

If cell_reference is a range, you should enter it as an array formula:

=ArrayFormula(COLUMN(A1:Z1))

This will return the column numbers 1 to 26. You can use this formula in any cell, provided there are 26 blank cells across.

Here are some tips and tricks for using the COLUMN function in Google Sheets.

Using the COLUMN Function with the ADDRESS Function

As you may know, a cell address is identified by its column letter and row number. For example, B10 refers to the cell at the intersection of column B and row 10.

If you specify row and column numbers, the ADDRESS function can return the cell address.

For example, the following formula will return B10:

=ADDRESS(10, 2)

Here, 10 is the row number, and 2 is the column number.

Tricky Use:

If you enter the following formula in any cell and drag it across, it will return $A$1, $A$2, $A$3, and so on across the row:

=ADDRESS(COLUMN(A1), 1)

Try replacing COLUMN(A1) with COLUMN(A1) + 10 and see what happens. Also, replace 1 with 2 and try again.

Using the COLUMN Function in Conditional Formatting

Assume you want to highlight a particular value, such as the current date, in a cell range (e.g., A1:Z).

You can select A1:Z and apply the following formula by clicking Format > Conditional Formatting and selecting Custom Formula Is:

=A1=TODAY()

But what should you do when you want to highlight a different sheet? For example, if you want to match today’s date in the range A1:Z in Sheet1 and highlight the same cells in Sheet2 instead of Sheet1.

You can’t use a formula like =Sheet1!A1=TODAY() in Sheet2, as Google Sheets doesn’t support direct cell references when referring to a different sheet in conditional formatting.

In this case, you need to use the INDIRECT function, like this:

=INDIRECT("Sheet1!A1")=TODAY()

However, the issue with this approach is that the cell reference is not dynamic because it’s a string. To make it dynamic, you can use the following formula:

=INDIRECT(ADDRESS(ROW(A1), COLUMN(A1), 4, ,"Sheet1"))=TODAY()

Here, we used the ROW and COLUMN functions within the ADDRESS function to dynamically refer to each corresponding cell in Sheet1 from Sheet2.

Resources

Prashanth KV
Prashanth KV
Your Trusted Google Sheets and Excel Expert Prashanth KV is a Diamond Product Expert in Google Sheets, officially recognized by Google for his contributions to the Docs Editors Help Community and featured in the Google Product Experts Directory. With years of experience working with Google Sheets and Excel for multinational firms in Mumbai and Dubai, he has been blogging since 2012, offering practical, real-world spreadsheet solutions that professionals rely on. Explore his blog to learn advanced formulas, automation tips, and problem-solving techniques to elevate your spreadsheet skills.

Mode of Comma-Separated Numbers in Excel (Dynamic Array)

There is no dedicated function in Excel to directly find the mode of comma-separated...

How to Find Mode of Comma-Separated Numbers in Google Sheets

Working with comma-separated numbers inside a single cell is a common scenario in Google...

How to Count Merged Cells in Google Sheets (and Get Their Size)

Sometimes, you may have blocks of merged cells in a column or row. But...

Count Consecutive Workday Absences in Google Sheets

This tutorial offers a powerful formula-based solution to count consecutive workday absences in Google...

More like this

How to Find Mode of Comma-Separated Numbers in Google Sheets

Working with comma-separated numbers inside a single cell is a common scenario in Google...

How to Count Merged Cells in Google Sheets (and Get Their Size)

Sometimes, you may have blocks of merged cells in a column or row. But...

Count Consecutive Workday Absences in Google Sheets

This tutorial offers a powerful formula-based solution to count consecutive workday absences in Google...

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.