ROWS
Returns the number of rows in a reference or array.
ROWS reports height, not data density.
The Formualizer engine in this repository at 0.15.0 plus unreleased changes computes the example results. Known differences from Excel are listed on this page.
Syntax
=ROWS(array)
Arguments
| Argument | Type | Required | Default |
|---|---|---|---|
array | any (range) | Required | — |
Remarks
- For a single cell reference, returns
1. - For full-column references (for example
A:A), returns1048576. - For array literals, returns the outer array length.
- Invalid references return an error.
Examples
Count the corresponding dimension of a rectangular array.
Formula =ROWS({1,2,3;4,5,6})
Expected result 2
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Count the dimension when the array has one column and three rows.
Formula =ROWS({1;2;3})
Expected result 3
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
The smallest array has one row and one column.
Formula =ROWS({42})
Expected result 1
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Count rows in a contiguous range
Formula =ROWS(B2:D10)
Expected result 9
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Count rows in a full column reference
Formula =ROWS(A:A)
Expected result 1048576
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Related functions
FAQ
Does ROWS count populated rows or reference height?
ROWS returns reference height only; blanks inside the range do not reduce the count.
How does ROWS behave for full-column references?
A full-column reference (like A:A) returns the sheet row limit, 1048576.