Tip: Other languages are Google-Translated. You can visit the English version of this link.
Log in
x
or
x
x
Register
x

or

Excel ROW Function

The Excel ROW function returns the row number of a reference.


Syntax

=ROW ([reference])


Arguments

Reference (optional): It is the cell or a range of cells you want to get the row number.

  • If the reference parameter is omitted, it assumes that the reference is the cell address in which the ROW function currently appears.
  • If the reference is a range of cells which entered as vertical array (says =ROW(F5:F10)), it will return the row number of the first cell in the range (the result will be 5).
  • The reference can’t include multiple references or addresses.

Return value

The ROW function will return a number which representing the row of a reference.


Examples

The ROW function is very simple and easy to use in our Excel daily work. This section is going to show you some examples of ROW function to help you easily understand and use it in the future.

Example 1: The basic usage of ROW function in Excel

Select a cell and enter formula =ROW() into it will get the row number of this cell immediately.

As the below screenshot shown, copy the below formula into cell E3 will return the result as number 3.
=ROW()

If specify a cell reference in the ROW function, such as =ROW(G103), it will return the row number 103 as below screenshot shown.

Example 2: Automatically number rows in Excel with ROW function

The ROW function can help to automatically number rows, and the created serial numbers will be updated automatically when adding or deleting rows from the range. See the below demo:

1. Supposing you want to start your serial numbers from 1 in cell A2, please select the cell and copy the below formula into it and press the Enter key.
=ROW()-1

Note: If the beginning cell is A5, apply this formula =ROW()-4. Please subtract the row number above the current cell from where you are starting the serial number.

2. Keep selecting cell A2, drag the Fill Handle across the rows to create the series you need. See screenshot:

Example 3: highlight every other row (alternate rows) in Excel with ROW function

In this example, we explain how to shade every other row (alternate rows) in Excel by using the ROW function. Please do as follows.

1. Select the range you want to apply color to the alternate rows, click Conditional Formatting > New Rule under the Home tab. See screenshot:

2. In the New Formatting Rule dialog box, you need to:

  • 2.1) Select the Use a formula to determine which cells to format option in the Select a Rule Type box;
  • 2.2) Enter formula =MOD(ROW(),2)=0 into the Format values where this formula is true box;
  • 2.3) Click the Format button to specify a Fill color;
  • 2.4) Click the OK button. See screenshot:

Note: The formula =MOD(ROW(),2)=0 means that all even rows in the selected range will be highlighted with certain fill color. If you want to shade all odd rows in the selected range, please change the 0 to 1 in the formula.

Then you can see all even rows in selected range are highlighted immediately.


Excel Productivity Tools

300 Advanced Features Help You To Stand Out From Crowd

Would you like to complete your daily work quickly and perfectly? Kutools for Excel brings 300 powerful advanced features (Combine workbooks, sum by color, split cell contents, convert date, and so on...) and save 70% time.

  • Designed for 1500 work scenarios, helps you solve 80% Excel problems.
  • Reduce thousands of keyboard and mouse clicks every day, relieve your tired eyes and hands.
  • Become an Excel expert in 3 minutes. No longer need to remember any painful formulas and VBA codes.
  • 60-day unlimited free trial. 60-day money back guarantee. Free upgrade and support for 2 years.

Brings Efficient Tabs to Office (include Excel), Just Like Chrome, Firefox, And New IE

  • Office Tab Increases your productivity by 50% when viewing and editing multiple documents.
  • Reduce hundreds of mouse clicks for you every day, say goodbye to mouse hand.
  • One second to switch between dozens of open documents!
Say something here...
symbols left.
You are guest ( Sign Up? )
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.

Be the first to comment.