Excel ROWS Function (Examples + Video)
When to use Excel ROWS Function
Excel ROWS Function can be used when you want to get the number of rows in a specified range or array.
What it Returns
It returns a number that represents the total number of rows in the specified range or array.
- array – it could be an array, an array formula or a reference to a contiguous range of cells.
- Even if the array contains multiple rows and columns, only the rows are counted.
- For example:
ROWS(A1:B3) would return 3.
ROWS(A1:B100) would return 100.
- ROWS formula can be useful when you want to get a sequence of numbers as you go down the rows in your worksheet.
- For example, if you want 1 in A1, 2 in A2, 3 in A3 and so on, use the following formula =ROWS($A$1:A1). As you would drag this down, the reference inside it would change and the number of rows in the reference would get incremented by one. For example, when you drag it to row A2, the formula becomes ROWS($A$1:A2) which then returns 2.
Excel ROWS Function – Examples
Here are two examples of using the Excel ROWS function.
Example 1: Finding the number of Rows in an Array
In the example above, =ROWS(A1:A1) returns 1 as it covers one row (which is A1). Similarly, =ROWS(A1:A4) returns 4 as the array A1:A4 covers fours rows in it.
Example 2: Getting a Sequence of Numbers in a Column
Excel ROWS function can be used to get a sequence of numbers. Since the first reference is fixed, as you copy the formula down, the second reference changes and so does the row numbers in the array.