Summary

To count the total number of cells in a rectangular range, you can use a formula based on the ROWS and COLUMNS functions. In the example shown, the formula in cell F7 is:

=ROWS(B5:C10)*COLUMNS(B5:C10)

which returns 12, the total cells in the range B5:C10.

Generic formula

=ROWS(rng)*COLUMNS(rng)

Explanation 

There is no built-in function for counting the total numbers of cells in a range, so you need to use the ROWS and COLUMNS functions together. In the example, ROWS returns the total number of rows in B5:C10 (6), and COLUMNS returns the total number of columns in B5:C10 (2). The formula multiplies these values together and returns the result:

=ROWS(B5:C10)*COLUMNS(B5:C10) // returns 12

The ROWS and COLUMNS functions can work with any sized rectangular range. For example, the formula below uses the ROWS function to count all rows in the column A, and the COLUMNS function to count all columns in row 1:

=ROWS(A:A)*COLUMNS(1:1) // count all cells in worksheet

ROWS returns a count of 1,048,576 and COLUMNS returns a count of 16,384, to the final result is 17,179,869,184.

Dave Bruns Profile Picture

AuthorMicrosoft Most Valuable Professional Award

Dave Bruns

Hi - I'm Dave Bruns, and I run Exceljet with my wife, Lisa. Our goal is to help you work faster in Excel. We create short videos, and clear examples of formulas, functions, pivot tables, conditional formatting, and charts.