|
COLUMNS
Returns the number of columns in an array or reference.
Syntax
COLUMNS(array)
Array is an array or array formula, or a reference to a range of cells for which you want the number of columns.
Example
The example may be easier to understand if you copy it to a blank spreadsheet.
- Create a blank spreadsheet.
- Select the example in the Help topic.
![]()
Selecting an example from Help
- Press CTRL+C.
- In the spreadsheet, select cell A1, and press CTRL+V.
- To switch between viewing the formula that returns the result and the result in the cell, select the cell and press F2 and then ENTER, or click Commands and Options on the spreadsheet toolbar, click the Formula tab, and look in the Formula in active cell (active cell) box.
Formula | Description (Result) |
---|---|
=COLUMNS(C1:E4) | Number of columns in the reference (3) |
=COLUMNS({1,2,3;4,5,6}) | Number of columns in the array constant (3) |