The Excel formula =SEQUENCE(n,1,1,1) produces a column of n auto-incrementing integers starting at 1, and wrapping it in ="INV-"&TEXT(SEQUENCE(n),"000") turns those integers into formatted invoice numbers like INV-001, INV-002, and INV-003 without you typing a single one by hand. That single dynamic-array formula is the fastest native way to generate invoice numbers automatically in Excel, and it spills down a column the moment you press Enter in Microsoft 365, Excel 2021, or Excel for the web. Older releases that lack SEQUENCE can still auto-number with the ROW(), COUNTA(), and MAX()+IF patterns, each of which recalculates as you insert or remove rows so the sequence stays continuous. The section below walks through each Excel method with exact formulas, then shows a browser workflow that produces a print-ready PDF in roughly a minute for one-off jobs, late-night invoices, and freelancers who simply do not want to maintain a workbook.

Why Auto-Generated Invoice Numbers Matter
An invoice number is the unique identifier that links a bill to your accounting ledger, your client's accounts payable, and any later dispute or audit. Hand-typed numbers drift: a typo creates a duplicate, a deleted row leaves a gap, and a copy-paste mistake ships two invoices under the same ID. Automated numbering removes all three failure modes at once because Excel rebuilds the sequence from the formulas whenever the sheet changes, and the result is a clean, contiguous, gap-free range that downstream tools can sort, filter, and total against. Sequential invoice IDs also make it obvious when a record has gone missing, which is exactly the signal a bookkeeper needs to spot a cancelled sale or an unpaid balance.
Excel Formulas That Auto-Generate Invoice Numbers
Every method below produces a live invoice-number column. Choose the one that matches your Excel version and the shape of your data.
| Method | Excel version | Formula | Behavior |
|---|---|---|---|
| SEQUENCE + TEXT | Microsoft 365, Excel 2021, Excel for the web | ="INV-"&TEXT(SEQUENCE(50,1,1,1),"000") | Spills a 50-row column from a single cell; resizes when the count changes. |
| ROW() | Any version | ="INV-"&TEXT(ROW(A1),"000") | Auto-increments per row as the formula is dragged or copied down. |
| COUNTA() | Any version | ="INV-"&TEXT(COUNTA($B$2:B2),"000") | Counts filled rows above so the number always matches visible line items. |
| MAX() + IF | Any version (array entry) | ="INV-"&TEXT(MAX($A$1:A1)+1,"000") | Reads the previous maximum and adds one, so gaps from deleted rows do not break the sequence. |
Step-by-step: build an auto-numbered column with SEQUENCE
- Open the workbook where you track invoices and pick the first empty column, for example column A starting at row 2.
- Type the header Invoice # in cell A1 so the dynamic array stays sorted against a label.
- In cell A2, enter ="INV-"&TEXT(SEQUENCE(50,1,1,1),"000") and press Enter. Excel spills the array from A2 to A51 with values INV-001 through INV-050.
- If you need a different prefix, change the literal string inside the formula, for example "2026-" for year-prefixed numbers or your business initials.
- To extend the range later, edit cell A2 and raise the first argument of SEQUENCE from 50 to a larger count; the array resizes on Enter.
- Format the column as Text afterwards (Home > Number > Text) so a leading zero is never dropped if you copy the values to another sheet.
Step-by-step: auto-number on older Excel builds with ROW
- Put the header Invoice # in cell A1.
- In cell A2, enter ="INV-"&TEXT(ROW(A1),"000"). ROW(A1) returns 1, so A2 reads INV-001.
- Select A2, grab the fill handle (the small square at the bottom-right corner), and drag down to however many rows you expect to bill this month.
- To renumber starting at a specific value, replace ROW(A1) with ROW(A1)+99 so the first invoice reads INV-100.
- Confirm the column is formatted as Text so 001 stays 001 instead of being coerced into the integer 1.
Step-by-step: keep numbers gap-free after deletions
- Replace the simple formula in column A with =IF(B2="","","INV-"&TEXT(MAX($A$1:A1)+1,"000")), entered as an array (Ctrl+Shift+Enter on legacy Excel).
- Column B holds the client or description; the formula only emits a number when column B is non-empty.
- Delete any row in column B and the numbers above stay fixed while every later row recalculates to close the gap.
- Press F9 to force a full recalculation if the array does not refresh automatically after a large paste.
Skip the Spreadsheet: Generate the Invoice in Your Browser
Excel is great for tracking, but when the invoice has to leave your screen as a finished PDF, the free Invoice Generator in your browser builds the whole document in one pass. The math it runs is straightforward: a unit price of $50 multiplied by a quantity of 2 gives a $100 subtotal, a 10% tax adds $10 to that, and the final total lands on exactly $110. Fill in your business details under From and your client's under Bill To, set the invoice number (it defaults to INV-001), pick the issue and due dates with the date pickers, and choose a currency symbol. Add a line item for each product or service with its description, quantity, and unit price; click Add item for more rows or the remove button to drop one. Type a tax rate and an optional flat discount, and the live preview updates the subtotal, tax, discount, and total instantly. When everything looks right, click Download PDF to save a clean, print-ready invoice generated locally in your browser that is never uploaded anywhere.
Step-by-step: send a print-ready PDF in under a minute
- Open the Invoice Generator in any modern browser; no account, no sign-up, and no install are required.
- Fill in your business details under From and your client's name and address under Bill To.
- Set the invoice number (it defaults to INV-001), pick the Issue date and Due date, and choose a currency symbol.
- For each product or service, type a description, a quantity (whole numbers or decimals such as 1.5 hours both work), and a unit price; press Add item for more rows.
- Enter the tax rate as a percentage and, if you want one, a flat discount in your chosen currency; watch the subtotal, tax, and total update live on the right.
- Click Download PDF; the file is generated locally in the browser and saved straight to your downloads folder.
When to Stay in Excel vs. Switch to a Browser Invoice Maker
Use Excel when the invoice number is one column in a much larger workbook, when you need pivot tables or lookups against historical sales, or when your accountant expects the raw .xlsx file. Use a browser invoice maker when you are sending a single bill and do not want to open a spreadsheet, when the client expects a PDF attachment rather than an .xlsx, or when privacy matters: the Invoice Generator runs every calculation and renders the final PDF locally in JavaScript, so nothing is uploaded, the PDF carries no watermark, and the tool also works offline once the page has loaded. If you still want Excel's tracking power after the PDF goes out, paste the line items from the PDF into a column in your workbook and reuse the same SEQUENCE formula above for the next batch.
Keeping Invoice Numbers Unique and Audit-Ready
Three habits keep an auto-numbered column clean across months and years. First, prefix every number with the year, for example 2026-001, so an audit trail never crosses a calendar boundary by accident. Second, format the column as Text so leading zeros stay put when the sheet is sorted, exported, or imported into another program. Third, back up the workbook after every billing run and avoid hard-deleting rows from the middle of the sequence: a MAX()+IF formula will renumber the rest of the column and create a gap-free record, but a hard delete before the formula recalculates can break the contract.
For one-off invoices, though, the faster path is to skip the spreadsheet entirely. The Invoice Generator produces a watermark-free PDF in your browser with line items, tax, and an optional discount, with all of the math done in integer cents so the totals always add up exactly. Bookmark the page if you bill regularly, and revisit the Excel formulas above only when the audit trail lives in a workbook.