Syntax #1:
COLS( )
Returns the number of columns in the worksheet.
Syntax #2:
COLS( Range or Array )
Returns the number of columns in the specified range of cells (or array).
Example:
COLS(B1:D3)
returns 3.
3