Contact

ROWS Function in Google Sheets: Syntax, Examples & Troubleshooting

Lookup Intermediate Google Sheets

Count array height, distinguish capacity from populated records and measure filtered results without hiding empty-search errors.

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. =ROWS(B2:D6) is expected to return 5. It counts the selected height, not just rows containing visible data.

Availability and version history

  • Introduced: Original introduction date is not established by the official history reviewed.
  • Availability: Documented in the rolling Google Sheets service. This guide covers ordinary worksheet formulas in the web workflow; it does not establish separate mobile or connected-database behavior.
  • Checked: October 14, 2026, against the official ROWS reference. Documentation and independent calculations; no native application execution.

Syntax and documented scope

=ROWS(range)

The range is required. A single cell has height one, and a wide single-row range also has height one. The result is one number, even when the source spans several columns.

Google’s page separately describes a Connected Sheets/BigQuery column form. This guide covers ordinary worksheet ranges and calculated arrays; it does not claim to test connected database execution, permissions or query behavior.

Example 1: compare heights and widths

=ROWS(B2:D6)
=ROWS(B2:D2)
=ROWS(D6)
=ROWS(A10:A20)

The expected values are 5, 1, 1, 11. The last interval is inclusive: rows 10 through 20 contain eleven positions, not ten. The number of selected columns does not multiply the ROWS result.

For B2:D6 there are five rows and three columns, or fifteen cell positions in total. ROWS returns only the height component. Use a width calculation as well if total rectangular capacity is the question.

Example 2: blanks remain part of a selected range

In a blank sheet enter Pen in A2 and Box in A6, leaving A3:A5 empty:

=ROWS(A2:A6)

The expected result is 5, not 2. A2:A6 selects five row positions whether two, five or none of them contain labels. ROWS is therefore useful for capacity checks, while COUNTA answers a different populated-cell question.

Formula-returned empty strings can complicate populated-cell tests, but they do not change the height of an explicitly selected five-row rectangle.

Prepare a small status table

On a separate sheet, enter headings Item, Status, Units in B1:D1 and the following records in B2:D6:

Item Status Units
A Open 12
B Closed 8
C Open 15
D Open 9
E Closed 6

The table contains five records. The heading row is excluded from the formulas below unless explicitly stated.

Advanced example: count rows in a filtered result

=ROWS(FILTER(B2:D6,C2:C6="Open"))

The expected result is 3, because records A, C and D meet the condition. The inner FILTER returns three rows and three columns; ROWS returns its height without returning the table itself.

Changing the criterion to Closed produces 2. Changing it to Paused produces FILTER’s documented #N/A, rather than an empty zero-row array that ROWS can count. Do not assume ROWS converts a failed or empty search into zero.

If the desired task is only to count statuses, =COUNTIF(C2:C6,"Open") is simpler and is expected to return 3. See COUNTIF and FILTER for the distinction between counting and returning records.

Example 3: report capacity including a header

=ROWS(B1:D6)-1

The expected result is 5. Subtracting one is valid here because the selected range contains exactly one heading row. It would be wrong for a table with two title rows or no heading.

This still measures selected data-row capacity. If one of the five record rows is empty, the result remains five. Explain that limitation in a report instead of labeling the number as an audited count of complete records.

Advanced example: height after transposition

=ROWS(TRANSPOSE(B2:D6))

The expected result is 3. The source is five rows by three columns; TRANSPOSE returns three rows by five columns. Height and width exchange places.

Similarly, =ROWS(SEQUENCE(4,2)) is expected to return 4, because SEQUENCE creates four rows even though it generates eight values in total.

Troubleshooting and verification

Check inclusive endpoints, heading inclusion and the inner expression before adding error handling. ROW returns a coordinate; ROWS counts a height. Whole-column references describe the allocated sheet range, so prefer bounded references when the intended record count is known.

All geometric counts, filtered memberships and composed outputs above were independently calculated. No native Sheets or BigQuery execution is claimed. Formulas use an English-locale comma separator. For migration testing, retain the exact selected ranges and compare errors as well as successful numeric results.

Official reference and testing scope