=ROWS(rng)
If you need to count the number of rows in a range, use the ROWS function. In the generic form of the formula (above) rng represents a range of cells.
In the example, the active cell contains this formula:
=ROWS(B4:C9)
ROWS counts the number of rows in the supplied range and returns that number as the result.