Auto-number invoices (INV-0001, INV-0002) with a formula
Generate invoice numbers that count up as you fill in rows, with leading zeros.
The problem
Typing invoice numbers by hand leads to gaps and repeats.
Formula
In A2, fill down. It counts the filled cells in column N:
="INV-"&TEXT(COUNTA(N$2:N2),"0000")
Result for the first filled row: INV-0001, then INV-0002.
Excel vs Sheets
Same formula. TEXT format codes can depend on your language and regional settings, so check the result.
Tested on sample data by the Cellwise checker (log CW-PL-20261018-42). AI-made: the text, voice and visuals are generated by AI.
Checked before publishing: a check.