How to Count The Number of Cells in a Range in Google Sheets

Published on

To count the number of cells in a range there is no any specific function in Google Sheets. But to count the number of values in a range there are many Count functions. Then how to count the total number of cells in a selected range in Google Doc Sheets?

To count the number of cells in a range, you can use the functions ROWS and COLUMNS independently or combined.

The ROWS function returns the number of rows in a range.

For example;

=ROWS(A1:C10)

Result: 10

Similarly, you can use the COLUMNS function to return the number of columns in a range.

=COLUMNS(A1:C10)

Result: 3

You can combine both these functions in Google Docs Sheets to find the total number of cells in a range. See that with one example below.

The Formula to Count The Number of Cells in a Range in Google Sheets

In the below example, I am using the above same range.

To find the total number of cells in a range, you can use the below generic formula in Spreadsheets.

Generic Formula

Number of Cells in a Range = Number of Columns in the Range * Number of Rows in the Range

Which is equal to;

Columns(range)*rows(range)

Refer to the image.

Example to Count Number of Cells in a Range in Google Sheets

I can give you a few more examples. Let me count another range for total cells.

Range to Count: A1: Z1

Formula:

=columns(A1:Z1)*rows(A1:Z1)

Result: 26

Range to Count: A1: A10

Formula:

=columns(A1:A10)*rows(A1:A10)

Result: 10

Important Note: When you have only one row or one column in your range you can simply deviate from the above generic formula. But the above generic formula would also work.

For example, to count the total number of cells in a column, simply use the COLUMNS function as below.

Formula:

=COLUMNS(A1:Z1)

Result: 26

To count the total number of cells in a row, simply use the ROWS function as below.

Formula:

=ROWS(A1:A10)

Result: 10

You have now learned how to count the number of cells in a range in Google Sheets. Now see one real-life example.

Real-life Example to Count Number of Cells in a Range in Google Doc Sheets

I find the above formula useful in conditional formatting. Of course, there may be tons of other uses.

See how to highlight a cell if all the cells in a range have values.

Test Range: A1: C10

Highlight Rule: Highlight cell F4 to Green, if all the cells in the range A1: C10 contains TRUE.

Note: I have inserted tick boxes in all the cells in A1: C10. If ticked, the value in that cell will be TRUE, else FALSE.

Must Check: 10 Best Tick Box Tips and Tricks in Google Sheets.

That means I want to highlight the cell F4 when all the tick boxes are ticked.

highlight a cell if all the cells in a range are ticked

Formula:

=columns(A1:C10)*rows(A1:C10)=countif(A1:C10,TRUE)

To apply this formula do as follows.

1. Open the Conditional format rules panel on the sidebar. To do that go to the menu Format > Conditional formatting

2. Type F4 in the Apply to range.

3. Select Custom formula is under the Format cells if… and type the above formula.

4. Select the color and click Done.

That’s all about how to count the number of cells in a range in Google Sheets. Hope you have enjoyed the stay!

Prashanth KV
Prashanth KV
Your Trusted Google Sheets and Excel Guide Prashanth KV brings a wealth of experience in Google Sheets and Excel, cultivated through years of work with multinational corporations in Mumbai and Dubai. As a recognized Google Product Expert in Docs Editors, Prashanth shares his expertise through insightful blogging since 2012. Explore his blog for practical tips and guidance on maximizing your spreadsheet skills.

Hierarchical Numbering Sequences in Excel

Creating hierarchical numbering sequences in an Excel spreadsheet can significantly improve the way you...

How to Easily Repeat a Sequence of Numbers in Excel

Excel offers multiple ways to accomplish tasks, and the simplicity of each approach depends...

Create a Sequence of Dates at Every Nth Row in Excel (Dynamic Array)

Would you like to create a sequence of dates in every nth row in...

XMATCH Row by Row: Finding Values Across a Range in Google Sheets

Using the BYROW function with XMATCH in Google Sheets allows us to match values...

More like this

XMATCH Row by Row: Finding Values Across a Range in Google Sheets

Using the BYROW function with XMATCH in Google Sheets allows us to match values...

Limit Formula Expansion to a Specific Row in Google Sheets

In this tutorial, I’ll explain how to limit the expansion of an array formula...

3-D Referencing Structured Data Tables in Google Sheets

When you have several tables within a single sheet—not across multiple sheets in a...

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.