The ROWS function returns the number of rows in a specified array or range.
The number of rows in a range can be important for analyzing data and creating dynamic formulas.
Syntax
ROWS(array)
Argument |
Description |
Permitted values |
|---|---|---|
array |
Range of cells or array of values for which the number of rows needs to be determined |
Any range or array of cells |
Examples of use
Counting the number of rows in a range
=ROWS(A1:A10)
This formula returns the number of rows in the range A1:A10.
Result: 10.
Counting the number of rows in the workspace
=ROWS($A:$A)
Result: the number of rows in the workspace.
Counting rows using a named range
If you have created a named range, for example, “MyRange”, you can use it in a function:
=ROWS(MyRange)
The result will depend on the size of the named range.
Notes
–Unlike the COUNTA function, the ROWS function returns the total number of rows in a range, not the number of filled cells.
–The function is often used in conjunction with the COLUMNS function to fully determine the size of a range.