Lookup & reference function

ROW function

Returns the row number of a cell reference, or of the cell holding the formula if no reference is given.

Available in All versions of Excel, including Microsoft 365, Excel for the web and Excel for Mac

In every Excel versionWorks in Google Sheets

Syntax

ROW([reference])
ArgumentWhat it means
referenceOptionalA cell or range. If omitted, ROW uses the formula's own cell. A multi-row range returns every row number as an array in Microsoft 365.

Returns: A whole number: the row number on the worksheet.

How ROW works

ROW tells you which row a cell is on. =ROW(B7) returns 7, and =ROW() typed in A5 returns 5. That makes it a simple way to generate counters, numbered lists and alternating patterns without typing numbers by hand.

A common use is automatic numbering: =ROW()-1 in A2 returns 1, and copying it down gives 2, 3, 4... The numbers stay correct when you sort or delete rows, unlike typed numbers. ROW also helps conditional formatting (=MOD(ROW(),2)=0 shades every other row) and older array formulas that need a list of positions; in Microsoft 365, SEQUENCE is usually clearer for that. Pass a multi-row range and you get one number per row, which spills.

Examples

1Row number of an address

A1fx=ROW(B7)
A
17

Result: 7

Cell B7 is on row 7; the column is ignored.

2Automatic numbering

A2fx=ROW()-1
AB
1No.Task
21Order stock
3Call supplier
4Send invoices

Result: 1

In A2, ROW() is 2, so the formula shows 1. Copied down to A3 and A4 it shows 2 and 3, and it renumbers itself if a row is deleted.

3Array of row numbers

C1fx=ROW(A2:A4)
ABC
12
23
34

A three-row range returns three row numbers that spill down C1:C3.

⬇Practice workbookExamples with live formulas + practice sheets · .xlsx · 15 KB

Common errors and how to fix them

ErrorWhy it happensFix
#NAME?A row number was typed without a column, like ROW(7).Use ROW(A7) or ROW(7:7).

Tips

  • Subtract the header's row instead of a fixed number: =ROW()-ROW($A$1) keeps working if you insert rows above the table.
  • For the number of rows in a range, use ROWS.
  • Shade alternate rows with the conditional formatting rule =MOD(ROW(),2)=0.

Google Sheets

ROW also exists in Google Sheets and works the same way for everyday use, so the examples above work there too.

ROW in other languages

In a non-English version of Excel the function has a local name. Excel translates formulas automatically when a file is opened in another language.

LanguageFunction name
CzechŘÁDEK
DanishRÆKKE
DutchRIJ
FinnishRIVI
FrenchLIGNE
GermanZEILE
HungarianSOR
ItalianRIF.RIGA
Norwegian (Bokmål)RAD
PolishWIERSZ
Portuguese (Brazil)LIN
Portuguese (Portugal)LIN
RussianСТРОКА
SpanishFILA
SwedishRAD
TurkishSATIR

Recipes that use ROW