Excel COLUMNS function
- Example1: Count total number of columns in a range
- Example2: Count total number of cells in a range
- Example3: Obtain the last cell address of a given range
The COLUMNS function returns the total number of columns in a given array or reference. For example, COLUMNS(A1:D4) returns 4.
The COLUMNS function returns the number of columns in an array or reference.
With the COLUMNS function you not only can count the numbers of a range, but also solve other jobs.
Explain: Count the total number of columns in the range of A1:D1
Explain: Count the total number of columns in the defined name range of “DATA” (range A1:D10)
With combining the ROWS function and the COLUMNS function, you can obtain the total number of cells in a given range.
Data: the defined name which you want to count the total number of cells.
ROWS: return the total number of rows from the given reference
ADDRESS(row_num,column_num): returns the cell address based on the given row number and column number.
ROWS(): returns the total number of rows.
COLUMNS(): returns the total number of columns.
Then the formula shown as this: