Column() Function

The Excel COLUMN function returns the column number for a reference. For example, COLUMN(C5) returns 3, since C is the third column in the spreadsheet. When no reference is provided, COLUMN returns the column number of the cell which contains the formula.



Syntax

The syntax for the COLUMN function in Microsoft Excel is:

=COLUMN( [reference] )

Parameters or Arguments

reference

Optional. It is a reference to a cell or range of cells. If the reference parameter is omitted, it assumes that the reference is the cell address in which the COLUMN function has been entered in.

Column Function Examples

The spreadsheet below shows six examples of the Excel Column function.

Formulas:


A
B
C
1
=COLUMN( )
=COLUMN( )
=COLUMN( E6 )
2
=COLUMN( )
=COLUMN( )
=COLUMN( G2:H3 )

Results:


A
B
C
1
1
2
5
2
1
2
7

Note that in the above example spreadsheet:

   The examples in cells A1-B2 omit the [reference] argument. Therefore, in these cases, the Excel Column function returns the column number of the cell that the function is entered into.
   The example in cell C1 provides the reference for cell E6 to the Column function. Therefore, in this case, the function returns the number for column E (i.e. column number 5).
   The example in cell C2 provides the range G2:H3 to the Column function. Therefore, in this case, the function returns the column number of the first cell in the supplied range (i.e. cell G2), which is column number 7.

Reference:



No comments:

Post a Comment

OR Function