Google Sheets – Formula to Get Total Number of Cells in Open-Ended Range

formulasgoogle sheets

I need a formula to calculate the total number of cells in the range, including empty and not empty cells (i.e. the "size" of the range).

It is more useful for open-ended ranges, like A:A, $3:$3, or A2:A.

Actually the size of A:A is the same as the current number of rows in the sheet and the size of $3:$3 is the current number of columns; so such formula could be used to determine the size of the sheet.

The formula would return a numeric value. I prepared a table with examples of returned values and an example screenshot.

Range  | Needed  | Notes
       | formula |
       | result  |
-----------------------------------------
A1:C3  |      9  | 3*3=9
A:A    |     11  | see example screenshot
$3:$3  |      5  | see example screenshot
A2:A   |     10  | see example screenshot

example screenshot

Best Answer

=COUNTIF(A:A,"<>")+COUNTIF(A:A,"")
=COUNTIF(A2:A,"<>")+COUNTIF(A2:A,"")
=COUNTIF(A:AAA,"<>")+COUNTIF(A:AAA,"")
=COUNTIF(2:2,"<>")+COUNTIF(2:2,"")

0