Category: FUNCTION | Updated: 2026-11-22
How to Use the ROWS Function in Google Sheets | Count the Number of Rows in a Range
How to Use the ROWS Function
The ROWS function returns the number of rows (vertical cell count) in a specified cell range or array as a number. It is useful for checking total table capacity and building dynamic range calculations.
Syntax
=ROWS(range)
- range: The cell range (e.g.,
A2:D50) or array (e.g.,{1; 2; 3}) whose row count you want to find (required).
Example Using a Table
Here is an example of getting the total number of rows (slots) in the seminar attendee list below (rows 2 to 6). Even with a blank cell in the middle, the row count is calculated accurately.
| Row | Column A (Registration No.) | Column B (Name) | Column C (Attendance Type) |
|---|---|---|---|
| 1 | Registration No. | Name | Attendance Type |
| 2 | 101 | Ichiro Tanaka | In-Person |
| 3 | 102 | Hanako Sato | Online |
| 4 | 103 | (Blank) | Online |
| 5 | 104 | Kenta Suzuki | In-Person |
| 6 | 105 | Misaki Takahashi | In-Person |
- Formula:
=ROWS(A2:C6) - Result:
5(returns a total of 5 rows from row 2 through row 6)
Common Errors and Notes
- Blank Rows Are Also Counted: Because
ROWSreturns the vertical size of a cell range, blank rows are not excluded. If you want to know how many rows actually contain data, useCOUNTA. - Avoid Including the Header Row by Mistake: Passing the entire table (
A1:C6) includes the header row in the count. To count only data rows, specifyA2:C6or write=ROWS(A1:C6)-1. - Argument Cannot Be Omitted: Unlike
ROW(), callingROWS()without an argument returns a#N/A(wrong number of arguments) error, so always specify a range.
Frequently Asked Questions
Q. What is the difference between ROWS and COUNT?
A. COUNT counts the number of cells in a range that contain numeric values, whereas ROWS returns the total number of rows (the vertical height) of the specified range regardless of whether cells are blank, text, or numbers.
Q. Does the ROWS function count blank cells as well?
A. Yes. ROWS counts the total number of rows in the specified range regardless of whether the cells contain values.