Returns the number of columns in a given reference.
Syntax:
COLUMNS(reference)
reference may be given explicitly (eg A3:B5)
Example:
COLUMNS(A3:B5)
returns 2; there are two columns in this range, namely columns A and B.
COLUMNS(G4:H4)
returns 2; there are two columns in this range, namely columns G and H.
COLUMNS(D8)
returns 1; D8 is interpreted as a one cell range, with a single column (column D).