The Excel COLUMNS Function

Related Function:
ROWS function

Basic Description

The Excel Columns function receives an Excel range and returns the number of columns that are contained within the range.

The syntax of the function is:

COLUMNS( array )

Where the array argument is the Excel range that you want to know the number of columns in.

Columns Function Examples

The following spreadsheets show simple examples of the Excel Columns function. The formulas are shown in the spreadsheet on the left and the results are shown in the spreadsheet on the right.

2=COLUMNS( B1:E5 )
3=COLUMNS( 1:1 )

Note that the above functions were calculated in Excel 2010. Therefore, the formula in cell A3 of the above spreadsheet returns the value 16,384, as this is the number of columns in Excel 2010. The same result would be returned in Excel 2007, but if this example were run in Excel 2003, it would return the number 256.

Further information on the Excel Columns function can be found on the Microsoft Office website.