Author: Oscar Cronquist Article last updated on April 19, 2022

The ROWS function allows you to calculate the number of rows in a cell range.

The example above shows that cell range B3:B10 contains 8 rows.

1. ROWS Function Syntax


Back to top

2. ROWS Function Argument

array Required. A cell range for which you want to calculate the number of rows.

Back to top

3. ROWS Function Example

ROWS function example

Formula in cell D3:


Back to top

4. Count rows in an array

ROWS function count rows in an array

The ROWS function also calculates the number of rows in an array.

Formula in cell B3:

=ROWS({20,95,67; 13,14,58; 96,74,28; 7,64,22})

The array has four rows. The ; (semicolon) character is a row delimiting character in an array.

Back to top

5. Count rows based on a condition

ROWS function condition

Formula in cell E3


Explaining formula

Step 1 - Logical expression


Step 2 - Filter values based on a condition


Step 3 - Count rows


Back to top

6. Count rows based on a list

ROWS function based on a list

Formula in cell F3:


Explaining formula

Step 1 - Which values equals any item in the list

COUNTIF(E3:E4, C3:C11)

Step 2 - Filter values based on array


Step 3 - Count rows


Back to top

7. Count rows in a delimited string

ROWS function string

Excel 365 dynamic array formula in cell C3:


Explaining formula

Step 1 -


Step 2 -


Back to top

8. Count rows in multiple cell ranges

ROWS function multiple cell ranges

Formula in cell B12:


Explaining formula

Step 1 - Join arrays


Step 2 - Calculate rows


Back to top