ROW Function

Tells you which row number a cell sits in.

Category

Lookup & Reference

Available in

All versions, Microsoft 365

Returns

A row number

Taught hands-on in Level 4: Advanced Dynamic Arrays & Logic · Reference Functions module

Overview

ROW returns the row number of a reference. =ROW(C7) returns 7. Leave the reference out and you get the row of the formula's own cell.

It's commonly used to build running numbers and to convert sheet positions into list positions.

Syntax

=ROW([reference])

Arguments

ArgumentRequired?What it does
referenceOptionalThe cell or range to check. If left out, the formula's own cell is used.

Examples

Example 1 — Auto-numbering a list

Number each row starting at 1, even though the data starts in row 2.

A2fx=ROW()-1
AB
1#Item
21Pens
32Pads
43Ink
=ROW()-1 Explain

Example 2 — Shading every other row

In Conditional Formatting, use this formula rule to band rows.

=MOD(ROW(), 2) = 0 Explain
Numbers from ROW()-1 survive sorting better if you use =SEQUENCE(COUNTA(B2:B100)) instead.

Common mistakes

  • Numbers shift when rows move. ROW reflects the current position — sorting or deleting rows changes the results.

Notes

  • Given a range in Microsoft 365, ROW spills one number per row.
  • Related functions: ROWS, COLUMN, SEQUENCE.
Kyle Stott

Author

Kyle Stott

Certified Microsoft Excel Expert

Kyle has worked professionally with Microsoft Excel for over a decade and has consulted on and taught Excel best practices to over 400 companies across 30+ countries.