FormulaCraft

How to create a sequential invoice number in Excel and Google Sheets

Topic:Data cleaning & shaping
Excel & Google Sheets
="INV-"&TEXT(ROW()-1,"0000")

Verified example

Computed by a real spreadsheet engine on the sample data below.

Invoice_NumClientAmount
Acme Corp1200
Beta LLC800
Gamma Inc2400

="INV-"&TEXT(ROW()-1,"0000")INV-0000

Try it with your data

Edit the grid or formula, then run it through a real spreadsheet engine — no signup.

Sample data — click any cell to edit

Runs server-side · free · no signup

Step by step

  1. 1Start your invoice table in row 2 with headers in row 1 (e.g., Invoice#, Date, Client, Amount).
  2. 2In cell A2, enter ="INV-"&TEXT(ROW()-1,"0000") — this produces INV-0001 in row 2, INV-0002 in row 3, and so on.
  3. 3Copy the formula down for as many invoice rows as you need.
  4. 4To start from a number other than 1, adjust the formula: ="INV-"&TEXT(ROW()-1+500,"0000") starts at INV-0501.

Tips

Working on a sheet you inherited? Run the Auditor on the whole file first — it flags every #REF!, #N/A, broken column pattern, and inconsistent formula in seconds, free, no signup.

Frequently asked

How do I include the year in the invoice number?

Use ="INV-"&YEAR(TODAY())&"-"&TEXT(ROW()-1,"0000") to produce INV-2026-0001 style numbers.

Will invoice numbers change if I insert a row above?

Yes — ROW()-based numbers shift when rows are inserted. To prevent this, paste the formula results as static values after generating them.

More on Data cleaning & shaping

See all →

Formulas used

Related tasks

Written and reviewed by FormulaCraft Team. Each formula on this page is run through our verification engine before publishing.

Last reviewed: