Category: FUNCTION | Updated: 2026-11-22

How to Use the ROW Function in Google Sheets | Get Row Numbers and Create Auto-Numbering

How to Use the ROW Function

The ROW function returns the row number (1, 2, 3…) of a specified cell as a number. When the argument is omitted, it returns the row number of the cell containing the formula, making it widely used for automatic row numbering and conditional formatting.

Syntax

=ROW([cell_reference])
  • cell_reference: The cell or cell range whose row number you want to find (optional). If omitted, it returns the row number of the cell in which ROW is entered.

Example Using a Table

Here is an example of automatically numbering rows 1, 2, 3... starting from row 2 in a task management table with a header in row 1.

Row Column A (No.) Column B (Formula) Column C (Task Name)
1 No. (Entered Formula) Task Name
2 1 =ROW()-1 Create Proposal
3 2 =ROW()-1 Request Quote
4 3 =ROW()-1 Client Meeting
  • Formula: =ROW()-1 (entered in cell A2)
  • Result: 1 (subtracts 1 header row from row 2 to get 1, and automatically becomes 2, 3, etc. when copied down)

Common Errors and Notes

  • Numbers Change When Sorting: Sequential numbers created with =ROW()-1 depend on the current row position, so sorting the table will reassign numbers based on the new row positions. If you need fixed record IDs, paste values or consider using SEQUENCE or static IDs.
  • Passing a Multi-Row Range: Specifying a multi-row range like =ROW(A2:A5) normally returns only the first row number (2). To expand all row numbers as an array, wrap it in ARRAYFORMULA: =ARRAYFORMULA(ROW(A2:A5)).
  • Invalid Cell Reference (#NAME? / #ERROR!): Passing a non-existent cell address or unquoted text causes an error.

Frequently Asked Questions

Q. How can I use ROW to create sequential numbers that do not break when rows are deleted?

A. If row 1 is a header row, enter "=ROW()-1" in row 2 and copy it down. Because it subtracts 1 (for the header) from the formula's own row number, the numbering automatically adjusts even if intermediate rows are inserted or deleted.

Q. What value is returned if I leave the parentheses empty in ROW()?

A. If you omit the argument and write "=ROW()", it returns the row number of the cell where the formula is entered.