How to Create an Invoice Generator in Excel (Formulas)
How to create an invoice generator in Excel: paste-ready XLOOKUP formulas, auto invoice numbers, tax, due dates, a PDF macro and a worked example to check.
How to create an invoice generator in Excel: set up three sheets (a Clients table, an Items price list, and an Invoice form), then let formulas do the work. XLOOKUP pulls the client's details and each item's price, a MAX formula over an invoice log gives the next invoice number, and the subtotal, tax and due date calculate themselves. Below is the full build with formulas you can paste, a worked example with expected results to check against, and a short macro that saves each invoice as a PDF named by its number.
What does an Excel invoice generator need?
An Excel invoice generator needs four sheets: Clients, Items, Invoice and Log. You type each client and product once, pick them from dropdowns on the invoice, and every number on the page is a formula. Most templates in search results are a single sheet where you retype everything; splitting the data out is what turns a template into a generator.
| Sheet | What it holds | Format as |
|---|---|---|
| Clients | Client, Email, Address, TermsDays | Table named Clients |
| Items | Item, Price, Taxable (Y/N) | Table named Items |
| Invoice | The printable form: header, 10 line rows, totals | Normal cells, print area set |
| Log | InvoiceNo, Date, Client, Total, DueDate, Paid | Table named Log |
To make each table, click inside the data, press Ctrl+T, tick "My table has headers", then rename it under Table Design > Table Name. Tables matter because they grow when you add a row, so every formula and dropdown that points at Clients[Client] picks up new clients without editing.
Which Excel version do you need?
You need Excel 2021, Excel 2024 or Microsoft 365 for XLOOKUP. Microsoft's XLOOKUP function page says plainly that it is not available in Excel 2016 or 2019, and its alphabetical function list marks it as a 2021 function. If you are on an older version, every lookup below has an INDEX/MATCH version that does the same job.
Excel for the web is fine for the formulas. Microsoft's function list flags only a handful of functions (CELL, INFO, WEBSERVICE and two others) as unavailable in the browser, and XLOOKUP is not one of them. The PDF macro is different: Microsoft says you can't create, run or edit VBA macros in Excel for the web, so that step needs desktop Excel. Checked November 2026.
Step 1: Set up the Clients and Items sheets
The Clients and Items sheets are plain lists, one row per client or product, with no formulas. Here is the sample data used in the worked example later, so you can type it in and compare your results with ours.
| Client | Address | TermsDays | |
|---|---|---|---|
| Brightside Dental | accounts@brightside.example | 210 Elm St, Austin TX | 30 |
| Oak & Pine Cafe | hello@oakpine.example | 14 Main St, Round Rock TX | 14 |
| Harbor Yoga Studio | studio@harbor.example | 88 Bay Ave, Austin TX | 7 |
| Item | Price | Taxable |
|---|---|---|
| Website maintenance (hour) | 85.00 | Y |
| Hosting (month) | 24.99 | Y |
| Photo editing (image) | 12.50 | Y |
| Logo design | 450.00 | Y |
Keep names unique and watch for trailing spaces. "Hosting (month) " with a space at the end will not match "Hosting (month)", and that is the most common cause of a #N/A on the invoice.
Step 2: Add dropdowns for client and item
Dropdowns stop typos, which stops lookup errors. Microsoft's drop-down list guide uses Data > Data Validation > Allow: List, and notes that a list based on a table updates itself when you add or remove rows.
The reliable way to point a dropdown at a table column is a named range:
- Go to Formulas > Name Manager > New. Name it
ClientListand set Refers to:=Clients[Client]. - Make a second name,
ItemList, referring to=Items[Item]. - Select the client cell on the Invoice sheet (B4 in this layout), open Data Validation, choose List, and type
=ClientListas the Source. - Select the ten item cells (A11:A20) and do the same with
=ItemList.
Step 3: Build the Invoice form
The Invoice sheet has a small header block, ten line rows and a totals block. Use this layout so the formulas below work as written. Cells marked Input are the only ones you type in; everything else is a formula.
| Cell | Label | Formula or input |
|---|---|---|
| B2 | Invoice No. | =MAX(Log[InvoiceNo],1000)+1 |
| B3 | Invoice date | Input (press Ctrl+; for today's date) |
| B4 | Client | Input (dropdown) |
| B5 | =XLOOKUP(B4,Clients[Client],Clients[Email],"") | |
| B6 | Address | =XLOOKUP(B4,Clients[Client],Clients[Address],"") |
| B7 | Terms (days) | =XLOOKUP(B4,Clients[Client],Clients[TermsDays],30) |
| B8 | Due date | =IF(B4="","",B3+B7) |
| A11:A20 | Item | Input (dropdown) |
| B11:B20 | Qty | Input |
| C11 | Unit price | =IF(A11="","",XLOOKUP(A11,Items[Item],Items[Price],0)) |
| D11 | Amount | =IF(A11="","",ROUND(B11*C11,2)) |
| E11 | Taxable | =IF(A11="","",XLOOKUP(A11,Items[Item],Items[Taxable],"Y")) |
| D22 | Subtotal | =SUM(D11:D20) |
| C23 | Tax rate | Input, e.g. 8.25% |
| D23 | Tax | =ROUND(SUMIFS(D11:D20,E11:E20,"Y")*C23,2) |
| D24 | Total due | =D22+D23 |
Copy C11, D11 and E11 down to row 20. The IF(A11="","",…) wrapper keeps empty rows blank instead of showing zeros, and SUM and SUMIFS skip those blank text values, so the totals still add up.
A few details are worth getting right:
- Invoice number.
=MAX(Log[InvoiceNo],1000)+1returns 1001 when the log is empty and one more than the highest logged number after that. To show it as INV-1048, give B2 the custom number format"INV-"0. The cell still holds a plain number, which keeps the MAX working. - Static date. Don't use
=TODAY()in B3. It recalculates every time the file opens, so an old invoice would show today's date and a new due date. - Due date. Excel stores dates as day counts, so
B3+B7is just "invoice date plus 30 days". Format B8 as a date or it shows a five-digit number. - Tax column. Column E can be hidden, or kept outside the print area. It lets you mix taxable and non-taxable items; if everything you sell is taxable, use
=ROUND(D22*C23,2)instead.
INDEX/MATCH versions for Excel 2019 and older
If XLOOKUP shows #NAME?, your Excel doesn't have it. These do the same lookups with functions that work in every desktop version (see Microsoft's guide to looking up values with INDEX and MATCH):
- Email:
=IFERROR(INDEX(Clients[Email],MATCH(B4,Clients[Client],0)),"") - Terms:
=IFERROR(INDEX(Clients[TermsDays],MATCH(B4,Clients[Client],0)),30) - Unit price:
=IF(A11="","",IFERROR(INDEX(Items[Price],MATCH(A11,Items[Item],0)),0))
The 0 at the end of MATCH means exact match. Leave it out and MATCH guesses on unsorted data, which can quietly return the wrong price.
Worked example: does your build give these numbers?
Here is a test invoice for Brightside Dental dated November 13, 2026, with 8.25% sales tax and the last logged invoice at 1047. If your sheet shows the same results, the formulas are wired correctly.
| Item (A) | Qty (B) | Unit price (C) | Amount (D) |
|---|---|---|---|
| Website maintenance (hour) | 6 | 85.00 | 510.00 |
| Hosting (month) | 3 | 24.99 | 74.97 |
| Photo editing (image) | 14 | 12.50 | 175.00 |
| Cell | Expected result | How it's worked out |
|---|---|---|
| B2 Invoice No. | INV-1048 | MAX of log (1047) + 1 |
| B5 Email | accounts@brightside.example | XLOOKUP on Clients |
| B7 Terms | 30 | XLOOKUP on Clients |
| B8 Due date | December 13, 2026 | Nov 13 + 30 days |
| D22 Subtotal | 759.97 | 510.00 + 74.97 + 175.00 |
| D23 Tax | 62.70 | 759.97 × 0.0825 = 62.697525, rounded |
| D24 Total due | 822.67 | 759.97 + 62.70 |
The 8.25% is only an example. Use the rate that applies to you. GST and VAT work the same way: put 10% (Australian GST) or 20% (UK standard VAT) in C23 and relabel the row. With 10% the same invoice would show tax of 76.00 and a total of 835.97.
Switch the client to Harbor Yoga Studio and B8 should jump to November 20, 2026, because their terms are 7 days. If it doesn't, check that B7 is reading the TermsDays column and that B8 is formatted as a date.
Step 4: Keep an invoice log
The Log sheet is what makes numbering automatic and gives you a record of what you've billed. Each saved invoice adds one row: number, date, client, total, due date, and a Paid column you fill in yourself when the money arrives.
Add one more column to the Log table called Status with this formula, and Excel fills it down the whole table for you:
=IF([@Paid]<>"","Paid",IF(TODAY()>[@DueDate],"Overdue","Open"))
That gives you a basic overdue list. Filter Status to "Overdue" and you can see who to chase. It's still on you to notice and send the reminder, though, which is where a spreadsheet stops.
Order matters here. The invoice number on the form is live, so the moment you add the current invoice to the log, the form moves on to the next number. Always save the PDF first, then log it, then clear the form. The macro below does it in that order. If you'd rather not keep a log, an alternative is a single "last number used" cell on a Settings sheet that the macro bumps up by one each time, but you lose the history.
Step 5: Save each invoice as a PDF
To save an invoice as a PDF by hand, set a print area around the invoice (select A1:D25, then Page Layout > Print Area > Set Print Area), then go to File > Save As or Save a Copy, and pick PDF as the file type. Microsoft's save as PDF guide covers the Options button, which controls which pages are included.
To make it one click, save the workbook as an Excel Macro-Enabled Workbook (.xlsm), press Alt+F11, choose Insert > Module and paste this:
Sub SaveInvoiceAndReset()
Dim ws As Worksheet, lo As ListObject, r As ListRow
Dim invNo As Long, f As String
Set ws = ThisWorkbook.Worksheets("Invoice")
Set lo = ThisWorkbook.Worksheets("Log").ListObjects("Log")
If ws.Range("B4").Value = "" Then
MsgBox "Pick a client first."
Exit Sub
End If
invNo = ws.Range("B2").Value
f = ThisWorkbook.Path & Application.PathSeparator & "INV-" & invNo & ".pdf"
' 1. Save the PDF (uses the print area)
ws.ExportAsFixedFormat Type:=xlTypePDF, Filename:=f, _
Quality:=xlQualityStandard, OpenAfterPublish:=False
' 2. Log it
Set r = lo.ListRows.Add
r.Range.Cells(1, 1).Value = invNo
r.Range.Cells(1, 2).Value = ws.Range("B3").Value
r.Range.Cells(1, 3).Value = ws.Range("B4").Value
r.Range.Cells(1, 4).Value = ws.Range("D24").Value
r.Range.Cells(1, 5).Value = ws.Range("B8").Value
' 3. Clear the inputs for the next invoice
ws.Range("B4").ClearContents
ws.Range("A11:B20").ClearContents
MsgBox "Saved " & f
End Sub
It reads the number before logging, exports the sheet with ExportAsFixedFormat into the same folder as the workbook, adds the row to the log, then clears the client and line items. The formulas stay untouched because only the input cells are cleared. To add a button, go to Insert > Shapes, draw one, right-click it and choose Assign Macro.
Two things to check. The workbook must be saved somewhere first, or ThisWorkbook.Path is empty. And the Log table's first five columns must be in the order shown in the table at the top (InvoiceNo, Date, Client, Total, DueDate), since the macro writes by position. This was written for Excel on Windows; Excel for Mac handles file permissions differently and may ask you to grant access to the folder.
Common errors and how to fix them
Most broken invoice generators fail in one of five ways, and each has a quick fix.
| What you see | Likely cause | Fix |
|---|---|---|
| #NAME? in lookups | Excel 2019 or older, no XLOOKUP | Use the INDEX/MATCH versions |
| #N/A or a 0 price | Name doesn't match exactly (often a trailing space) | Use the dropdown; run =TRIM() over the list |
| Due date shows a number like 46369 | Cell formatted as General | Format B8 as a date |
| Same invoice number twice | Logged before saving, or log row deleted | Never delete log rows; void them instead |
| Total stops updating | Someone typed over a formula | Lock formula cells and protect the sheet |
To protect the formulas, select the input cells (B3, B4, A11:B20 and C23), open Format Cells > Protection and untick Locked, then use Review > Protect Sheet. Inputs stay editable, formulas don't, and the macro can still clear the input cells.
What an Excel invoice generator can't do
An Excel invoice generator creates and numbers invoices well, but it doesn't send them, chase them or know when they're paid. Those jobs stay manual, and they're the ones that cost you money when they slip.
- No sending. You attach each PDF to an email yourself.
- No payment tracking. The Paid column is only as current as the last time you updated it.
- No reminders. The Status column shows "Overdue"; it doesn't email anyone.
- Version clutter. Copies like "invoice FINAL v2.xlsx" on two computers mean two logs and duplicate numbers. Keep one master file.
- Fragile formulas. One overwritten cell can make every later total wrong, and nothing warns you.
- Macros are limited. The PDF button won't run in Excel for the web.
If you'd rather not build any of this, the free InvoiceSonic invoice generator does the numbering, tax and totals in a browser and downloads a PDF without sign-up (free PDFs carry a small "Created with Invoice Sonic" footer). InvoiceSonic Pro adds recurring invoices and automatic reminders at 7, 14 and 30 days overdue. You can add your own payment link or bank details as a pay-now option; InvoiceSonic doesn't process the payment and takes 0% of it, because it goes straight to your account. Already keep your books in a spreadsheet? The InvoiceSonic to Excel guide shows how to export invoice data into Excel for a P&L.
When is a web invoice generator quicker than Excel?
A web generator is quicker when you send fewer than a few invoices a month, need to invoice from your phone, or want reminders and emailing handled for you. Excel wins when you want full control of the layout, already live in spreadsheets, or need custom calculations such as job costing next to the invoice.
The build above takes most people an hour or two the first time. If that's more than you need, making an invoice without Word or Excel takes a few minutes, and our comparison of the best free invoice generators lists the real limits of each tool. If you work in Google Sheets instead, the same logic carries over; see the Google Sheets invoice templates guide. And if you only need a clean numbering scheme, the invoice number generator builds a sequential list like INV-2026-0001 you can paste into any tool.
Frequently asked questions
Can Excel automatically generate invoice numbers?
Yes. Keep a log table of past invoices and use =MAX(Log[InvoiceNo],1000)+1 on the invoice. It returns the next number in sequence, starting at 1001, and updates as soon as you log each invoice.
Does XLOOKUP work in my version of Excel?
XLOOKUP works in Excel 2021, Excel 2024, Microsoft 365 and Excel for the web. Microsoft says it is not available in Excel 2016 or 2019; use INDEX with MATCH(…,0) there instead.
How do I make Excel save each invoice as a separate PDF?
Set a print area, then use File > Save As and choose PDF. For one click, use a short VBA macro with ExportAsFixedFormat that names the file by invoice number, as shown above. Macros need desktop Excel and a .xlsm file.
How do I add sales tax, GST or VAT to an Excel invoice?
Put the rate in its own cell (for example 8.25%, 10% or 20%) and calculate tax as =ROUND(Subtotal*Rate,2). Rounding the tax line to cents stops the total being a cent off from what your client calculates.
Can an Excel invoice track payments and send reminders?
Only partly. A Paid column and a Status formula can flag overdue invoices, but Excel won't email the invoice, notice a payment or send a reminder. You do those steps yourself.
Is it better to use an Excel invoice template or an invoice generator app?
Use Excel if you want full control and already work in spreadsheets. Use a web generator if you want to send an invoice in a few minutes, from any device, with reminders handled for you.
Create your invoice in 60 seconds
Your first PDF is free. Fill in the invoice, download it, and send it to your client.
Create my invoice free →