Google Sheets Count Rows: 6 Ways to Do It

How-to basics · Updated November 23, 2026

To count rows in Google Sheets, use the COUNTA function to count non-empty cells in a column, or ROWS to count all rows in a range. For example, =COUNTA(A:A) returns the number of cells with data in column A, while =ROWS(A1:A100) returns 100. The method you choose depends on whether you want to count all rows, only rows with data, or rows that meet specific conditions.

Why Counting Rows Isn’t Always Simple

At first glance, counting rows sounds trivial—just look at the row numbers on the left. But in practice, you often need a dynamic count that updates as you add or remove data, or you need to count only certain rows (e.g., rows where a status is “Done”). Google Sheets offers several functions and features to handle these cases, each with its own quirks. Understanding the difference between counting cells, counting rows, and counting unique rows will save you from incorrect totals.

Using ROWS and COUNTA for Basic Counts

The ROWS function returns the number of rows in a specified range. It counts every row, whether empty or not.

  • ROWS(range) – Example: =ROWS(A1:A100) returns 100.
  • COUNTA(range) – Counts non-empty cells. Example: =COUNTA(A1:A100) returns the number of cells in A1:A100 that contain any value (including text, numbers, errors, and even spaces).

If your data is in a single column with no gaps, COUNTA gives you the number of rows with data. But if you have multiple columns and want to count rows where at least one cell is filled, you need a different approach—like using COUNTIF with a wildcard or a helper column.

Counting Rows with Data in a Specific Column

The most common need is to count how many rows have data in a particular column (e.g., column A). Use COUNTA(A:A) to count all non-empty cells in column A. However, this counts every cell, including header rows and any stray values. If your data starts at row 2, use =COUNTA(A2:A) to exclude the header.

For a more precise count that ignores cells with only spaces (which COUNTA treats as non-empty), you can use =COUNTIF(A2:A, "?*") – this counts cells that contain at least one character (the ? matches any single character, * matches any sequence, so “?*” means at least one character). This is a handy trick to avoid counting blank-looking cells that actually contain spaces.

Counting Rows That Meet a Condition (COUNTIF / COUNTIFS)

Often you need to count rows where a certain column meets a criterion. For example, count rows where the status in column B is “Paid”.

Assuming data in A2:C100, with status in column B, the formula is:

=COUNTIF(B2:B100, "Paid")

This returns the number of cells in B2:B100 that exactly equal “Paid”. For multiple conditions across different columns, use COUNTIFS. For instance, count rows where column B is “Paid” and column C is greater than 100:

=COUNTIFS(B2:B100, "Paid", C2:C100, ">100")

This returns the count of rows meeting both conditions. Note that COUNTIFS counts rows where all conditions are true for that row.

Counting Unique Rows or Unique Values

To count the number of unique rows (distinct combinations across columns), you can use the UNIQUE function combined with COUNTA or ROWS. For example, to count unique values in column A:

=COUNTA(UNIQUE(A2:A100))

This returns the number of distinct values in A2:A100. If you want to count unique rows based on two columns, you can use =ROWS(UNIQUE(A2:B100)) – this counts the number of unique pairs of values in columns A and B. Be aware that UNIQUE treats blank cells as a value, so if you have blanks, they will be counted as one unique item.

Using the Status Bar for a Quick Count

If you just need a quick count without writing a formula, you can use the status bar. Select the column or range of cells you want to count, and look at the bottom-right corner of the Google Sheets window. By default, it shows the sum of numeric cells, but you can right-click the status bar and choose “Count” or “Count numbers” to see the count of non-empty cells or numeric cells. This is a manual, one-time count—it doesn’t update automatically when your data changes, but it’s handy for a quick check.

Common Problems and Pitfalls

Several issues trip up users when counting rows:

  • COUNTA counts cells with formulas that return empty strings – If a cell contains a formula like =IF(A1="","",A1), it may appear empty but COUNTA will count it because the formula returns an empty string. Use COUNTIF with criteria like "?*" to avoid this.
  • Counting entire columns can be slow – =COUNTA(A:A) scans the entire column (1,048,576 rows). On large sheets, this can slow down calculations. Limit the range to your actual data, e.g., A2:A1000.
  • Hidden rows are still counted – Functions like COUNTA and ROWS ignore filtering and hidden rows. If you need to count only visible rows after filtering, you’ll need to use the SUBTOTAL function with function number 103 (COUNTA) or 102 (COUNT). For example, =SUBTOTAL(103, A2:A100) counts only visible non-empty cells in that range.
  • Blank cells at the bottom of a column – If you use =COUNTA(A:A) and have stray spaces in cells below your data, you’ll get a higher count. Clean your data or use a specific range.

Frequently Asked Questions

How do I count the total number of rows in a sheet?

To count all rows in a sheet, including empty ones, use =ROWS(A:A) – this returns 1,048,576, the maximum number of rows in Google Sheets. If you want to count rows that have any data in any column, you’ll need a more complex formula, such as =SUMPRODUCT((A2:A100<>"")+(B2:B100<>"")+(C2:C100<>"")>0) – but this is rarely needed. Usually, you want to count rows with data in a specific column.

Why does COUNTA count more rows than I expect?

COUNTA counts any cell that is not truly empty, including cells with spaces, apostrophes, or formulas that return empty strings. To get a more accurate count of visible text, use =COUNTIF(A2:A100, "?*") which counts cells with at least one character. Also check for hidden characters by using the TRIM function on your data.

Can I count rows based on a dropdown selection?

Yes, use COUNTIF with the cell reference that contains the dropdown value. For example, if you have a dropdown in cell D1 and data in column B, use =COUNTIF(B2:B100, D1). This will count rows where column B matches the selected value. If you want to count based on multiple dropdowns, use COUNTIFS.

How do I count rows with text in Google Sheets?

Use =COUNTIF(A2:A100, "*") to count cells that contain any text (including numbers stored as text). This ignores numbers and blanks. For a count that includes numbers, use =COUNTA(A2:A100). If you want to count only cells that contain specific text, use wildcards, e.g., =COUNTIF(A2:A100, "*apple*") counts cells containing the word “apple”.

What’s the difference between COUNTA and COUNT?

COUNTA counts all non-empty cells, including text, numbers, errors, and logical values (TRUE/FALSE). COUNT only counts cells containing numeric values (numbers, dates, times). If you have a column with a mix of text and numbers, COUNTA will give a higher count. Use COUNT when you only need to count numeric entries.

How do I count rows in a filtered list?

Use the SUBTOTAL function with function number 103 (COUNTA) or 102 (COUNT). For example, if you have filtered data in A2:A100, =SUBTOTAL(103, A2:A100) counts only visible non-empty cells. This function automatically ignores rows hidden by a filter. Note that SUBTOTAL with 103 ignores manually hidden rows as well, but only if they are hidden via the filter or row hiding.

Alternatives to Counting Rows

If you find yourself constantly counting rows, consider using a Pivot Table. Pivot tables can summarize data and show row counts for categories automatically. Also, the QUERY function can return counts based on conditions, e.g., =QUERY(A2:B100, "select A, count(B) where B is not null group by A") – this gives a table of counts per category. These methods are more powerful when you need ongoing analysis rather than a single number.

Related

Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.

More in How-to basics

Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources

Spotted an error in this guide? Let us know.