COLUMNS

The COLUMNS function returns the number of columns included in a specified collection of cells.

COLUMNS(range, headers)

range: A collection of cells. range must contain a reference to a single range of cells, which may contain any values.

headers: An optional modal value specifying whether to include header columns in the count of columns.

include-headers (0 or omitted): Include header columns in the count of columns.

exclude-headers (1): Exclude header columns from the count of columns.

Notes

  • If you select an entire table row for range, COLUMNS returns the total number of columns in the row, which changes when you resize the table.

Examples

=COLUMNS(B3:D10) returns 3, the number of columns in the collection specified by the range (columns B, C and D).

=COLUMNS(5:5) returns the total number of columns in row 5.

=COLUMNS(A1:D10,0) returns 4, the number of columns in the collection specified by the range (columns A, B, C and D), including the header column A.

=COLUMNS(A1:D10,1) returns 3, the number of columns in the collection specified by the range (columns A, B, C and D), excluding the header column A.

See alsoROWS
Morty Proxy This is a proxified and sanitized view of the page, visit original site.
Helpful?
Character limit: 250
Maximum character limit is 250.
Thanks for your feedback.
Morty Proxy This is a proxified and sanitized view of the page, visit original site.