Documentation/Calc Functions/COLUMNS

Function name:
COLUMNS

Category:
Spreadsheet

Summary:
Determines the number of columns in the given reference to a single cell or to a range of cells.

Syntax:
COLUMNS(Array)

Returns:
Returns an integer in the range 0 to 1024 (inclusive) which is the count of the columns in the cell(s) specified in the argument.


 * If the Array argument is omitted, then COLUMNS returns 0.
 * If the Array argument refers to a single cell, then COLUMNS returns 1.
 * If the Array argument refers to a rectangular cell range, then COLUMNS returns the number of columns in the range.

Arguments:
Array is a specific cell reference (for example, "$Sheet1.A1"), a specific cell range (for example, "$Sheet1.$C$28:$H$29"), the name of a named or database range, or a constant array (for example, "{1, 3, 5, 7}").


 * If Array is omitted, the value 0 is returned.
 * If Array is not a valid reference to a single cell or a single rectangular cell range, then COLUMNS reports a parameter list error (Err:504). COLUMN does not process references that comprise multiple cell ranges.

Additional details:

 * COLUMNS counts columns that have been hidden.


 * The value returned by COLUMNS is not dependent on the contents of the cells in a referenced cell area.

Related LibreOffice functions:
COLUMN

ROWS

ODF standard:
Section 6.13.5, part 2

Equivalent Excel functions:
COLUMNS