COLUMNS Function
Return the number of columns in a reference or array. reference is a cell, a range or an array constant: COLUMNS(C1:E4) returns 3, and COLUMNS({1,2,3;4,5,6}) returns 3. The argument is required; without it, COLUMNS returns #VALUE!.
Syntax
COLUMNS(reference)
Category: Lookup. Minimum arguments: 0. Maximum arguments: 1.
Available for supported offline calculation.
Examples
=COLUMNS(A5)
The formula returns 1, because the reference is a single cell.
Cell and range examples require appropriate input values in the referenced cells. Handle invalid arguments, formula errors and array and spill constraints.