Quick Navigation
ROWS Function
Summary
The ROWS function in Excel returns the total number of rows in a specified cell range, array, or array formula. It's an essential tool for dynamic formulas that need to adapt based on data dimensions.
Syntax
ROWS(array)
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| array | Range/Array |
Yes | Reference to cells, array, or array formula to count rows from |
Using the ROWS Function
ROWS is perfect for creating formulas that automatically adjust when data ranges change size. Use it to build dynamic named ranges, calculate offsets in INDEX/MATCH, or determine array dimensions for advanced calculations.
Common ROWS Examples
Count Rows in a Data Range
=ROWS(A1:D10)
Returns 10 - counts all rows from A1 to D10 regardless of empty cells.
Array Constant Row Count
=ROWS({10,20,30;40,50,60;70,80,90})
Returns 3 - counts rows in the 3x3 array constant.
Dynamic Chart Data Range
=OFFSET(A1,0,0,ROWS(A:A),1)
Creates a dynamic range that expands with new data rows.
Frequently Asked Questions
Common Errors and Solutions
#VALUE! error
Cause: Non-array argument provided
Solution: Ensure the argument is a proper range, array, or array formula
Incorrect row count
Cause: Using single cell instead of range
Solution: Select full range: ROWS(A1:A10) instead of ROWS(A1)
Notes
- ROWS always returns a single number value
- Works with 2D arrays - only counts rows, not columns
- Use ROWS(array)*COLUMNS(array) to get total cell count
- Compatible with all Excel versions since 2007
Compatibility
Available in: Excel 2007, Excel 2010, Excel 2013, Excel 2016, Excel 2019, Excel 2021, Excel 365
Not available in:
Content last reviewed: December 11, 2025
Update frequency: As needed
Excel versions tested: Excel 2007+