Summary

To count the number of rows in a range, use the ROWS function. In the example shown, the formula in F5 is:

=ROWS(B5:C10)

Generic formula

=ROWS(rng)

Explanation 

The ROWS function is fully automatic. When you provide a range to ROWS, it will return a count of all rows in the range. In the example, the formula in F5 returns 6, because there are 6 rows in the range B5:C10:

=ROWS(B5:C10) // count rows

ROWS counts the number of rows in any supplied range and returns a number as a result. For example, if we provide all of column A in a range, Excel returns 1,048,576 the total number of rows in an Excel worksheet.

=ROWS(A:A) // returns 1048576

To count columns in a range, see the COLUMNS function.

Dave Bruns Profile Picture

AuthorMicrosoft Most Valuable Professional Award

Dave Bruns

Hi - I'm Dave Bruns, and I run Exceljet with my wife, Lisa. Our goal is to help you work faster in Excel. We create short videos, and clear examples of formulas, functions, pivot tables, conditional formatting, and charts.