COLS

Syntax #1:

COLS

Returns the number of columns in the worksheet.


Syntax #2:

COLS(array)

Returns the number of columns in the specified array (or range of cells).

Example:

COLS(B1:D3)

returns 3.