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.

Highlight Upcoming Birthdays in Google Sheets

When highlighting upcoming birthdays in Google Sheets, one important aspect is ignoring the year...

Compare Two Tables for Differences in Excel

To compare two tables with similar data for differences, you can use the XLOOKUP...

Calculate Weighted Average in Pivot Table in Google Sheets

You can calculate a weighted average in a Pivot Table using a custom formula...

Summarize Data and Keep the Last Record in Google Sheets

In Google Sheets, we can summarize data (like sum, average, min, max, count) using...

More like this

Highlight Upcoming Birthdays in Google Sheets

When highlighting upcoming birthdays in Google Sheets, one important aspect is ignoring the year...

Calculate Weighted Average in Pivot Table in Google Sheets

You can calculate a weighted average in a Pivot Table using a custom formula...

Summarize Data and Keep the Last Record in Google Sheets

In Google Sheets, we can summarize data (like sum, average, min, max, count) using...

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.