30 Advanced Excel Tips for 2026

Excel Champs / Excel Formulas List / Count Rows in Excel (All, Blank, Non-Blank, & with Numbers)
By Puneet Gogia (Microsoft MVP)

Count Rows in Excel (All, Blank, Non-Blank, & with Numbers)

30+ Advanced Excel Tips for 2026

No spam. Only Excel Stuff. God Promise. 😊

To count rows in a range regardless of content, use =ROWS(A1:A10), which returns 10 whether the cells are filled or not. To count only the rows that have something in them, use =COUNTA(A1:A10); for blank ones, =COUNTBLANK(A1:A10); and for rows holding numbers specifically, =COUNT(A1:A10).

One distinction worth making: these count cells in a single column, which is only the same as counting rows if that column is always filled.

For a table where a row counts as used when any of its cells has data, use a per-row COUNTA test, or more simply =ROWS(Table1) if the data is in an Excel Table, which always reflects the true row count.

Two no-formula options: select the column and read Count in the status bar, or press Ctrl+End to jump to the last used cell and read the row number.

There are multiple ways to count rows in Excel. But if you want to count the rows irrespective of whether data is in the cells, you can use the ROWS function.

count-rows
  1. Enter the “ROWS” function in a cell.
  2. Type the opening parenthesis.
  3. Refer to the range of the cells.
  4. Type the closing parenthesis.
  5. Hit Enter to get the result.
=ROWS(A1:A10)

ROWS returns 10 here, as the range has ten rows, whether the cells have data or not.

rows-function-to-count-rows

Count the Rows with the Non-Blank Cell

And if you want to count the rows for the cells with a value, you can use the COUNTA function.

count-rows-with-non-blank-cells
=COUNTA(A1:A10)

When you hit Enter after referring to the range, it returns 5, the number of rows that have a value in the range.

counta-to-count-non-blank-rows

Read Also – How to Count Colored Cells in Excel (Using a Formula)

Count Rows with Blank Cells

In the same way, you can also count the rows with blank cells, which are cells without data. Use the COUNTBLANK function for this:

=COUNTBLANK(A1:A10)
count-rows-with-blank-cells

Once you hit Enter, it returns 5, the exact number of rows with blank cells. Note that COUNTBLANK also counts cells with a formula that returns “” as blank.

rows-with-blank-cells

Count Rows with Numbers

The COUNT function needs to be used to count the rows with the numbers.

=COUNT(A1:A10)
count-rows-with-numbers

The moment you hit Enter, it returns 3 in the result. So as you can see, we have 5 blank cells and 5 non-blank rows. But in the non-blank rows (with value), we have only three cells with the numbers, and that’s why the result is 3.

rows-with-numbers-only

Count Rows with a Condition

To count only the rows that meet a condition, use COUNTIF. The following formula counts the rows where the value in A1:A10 is more than 20:

=COUNTIF(A1:A10,">20")

For more than one condition across columns, use COUNTIFS, like =COUNTIFS(A2:A100,”North”,C2:C100,”>1000″).

Count Visible Rows After a Filter

COUNTA also counts the rows that a filter hides. To count only the visible rows, use SUBTOTAL with 103 (COUNTA that ignores hidden rows):

=SUBTOTAL(103,A2:A100)

Count Rows with Data in Any Column

When your data is spread across several columns and a row can have a value in any of them, count the rows that have at least one non-blank cell. This formula checks A1:C10 (three columns, so there are three 1s in the array):

=SUMPRODUCT(--(MMULT(--(A1:C10<>""),{1;1;1})>0))

You can also select the range and look at the status bar at the bottom of Excel. The Count there shows the number of non-blank cells, not rows, so use the formula when you need rows.

Frequently Asked Questions

How do I count the rows in an Excel table?

Use ROWS with the table name, like =ROWS(Table1). It returns the number of data rows, without the header row.

Why does COUNTA count cells that look empty?

The cells have something in them, like a formula that returns “”, a space, or an apostrophe. Use COUNTBLANK or check the cells with LEN to find them.

What is the difference between ROWS and COUNTA?

ROWS counts all the rows in a range, whether they have data or not. COUNTA counts only the cells that aren’t empty.

Puneet Gogia

Written by

Puneet Gogia

Microsoft MVP — Excel · Founder, Excel Champs

Twelve years of teaching Excel, and a decade before that using it as a data analyst. Every tutorial here is written from a file I actually built.

3M+ readers helped
1,000+ tutorials written
Since 2015 teaching Excel

Leave a Comment