Lookup & Reference

ROWS Formula

ROWS returns the number of rows in a reference or array. It is commonly used to determine the size of a range, count results from dynamic array formulas, or build formulas that adapt to range dimensions.

Syntax

ROWS(array)
ParameterDescription
array Parameter of the ROWS function.
Try ROWS in Viztab — free, no signup

Examples

Count rows in range

Formula
=ROWS(A1:A10)
Returns 10 — the range spans 10 rows.

Count filtered results

Formula
=ROWS(FILTER(A1:A100, B1:B100>50))
Returns the number of rows where column B exceeds 50. Useful for counting how many records pass a filter.

Last row of dynamic range

Formula
=INDEX(A:A, ROWS(A1:A100))
Returns the value in A10 (the last row of the specified range). Useful for grabbing the bottom of a data set.

Common Errors

#VALUE!

Occurs if the argument is not a valid reference or array.

#CALC!

Can occur when wrapping a FILTER that returns no results (empty array) — use the if_empty argument in FILTER to prevent this.

Tips

ROWS vs COUNTA

ROWS counts total rows in the range (including blanks). COUNTA counts non-empty cells. Use ROWS for range dimensions, COUNTA for data count.

Dynamic array sizing

ROWS(UNIQUE(A1:A100)) tells you how many unique values exist. Combine with other dynamic array functions to measure their output.

Works with arrays

ROWS works on both cell ranges and in-memory arrays like {1,2,3;4,5,6} (returns 2 for this 2-row array).

Try ROWS in Viztab

Import your data and use ROWS with 370+ other formulas. No signup required.

Open Viztab

Related Formulas