ROW function in Excel

What is ROW function in Excel?

The ROW function is one of the Excel Lookup & reference functions.

It returns the ROW number of a reference.

We can find this function in Lookup & reference of insert function Tab.

How to use row function in excel

  1. Click on empty cell (like F5 )
Click on empty cell excel

2. Click on the fx icon (or press shift+F3)

Click on the fx icon excel

3. In the insert function tab you will see all functions

 insert function tab excel

4. Select Lookup & reference category

5. Select ROW function

6. Then select ok

7. In the function arguments Tab, you will see ROW function

8. In the Reference section you can enter the cell or a single range of cells that you want the ROW number.

9. If you click on G4, see result 4

ROW function in excel

10. If you click on A2, see result 2

How to use row function in excel

11. You will see the result in formula result section

Examples of ROW function in excel

Example 1: How to Automatic row numbering in the Excel

We can use ROW function if we want to number a set of data in Excel.

First, suppose we have data as shown in the image below:

How to Automatic row numbering in Excel

We can automatically number cells 2 to 10 by the ROW function, By Typing =ROW()-1 in cells.

How to Automatic row numbering in Excel

Example 2: How to Highlight Every other Row in the Excel

If we want Highlight Every other Row in Excel, we can combine ROW, MOD and Conditional formatting:

1. Select column A

2. In Home Tab, Choose Conditional formatting.(Press ALT+H+L)

3. Select New Rule. (Press ALT+H+L+N)

How to Highlight Every other Row in Excel

4. In New Formatting Rule Tab, Select Use a Formula to determine Which Cells To Format.

5. In formula box, Type =MOD(ROW(),2)=1

6. Select Format

How to Highlight Every other Row in Excel

7. In the Format cell Tab, Select Fill.

8. In Fill Tab, Select your Color.

9. Finally Select ok.

ROW function in Excel

Example 3: HOW to Generate Specific Serial Number in Excel

If we want Generate Specific Sequential Serial numbers in Excel, we can combine ROW and Text:

1. Choose your format text (ex: “00-00-0000”)

2. Type in cell A2 =TEXT(ROW(A2)-1,”00-00-0000″)

3. Drag the fill handle to the last cell of the range.

HOW to Generate Specific Serial Number in Excel

Things to Remember

  • The argument of this function is required and not optional
  • If a reference is omitted, the cell containing the ROW function is used.
  • This function is available for all excel versions(2007-2019)

Python code for ROW function

NameAgeHeightWeight
Olivia25210180
Noah25205235
Oliver27195205
Elijah22198185
James29199231
William29201240
Benjamin21202235
Lucas25200238
Henry22204190

import pandas as pd

df=pd.read_csv(‘example.csv’)

maxrow=df['Name'].notna().sum()

print (maxrow)

ROW related functions :

Leave a Reply

Your email address will not be published. Required fields are marked *