How to Use the ROW Function in Google Sheets

By Tomosuke Hasegawa · Updated Oct 29, 2026 · Beginner · 4 min read · includes 2 free exercises

In short: ROW returns the row number of a cell. The formula is =ROW([cell_reference]). With no argument, it uses the cell the formula is in.

What ROW does

ROW answers "which row is this?" It looks small, but it is a building block for automatic numbering, alternating patterns and formulas that need a position. Its sibling COLUMN does the same for columns, with column A as 1.

ROW syntax

=ROW([cell_reference])

Per Google's help page, cell_reference is optional. If you leave it out, the function uses the cell where the formula is entered. If the reference spans more than one row and the formula is not an array formula, only the row number of the first row is returned.

A step-by-step example

=ROW(A9)

This returns 9, the row number of cell A9. Google's own sample is the same formula.

Number rows automatically

Typed numbers go wrong when you insert or delete rows. A formula fixes that. If your data starts in row 2, with a header in row 1, put this in A2 and fill it down:

=ROW() - 1

In row 2 it returns 1, in row 3 it returns 2, and so on. Because the formula uses its own position, the numbering adjusts as rows move. For a one-formula list, SEQUENCE is another option, and ROW also works with OFFSET.

Common mistakes

Try it yourself

Type your formula into the box, starting with =, then press Check.

Exercise 1: Row of A9

Write a formula that returns the row number of cell A9.

Hint: pass the cell reference.

Exercise 2: Automatic numbering

Your data starts in row 2. Write a formula, with no cell reference, that returns 1 when typed in row 2.

Hint: ROW() minus the header row.

What to learn next

Syntax and rules in this guide were checked against Google's ROW help page. See all guides.