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.
- In B2, write a ROWS formula for A2:A6.
- B2 should show how many rows are in A2:A6.
Step 1 of 2
Enter =ROWS(A2:A6) in B2.
A2:A6 has 5 rows.
Formulas here use English function names, such as SUM, and a period as the decimal separator, in every language.
Loading the sheet…
B2 uses ROWS.
B2 now shows 5.
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.