ROWS Function In Excel

Article byJeevan A Y
Edited bySheeba M
Reviewed byDheeraj Vaidya, CFA, FRM

What Is Excel ROWS Function?

The ROWS function in Excel returns the count of the number of rows selected in the range. It is also a referencing function to identify the number of rows in a given array.

The Excel ROWS function is different from the ROW function because, the ROW function gives us the row number for the selected cell, and the ROWS function takes an array of rows as an argument and provides us with the number of rows in that array.

For example, =ROWS(A1:A3) returns 3, since the range A1:A3 contains 3 rows, and  =ROWS(A1:C1) returns 1, since the range A1:C1 contains a row, as shown below.

Rows Function in Excel

You are free to use this image on your website, templates, etc, How to Provide Attribution?Article Link to be Hyperlinked
For eg:
Source: ROWS Function In Excel (
Please provide us with an attribution link[/wsm-img-cr-tooltip]

Key Takeaways

  • The ROWS function in Excel, different from the ROW function, helps us find the count of the rows of the cells selected, irrespective of the data values on the selected rows. The function only gives us the row count.
  • It accepts only one argument, i.e., a cell range or an array. If we select multiple cell ranges or type multiple arguments within the formula, we will get an error, and the formula will not execute.
  • Since the ROWS function is an inbuilt function, we can insert the formula from the Function Library or enter it directly in the worksheet.

How To Use ROWS Function In Excel?

We can use the ROWS function In Excel using the following syntax,

Rows Function Excel-Syntax

The ROWS function has only one argument, i.e., the array, which is nothing but a cell referenceCell ReferenceCell reference in excel is referring the other cells to a cell to use its values or properties. For instance, if we have data in cell A2 and want to use that in cell A1, use =A2 in cell A1, and this will copy the A2 value in more. A cell reference could be a single cell or a range of cells.

–>> If you want to learn Excel and VBA professionally, then ​Excel VBA All in One Courses Bundle​ (35+ hours) is the perfect solution. Whether you’re a beginner or an experienced user, this bundle covers it all – from Basic Excel to Advanced Excel, Macros, Power Query, and VBA.

You can download this Rows Function Excel Template here – Rows Function Excel Template


We will consider examples using the ROWS function in Excel.

Example #1 – Using Row Cell Reference

Let us look at the simple example of the ROWS function.

  1. In cell B3, we will open the ROWS function. Then, we will give the cell reference as A1 in an array argument.

    Rows Function in Excel Example1

  2. We will close the bracket, and press the “Enter” key to see what we get.

    Rows Function in Excel Example1.1

    Since we selected only one cell, it returned the result as 1.

  3. We will change the cell reference from A1 to A1: A3.

    Rows Function in Excel Example1.2

  4. Now, close the formula, and press “Enter” to see the result.

    Rows Function in Excel Example1.3

    The output now is 3.

We got the result as 3 because we looked closely at the cell reference. It says A1:A3, i.e., three rows are selected in the range of cells.

Example #2 – Using Column Cells Reference

The ROWS function counts how many rows are selected in the reference. Now, we will apply the formula in cell B3, as shown below.

Rows Function in Excel Example2.0

We have given the cell reference as A1:C1. So, let us see what the result is.

Rows Function in Excel Example2.1

Even though we have selected 3 cells, we still got the result as 1 only!

It is because we have selected 3 cells in the same row, i.e., different column cells. Since we chose the range of cells in the same row, we only got the result of 1.

So, the ROWS formula cannot count COLUMNS in excelCount COLUMNS In ExcelThe COLUMNS function returns the total number of columns in the given array or collection of more here.

Example #3 – Count of Rows

The ROWS function counts only how many rows are in the reference. Now, look at this example.


We have given the cell reference as A4, i.e., the 4th row of the worksheet. Press the “Enter” to see the result.

Rows Function in Excel Example3.1

The result is 1, even though we have selected the 4th row of the worksheet.

As we told in the beginning, the ROWS function does not return row numbers. Rather, it returns only the count of selected rows. Since we have chosen only one row, the result is 1, not 4.

Example #4 – Insert Serial Numbers

We can use the ROWS function to insert serial numbers from 1. For example, we usually insert serial numbers from cell A2, so we will show you how to insert serial numbers with the ROWS formula in Excel.

Open the ROWS function in cell A2.


Select the cell reference as A2: A2.

Rows Function in Excel Example4.1

For the first cell, the reference refers as absolute. $A$2: A2.


Now, press the “Enter” key. Then, we should get the result as 1.

Rows Function in Excel Example4.3

Now, drag the formula down to get the serial numbers.

Since we have made the first part of the cell reference as an absolute cell reference, it remains the same when we drag it down, but another cell part keeps changing from A2 to A3, A3 to A4, and so on.


Difference Between ROW & ROWS

After knowing the ROWS function, it is important to understand how it differs from the ROW function in Excel.

The ROW function returns the row number of the selected cell in the worksheet, with or without a cell reference. For example, we choose the empty cell with the cell address A3, by using the ROW function.

Rows Function in Excel Example5

Since A3 is the third row in the worksheet, we got the result as 3.


But on the other hand, if we insert the same cell reference using the ROWS function.

Rows Function in Excel Example5.2

We will get the result as 1.


Because the Excel ROWS function returns the count of rows that are selected in the range.

Therefore, the ROW function returns the row number of the selected cell, and the ROWS function returns the count of selected rows in Excel.

Important Things To Note

  • We must ensure to enter atleast one cell reference, or else we will get the “#NAME?” error.
  • Irrespective of the cell values selected, the ROWS function returns the count of the number of rows selected.
  • We must enter only one array, or cell range. Multiple sets of cell ranges give an error as “Too many arguments entered”.

Frequently Asked Questions (FAQs)

1. Why is the Rows function in Excel not working?

A few reasons the Rows Function may not work are,
a. We have entered the wrong function name.
b. We have not entered even a single argument value or cell reference. One argument is mandatory, unlike the Row function, which does not need any arguments.

2. Why is the ROWS function not working?

A few reasons why ROWS function may not work are,
· We have used the function name as ROW instead of ROWS.
·  We have not provided the cell reference to count the number of rows.
·  We have given non-numeric value, and got a “#NAME?” error.

3. Where to find the ROWS function in Excel?

We can find the ROWS function as follows,
First, choose an empty cell – select the “Formulas” tab – go to the “Functions Library” group – click the “Lookup & Reference” option drop-down – select the “ROWS” function, as shown below.

Lookup & References - Rows

Recommended Articles

This article is a guide to ROWS Function in Excel. Here we use formula to find count of number of rows in selected cell range, examples & downloadable template. You can learn more about Excel functions from the following articles: –