COLUMNS(array)
=COLUMNS(A1:F1)
The COLUMNS function is used to return the number of columns in a specified range of cells. This example returns 6 because there are 6 columns in the range A1:F1.
=COLUMNS(A1:Z100)
The COLUMNS function can also be used to return the number of columns in a larger range of cells. This example,returns 100 because the range A1:Z100 contains 100 columns.
=COLUMNS({1,2,3,4,5})
The COLUMNS function can also be used to return the number of cells in an array constant. This example returns 5 because COLUMNS takes an array constant and returns the count of cells in the array.
=COLUMNS(range)*ROWS(range)
This example returns the total number of cells in the range because ROWS returns the total number of cells and range returns the total number of columns.
The COLUMNS function returns the number of columns in a data set or reference, taking an array argument as required. It returns a number and can be used with an array or array formula.