Excel - COLUMN Function



COLUMN Function

The Excel COLUMN function retrieves the first column number of the supplied cell reference. If no reference is specified, the Column Function returns the current Column number where the function is defined. It is a part of the LOOKUP & Reference function. For instance, the expression =COLUMN(F5) retrieves the number 6 as the F column is the 6 column in the Excel worksheet. You can utilize this function to generate the multiplication table of the integers, assigning unique IDs to the different customers, and so on.

Compatibility

This advanced Excel function is compatible with the following versions of MS Excel −

  • Excel for Microsoft 365
  • Excel for Microsoft 365 for Mac
  • Excel for the web
  • Excel 2024
  • Excel 2024 for Mac
  • Excel 2021
  • Excel 2021 for Mac
  • Excel 2019
  • Excel 2016
  • Excel 2013
  • Excel 2010
  • Excel 2007

Syntax

The syntax of the COLUMN function is as follows −

=COLUMN([reference])

Arguments

You can use the following arguments with the COLUMN function −

Argument Description Required/ Optional
Reference

It specifies a cell reference or range of cells to fetch the first column number.

If no reference is specified, then the Column Function fetches the current Column number where this function appears.

Optional

Points of Remember

  • The #SPILL! error occurred if the data already exists in the range of cells while evaluating the COLUMN function as a horizontal array formula.
  • To populate the column number in an array, select the targeted cell range and press the "Ctrl+ Enter" to get the resulting array.
  • If the cell range is specified in the Reference argument, and if the COLUMN function has not been selected as a horizontal array formula, the COLUMN function will retrieve the first column number.
  • You cannot specify the multiple individual cell references in the COLUMN function.

Examples of COLUMN Function

Practice the following examples to learn the use of the COLUMN function in Excel.

Example 1: How to use the COLUMN Function in Excel?

In this example, we will apply the COLUMN function in the cell range from B2 to B4 to obtain the single-column number.

Solution

Step 1 − First, select the cell =COLUMN(E8) in the B2 cell and hit the Enter tab.

How to use the COLUMN Function in Excel1

Therefore, the COLUMN function retrieves the result 5 as E is the fifth column.

How to use the COLUMN Function in Excel2

Step 2 − After that, move to the next cell and enter the formula =COLUMN() in the B3 cell.

How to use the COLUMN Function in Excel3

After that, press the Enter tab to get the column number where this active formula is employed.

How to use the COLUMN Function in Excel4

Step 3 − Furthermore, double-click on the B4 cell and write the formula =@COLUMN(A2:D9). Here, the @ symbol eliminate the behavior of the array and only the single column number of the first cell reference in the supplied range is specified.

How to use the COLUMN Function in Excel5

After that, press the Enter tab to obtain the result.

How to use the COLUMN Function in Excel6

Example 2: How to get the Maximum Values After Multiplying Two Arrays?

We will use the INDEX and COLUMN functions, the multiply operator to multiply two arrays, and the MAX function as an outer function to extract the maximum value.

Solution

Place the cursor on the D6 cell and write the formula =MAX(INDEX((B1:B8=4)*(COLUMN(A1:C8)), , )).

Get Maximum Values After Multiplying Two Arrays1

Explanation

  • The COLUMN(A1:C8) returns the column numbers of cell range A1 to C8.
  • The condition (B1:B8=4) is verified. If the condition is correct, the TRUE value is retrieved. Otherwise, the FALSE value is retrieved.
  • Multiply operator * multiply these two arrays.
  • The expression INDEX((B1:B8=4)*(COLUMN(A1:C8)),,) generates the array after the multiplication of the two arrays.
  • The MAX function retrieves the maximum value from the array.
Get Maximum Values After Multiplying Two Arrays2

Download Practice Sheet

You can download and use the sample data sheet to practice the COLUMN function.

Advertisements