Excellency

View Original

The COLUMN function

The COLUMN function is a lookup and reference function which returns the number of the column based on its position in the spreadsheet.

This is the format of the COLUMN function:

=COLUMN(CELL REFERENCE)


Here is an example of the COLUMN function:

=COLUMN(D3) = 4

COLUMN function returning the column number of the cell it is in

It is very useful when you are compiling or reformatting data where you have to perform different functions based on the source range of the data.

An example of a functional implementation of this would be if you are restructuring the data which was used in an old report in order to use it for a bigger analysis, but it is poorly formatted. Even numbered columns have sales unit values in them, and odd numbered columns have sales dollars values in them. Using the COLUMN function you can easily switch between two formulas needed to manipulate the data by referencing those cells across your range.

=INDIRECT("R” & COLUMN()*2 & ”C2",FALSE)

* The COLUMN function can be used on its own, but I find that I use it most in conjuncture with functions like INDIRECT *

See this content in the original post