LocalExcelTool
Get started

Excel ROW function

ROW returns a row number, which sounds useless until you need automatic numbering: =ROW()-1 in row 2 gives 1, and it renumbers itself after rows are inserted or deleted. It also supplies row coordinates to INDEX and OFFSET, so it shows up inside most dynamic-range formulas.

Lookup & reference · Available in: Excel 97 and every desktop version since

Syntax

ROW([reference])

What it returns The row number of the reference; with no argument, the row of the formula itself.

Arguments
referenceoptionalThe cell or range whose row number you want; omitted means the current row.

Examples

Number rows starting from the second

#Item
1Paper
2Toner
3Stapler
= ROW()-1

→ 1(在 A2 单元格里)

A2 is on row 2, ROW() returns 2, minus 1 gives 1. Fill down for 2, 3, 4; insert a row in the middle and everything below renumbers without dragging again.

Pass a range to get an array of row numbers

A
B
C
= ROW(A2:A4)

→ {2;3;4}

A range argument returns an array, which spills into three rows in Excel 365. It is usually combined with SMALL or INDEX to pick the Nth non-empty value.

Common mistakes

  • 1.Numbering in the middle of a table without subtracting the header rows, so the first number is 2.
  • 2.Expecting the numbers to stay fixed after deleting a row — ROW is "where I am now", so the sequence jumps. Use SUBTOTAL or typed values when the numbers must be stable.
  • 3.Entering ROW(A2:A4) as a normal formula in an older version: only 2 appears until you use Ctrl+Shift+Enter or combine it with another function.

How to use it

  1. 1.Click the cell where the result should appear.
  2. 2.Type = then the function name, and press Tab to accept it.
  3. 3.Enter each argument separated by commas; ranges can be dragged with the mouse.
  4. 4.Press Enter. Drag the fill handle down if the same formula applies to more rows.

Frequently asked questions

What is the syntax of ROW?

ROW([reference]). What it returns: The row number of the reference; with no argument, the row of the formula itself.

Which Excel versions support ROW?

Excel 97 and every desktop version since. It is available in every desktop version unless the note above says otherwise.

Why does ROW return an error instead of a value?

Numbering in the middle of a table without subtracting the header rows, so the first number is 2.

Related functions

More in this group

Need to get the data in first?

← All Excel formulas