Auto-Incrementing Invoice Number in Excel
Last updated: 27 June 2026
Every GST invoice you raise must carry a unique, consecutive invoice number within the financial year for that GSTIN — and Excel can generate and increment that number automatically. A one-time config-sheet setup with a TEXT formula produces a clean, Rule 46-compliant series like ANK/2026-27/001 with zero manual typing.
Key takeaways
- Rule 46 of the CGST Rules requires invoice numbers to be consecutive, unique within a financial year, and tied to a specific GSTIN.
- GST permits alphanumeric invoice numbers up to 16 characters; the special characters
/,-, and_are allowed. - A three-cell config sheet (prefix, financial year, sequence counter) plus one TEXT formula is all you need in Excel.
- Never delete or reuse an invoice number — cancelled invoices need a credit note, and the original number stays in your register.
- Reset the sequence counter to 1 and update the financial year cell every 1 April.
- Multi-branch or multi-GSTIN businesses should use a unique prefix per registration so series never overlap.
- A VBA macro button can increment the counter with one click after each invoice is saved.
What does GST law say about invoice number format?
Rule 46 of the Central Goods and Services Tax (CGST) Rules, 2017 lays down the mandatory particulars for a tax invoice. On invoice numbering it specifies:
- The number must be consecutive and unique within a financial year.
- It must be linked to the GSTIN of the supplier — a business with two GSTINs must maintain two separate series.
- The format may be alphanumeric, up to 16 characters, and may include the special characters
/,-, and_. - Numbers must not contain spaces.
Fact box. Rule 46 does not mandate a specific prefix or pattern —
INV0001is as valid asANK/2026-27/001. What matters is that the sequence is unbroken, unique per GSTIN, and resets each financial year.
There is no GST rule that requires you to encode the date or financial year in the invoice number. Doing so is purely a best practice that makes filing and audits easier.
What format should I use for my invoice numbers?
The most widely used pattern among Indian SMBs is:
PREFIX / FINANCIAL-YEAR / SEQUENCE
| Part | Example | Notes |
|---|---|---|
| Prefix | ANK |
Your business abbreviation or branch code |
| Financial year | 2026-27 |
Matches the GST financial year (April–March) |
| Sequence | 001 |
Zero-padded 3-digit counter |
| Full number | ANK/2026-27/001 |
15 characters — within the 16-char limit |
A zero-padded sequence (001, 002 … 999) sorts correctly in spreadsheets and portals and signals that gaps — if any — are obvious.
Multi-branch or multi-GSTIN setup: use a different prefix per registration. A Mumbai branch might run MUM/2026-27/001 and a Delhi branch DEL/2026-27/001. This keeps both series entirely separate at the GSTIN level, as required by Rule 46.
How do I set up auto-incrementing invoice numbers in Excel?
Step 1 — Create a Config sheet
Add a new sheet named Config. Set up three cells:
| Cell | Label (Column A) | Value (Column B) |
|---|---|---|
| A1 / B1 | Prefix | ANK |
| A2 / B2 | Financial Year | 2026-27 |
| A3 / B3 | Next Number | 1 |
Config!B3 is your live counter. Everything else derives from it.
Step 2 — Add the invoice number formula to your Invoice sheet
On your Invoice sheet, in the cell where the invoice number appears, enter:
=Config!$B$1&"/"&Config!$B$2&"/"&TEXT(Config!$B$3,"000")
This concatenates the prefix, financial year, and a zero-padded 3-digit sequence. When Config!B3 is 1, the result is ANK/2026-27/001. When it is 47, the result is ANK/2026-27/047.
Why TEXT with "000"? The TEXT function forces the number to display as at least three digits with leading zeros. If you expect more than 999 invoices in a year, change the format string to "0000".
Step 3 — Increment the counter after each invoice
After you save or print a PDF of each invoice, increment Config!B3 by 1. You can do this manually or with a macro button.
VBA macro (recommended): open the Visual Basic Editor (Alt + F11), insert a new module, and paste:
Sub NextInvoice()
Dim ws As Worksheet
Set ws = ThisWorkbook.Sheets("Config")
ws.Range("B3").Value = ws.Range("B3").Value + 1
End Sub
Return to your Invoice sheet, insert a Form Control button (Developer → Insert → Button), and assign the NextInvoice macro to it. One click after saving each PDF advances the counter.
Fact box. Save your workbook as
.xlsm(macro-enabled) if you use VBA. A standard.xlsxfile will silently drop your macro on save.
Step 4 — Financial year reset (every 1 April)
On the first working day of April each year:
- Update
Config!B2from2026-27to2027-28. - Reset
Config!B3to1.
The first invoice of the new year will automatically read ANK/2027-28/001.
How do I track cancelled invoice numbers?
You must never reuse an invoice number. If you cancel an invoice:
- Leave the original number in your Invoice Register with status
Cancelled. - Issue a credit note referencing the original invoice number.
- Do not issue a new invoice carrying the old number.
Gaps in your sequence (e.g., jumping from 023 to 025) can attract scrutiny during GSTR-1 filing. If you do have a legitimate gap — a cancelled invoice — the credit note reference in your register is your audit trail.
Invoice Register sheet structure
Maintain a separate sheet named Invoice Register formatted as an Excel Table (select the range → Format as Table). Suggested columns:
| Column | Purpose |
|---|---|
| Invoice No | The generated number |
| Date | Invoice date |
| Buyer GSTIN | Buyer's GST registration number |
| Buyer Name | Trade name |
| Taxable Value | Pre-GST amount |
| Total GST | CGST + SGST or IGST |
| Invoice Total | Amount payable |
| Status | Issued or Cancelled |
| Credit Note No | Populated only if cancelled |
Using a formatted Table means new rows auto-expand formatting and the table can be filtered and sorted without breaking formulas.
What happens if I skip an invoice number?
The GST portal and your tax officer may flag gaps in your invoice sequence during GSTR-1 filing scrutiny. A missing number with no corresponding credit note and no entry in your register is unexplained. Best practice: never skip. If an invoice is voided before being sent, still log it in the Invoice Register as Cancelled immediately — do not simply overwrite the cell.
How Ankeshan helps
How Ankeshan helps: Ankeshan pre-wires the Config sheet, auto-incrementing counter, Invoice Register, and multi-GSTIN series support inside Excel. It's launching soon; join the waitlist.
The free Excel invoice number template described in this article is available at the GST Invoicing hub — no sign-up required.
Frequently asked questions
Can I use letters and numbers in my GST invoice number?
Yes. Rule 46 allows alphanumeric characters and the special characters /, -, and _, up to a maximum of 16 characters. Spaces are not permitted. A format like ANK/2026-27/001 (15 characters) is fully compliant.
Do I have to restart my invoice number sequence every financial year? Yes. The CGST Rules require the series to be unique within a financial year for each GSTIN. You must reset the counter to 1 (or your chosen starting point) at the beginning of each financial year on 1 April.
What if I have two GSTINs for two branches?
Each GSTIN must carry its own independent invoice series. Use a distinct prefix per registration — for example, MUM/2026-27/001 for your Maharashtra GSTIN and DEL/2026-27/001 for your Delhi GSTIN — so there is no overlap between series.
Can I reuse an invoice number from a cancelled invoice? No. Once an invoice number is assigned, it cannot be reassigned even if the invoice is cancelled. Record the cancelled invoice in your Invoice Register, issue a credit note if the invoice had already been shared with the buyer, and move the counter to the next number.
Does e-invoicing change how I set up my invoice number? For taxpayers above the e-invoicing threshold (currently ₹5 crore aggregate annual turnover), the Invoice Reference Number (IRN) is generated by the Invoice Registration Portal (IRP) after you submit your invoice data — including your own invoice number. Your invoice number must still be unique within your GSTIN for the financial year before submission. The IRN is separate from your invoice number; both must appear on the final invoice document.
How many invoices can I number before the 16-character limit is a problem?
With the format ANK/2026-27/001, you use 15 characters. Switching to a 4-digit sequence (ANK/2026-27/0001) adds one character and takes you to 16 — exactly at the limit. A business raising up to 9,999 invoices per year per GSTIN fits within the limit with a 4-digit zero-padded counter. If your prefix is longer, shorten it or drop the financial year encoding and track the year in your register instead.
Sources
- Central Goods and Services Tax Rules, 2017 — Rule 46 (Tax Invoice), Ministry of Finance, Government of India
- CBIC Circular on e-invoicing applicability thresholds (latest circular applicable from 1 August 2023)
- GST Council FAQ on invoice numbering, GSTN Help Centre
Disclaimer: General information, not professional advice. Verify on the official portal for your case. Reviewed by a Chartered Accountant; last updated 27 June 2026.