Lookup

ROWS

Definition

ROWS returns how many rows are in a range.

Syntax

=ROWS(array)

Arguments

Argument Meaning
array The range whose height to count, such as B2:B8.

Worked example

A log occupies B2:B8. The first and last cells are filled; the cells between them may be empty.

B: Log
start
end

Formula: =ROWS(B2:B8)

Result: 7. B2:B8 is seven rows tall, including the empty cells.

Practice

Cells A2 and A6 hold 1. In B2, write a formula that returns how many rows are in A2:A6.

  1. In B2, write a ROWS formula for A2:A6.
Step 1 of 2
Formulas here use English function names, such as SUM, and a period as the decimal separator, in every language.
Loading the sheet…

Related functions

COUNT counts numeric cells, which can be fewer than the rows in the range. INDEX still needs a position no larger than that height.

Common mistake

Expecting ROWS to skip blanks: ROWS(A2:A6) is 5 even when A3:A5 are empty.

Related functions

These links are related functions.