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