The COLUMNS function uses to find out the number of columns in a selected array or reference. For example, =COLUMNS(D2
The COLUMNS function has the following argument:
Array – Required. A reference to a range of cells for which to want the number of columns.
For more detail and examples, visit Microsoft Office website.
COLUMN function returns the column number against the given cell reference.
ROWS function returns the number of columns in a reference or an array.