Explanation

The COLUMNS function is fully automatic. When you provide a range to COLUMNS, it will return a count of all columns in the range. In the example, the formula in F6 returns 2, because there are 2 columns in the range B5:C10:

=COLUMNS(B5:C10) // count columns

COLUMNS counts the number of columns in any supplied range and returns a number as a result. For example, if we provide all of row 1 in a range, Excel returns 16,384 the total number of columns in an Excel worksheet.

=COLUMNS(1:1) // returns 16384

To count rows in a range, see the ROWS function .

Explanation

The ROWS function is fully automatic. When you provide a range to ROWS, it will return a count of all rows in the range. In the example, the formula in F5 returns 6, because there are 6 rows in the range B5:C10:

=ROWS(B5:C10) // count rows

ROWS counts the number of rows in any supplied range and returns a number as a result. For example, if we provide all of column A in a range, Excel returns 1,048,576 the total number of rows in an Excel worksheet.

=ROWS(A:A) // returns 1048576

To count columns in a range, see the COLUMNS function .