Contact

ROWS in Excel: Count Range Height Without Counting Values

Lookup Intermediate Microsoft Excel

Measure range height with Excel ROWS, distinguish dimensions from populated cells, and build expanding counters and shape checks.

Verification status: See the evidence and test scope described in this guide. How formula examples are checked

Quick answer: ROWS returns the number of rows in a range or array. It measures the shape, so blank cells and repeated values do not reduce the answer.

Availability and version history

  • Introduced: Original introduction release not established by the official history reviewed.
  • Availability: official help lists Excel for Microsoft 365, Excel for Microsoft 365 for Mac, Excel 2024, Excel 2024 for Mac, Excel 2021, Excel 2021 for Mac, Excel 2019, Excel 2016.
  • Checked: October 14, 2026; official ROWS reference. Documentation check; examples independently calculated, not native-tested.

Syntax and the quantity being measured

=ROWS(array)

The argument is required and can be a range or an array expression. ROWS returns one number. It does not count the numeric values, nonblank cells, unique records or visible rows inside that range. Those are different questions. Official ROWS syntax

For a rectangular worksheet reference, subtract the first row number from the last and add one. B3:D7 spans rows 3, 4, 5, 6 and 7, so its height is five even though it has three columns.

Prepare a deliberately incomplete range

Enter these values in B3:D7. Leave the cells marked blank physically empty; do not type the word blank.

Worksheet row B C D
3 Pen East 12
4 Pad West 5
5 blank blank blank
6 Box East 7
7 Pen North 0

The table headings above identify the worksheet columns and are not part of B3:D7. Keep output formulas outside that source rectangle.

Example 1: measure the entire height

=ROWS(B3:D7)

Expected result: 5. The entirely blank fifth worksheet row still occupies one row in the reference. Repeated Pen labels also have no effect on the dimension.

A narrower reference gives the same answer:

=ROWS(B3:B7)

Expected result: 5. Removing columns from the reference does not shorten its height.

Example 2: compare height with populated data

=COUNTA(B3:B7)
=COUNT(D3:D7)

For the stated inputs, both return 4, while ROWS returns 5. COUNTA finds four populated labels. COUNT finds four numbers, including the zero. The blank record position is counted by ROWS but not by either of those content-based counts.

This distinction matters in averages and completion metrics. Dividing by range height assumes every row belongs in the denominator; dividing by a numeric count excludes nonnumeric observations. Choose the denominator from the question being answered.

Example 3: a counter that expands when filled down

In F3 enter:

=ROWS($B$3:B3)

Fill it down through F7. Expected values are 1, 2, 3, 4, 5. The first endpoint is fixed, while the second endpoint moves as the formula is copied. In F4 the effective reference becomes $B$3:B4, which contains two rows.

This numbers the positions in the selected interval, including the blank source row. It is not an enduring record ID: changing the layout or inserting rows can change the displayed sequence. Store actual stable identifiers separately when a record must keep its identity.

Advanced example: verify the dimensions of a generated array

In an Excel edition supporting SEQUENCE:

=ROWS(SEQUENCE(4,3,10,2))

Expected result: 4. The inner formula creates four rows and three columns, but the outer ROWS returns only the height. It does not add the generated values or multiply the dimensions.

A companion =COLUMNS(SEQUENCE(4,3,10,2)) returns 3. Multiplying the two dimensions gives 12 element positions. This is a shape check, not a count of nonempty results.

The availability of ROWS in an older Excel edition does not imply that the nested SEQUENCE function is available there. Check the SEQUENCE guide before using that particular combination.

Troubleshooting

If the result includes an unwanted header, inspect whether the header row is inside the reference. If the result is unchanged after clearing a cell, that is expected: clearing content does not change the referenced dimensions.

A worksheet filter hides records but does not rewrite B3:D7 into a shorter reference. Use an appropriate visible-row calculation when that is the requirement. Also test an inner array expression separately if its error prevents the outer dimension check from producing a result.

Verification: These are fictional inputs and independently calculated expected results, not native Excel observations. See the editorial testing standards.