## How to use the COLUMNS function

*Article updated on March 29, 2018*

The COLUMNS function allows you to calculate the number of columns in a cell range.

The example above shows that cell range C2:J2 has 8 columns.

### Excel Function Syntax

COLUMNS(*array*)

### Arguments

array |
Required. A cell range for which you want to determine the number of columns. |

### Comments

The COLUMNS function also calculates the number of rows in an array.

=COLUMNS({1,2,3;4,5,6;2,3,4}) returns 3.

The array has three columns. The , (comma) character is a column delimiting character in an array.

### Articles with the 'COLUMNS' Function

The following 7 articles have formulas that contain the COLUMNS function.

Extract all rows from a range that meet criteria in one column

Lookup with criteria and return records.Search values distributed horizontally and return corresponding value

Question: Hi, The formula here works great but I can't figure out how to change it to work with data […]Rearrange cells in a cell range to vertically distributed values

The formula in cell B8 uses a named range to calculate the row and column needed to extract the correct […]### Functions in 'Lookup and reference'

The COLUMNS function function is one of many functions in the 'Lookup and reference' category.