ID EN
#Lookup and reference

ROWS

Excel Functions

Get the number of rows in an array or reference.

Syntax

EXCEL
=ROWS(array)

Arguments

Parameter Description
array A reference to a cell or range of cells.

Return Value

Number of rows

Details

The ROWS function returns the count of rows in a given reference as a number. For example, =ROWS(A1:A5) returns 5, since the range A1:A5 contains 5 rows. ROWS takes just one argument, called array, which can be a range or array. Use the ROWS function to get the row count for a given reference or range. For example, there are 10 rows in the range A1:F10 so the formula below returns 10: The range A1:Z100 contains 100 rows, so the formula below returns 100: You can also use the ROWS function to get a row count for an array constant: Although there is no built-in function to count the number of cells in a range, you can use the ROWS function together with the COLUMNS function like this:

Examples

Examples

Use the ROWS function to get the row count for a given reference or range. For example, there are 10 rows in the range A1:F10 so the formula below ret

EXCEL
=ROWS(A1:F10) // returns 10
Examples

The range A1:Z100 contains 100 rows, so the formula below returns 100:

EXCEL
=ROWS(A1:Z100) // returns 100
Examples

You can also use the ROWS function to get a row count for an array constant:

EXCEL
=ROWS({1;2;3;4;5}) // returns 5
Examples

Although there is no built-in function to count the number of cells in a range, you can use the ROWS function together with the COLUMNS function like

EXCEL
=COLUMNS(range)*ROWS(range) // total cells
=COLUMNS(A1:Z100)*ROWS(A1:Z100) // returns 2600

See Also

ROW COLUMN COLUMNS