Generating Bulk Invoices from a Spreadsheet
Creating invoices one at a time is tedious when you have dozens or hundreds of clients. With Mergram, you can take an Excel spreadsheet of invoice data, map it to a PDF template, and generate every invoice in a single operation — each one personalized with the correct client details, amounts, and invoice numbers.
Prerequisites
Before you start, make sure you have:
- An invoice PDF template — a designed invoice layout saved as PDF, with space for variable data
- An Excel or CSV file with your invoice data organized in columns and rows
- A Mergram account with credits for the number of invoices you need
Design your template first
Create your invoice template in any design tool — Canva, Adobe Illustrator, Word, or Google Docs — and export as PDF. Leave blank areas where variable data (client name, amounts, dates) will be placed. Mergram fills these areas with data from your spreadsheet.
Preparing Your Invoice Data
Organize your spreadsheet with one row per invoice. Here is a recommended column structure:
| InvoiceNumber | ClientName | ClientEmail | Address | Item1 | Amount1 | Subtotal | Tax | Total | DueDate |
|---|---|---|---|---|---|---|---|---|---|
| INV-001 | Acme Corp | billing@acme.com | 123 Main St, Springfield, IL | Consulting Services | $2,500.00 | $2,500.00 | $200.00 | $2,700.00 | 2025-02-28 |
| INV-002 | Globex Inc | pay@globex.com | 456 Oak Ave, Austin, TX 73301 | Annual License | $5,000.00 | $5,000.00 | $400.00 | $5,400.00 | 2025-02-28 |
| INV-003 | Initech | finance@initech.com | 789 Elm Blvd, Portland, OR | Support Package | $1,200.00 | $1,200.00 | $96.00 | $1,296.00 | 2025-03-15 |
Use Excel formulas for calculations
Let Excel handle the math. Use formulas like =SUM(Amount1:Amount5) for subtotals, =Subtotal*0.08 for tax, and =Subtotal+Tax for totals. Mergram reads the calculated values just like typed values.
Designing Your Invoice Template
Layout Structure
A typical invoice template has these sections:
| Template Section | Typical Fields | Position |
|---|---|---|
| Header | Company logo, “INVOICE” title | Top of page |
| Invoice details | Invoice number, date, due date | Top-right area |
| Bill to | Client name, address | Upper-left, below header |
| Line items | Description, quantity, rate, amount | Center of page |
| Totals | Subtotal, tax, total | Bottom-right of items |
| Footer | Payment terms, bank details, notes | Bottom of page |
Placing Fields on the Canvas
For each column in your spreadsheet, drag it onto the canvas in the corresponding position:
- Invoice number — Place in the top-right corner with bold formatting
- Client name and address — Place in the “Bill To” section
- Line items — Place item descriptions and amounts in the center table area
- Totals — Place subtotal, tax, and total fields at the bottom with larger font
- Due date — Place near the totals or in the header area
Adjust font sizes to match your template design — amounts should stand out, while labels remain subtle.
Custom Filename Templates
Use filename templates to organize your generated invoices:
| Filename Template | Example Output |
|---|---|
Invoice_[[InvoiceNumber]] | Invoice_INV-001.pdf |
Invoice_[[ClientName]]_[[DueDate]] | Invoice_Acme Corp_2025-02-28.pdf |
[[InvoiceNumber]]_[[Total]] | INV-001_$2,700.00.pdf |
Meaningful filenames make it easy to find specific invoices later, whether you store them locally or upload to a document management system.
Combined vs. Individual Output
Choose the output mode based on how you plan to distribute invoices:
| Output Mode | Best For | Result |
|---|---|---|
| Individual | Email campaigns, per-client delivery | One PDF per invoice, separate files |
| Combined | Batch printing, archiving | All invoices in a single multi-page PDF |
For email campaigns, use individual mode — each recipient gets their own invoice as an attachment. For internal archiving or bulk printing, combined mode is more convenient.
Sending Invoices via Email Campaigns
Combine bulk invoice generation with email delivery for a complete billing workflow:
- Set up SMTP — Configure your email provider in Settings → SMTP
- Design email template — Use merge fields like
[[ClientName]]and[[Total]]for personalization - Include payment terms — Add due date and payment instructions in the email body
- Run campaign — Each client receives their invoice as an attached PDF
Sample email template:
Subject: Invoice [[InvoiceNumber]] from Your Company
Hi [[ClientName]],
Please find your invoice [[InvoiceNumber]] attached. The amount of [[Total]] is due by [[DueDate]].
If you have any questions, please don't hesitate to reach out.
Best regards,
Your Billing Team
Password-protect financial documents
For invoices containing sensitive financial information, set a password template in the merge dialog. Use a pattern like [[ClientID]]-2025 so each client can derive their own password from information they already know.
Best Practices for Invoice Generation
- Use consistent invoice numbering — Ensure your spreadsheet has a unique
InvoiceNumberfor every row to avoid duplicates - Standardize date formats — Pick one format (e.g., YYYY-MM-DD) and use it consistently across all rows
- Validate totals — Double-check that amounts, subtotals, tax, and totals are correct before merging
- Test with 2–3 clients — Generate a small batch first to verify layout, formatting, and field placement
- Keep a master spreadsheet — Maintain one authoritative file for all invoices, adding new rows each billing cycle
- Archive after sending — Download generated invoices for your records after each billing run
Common Issues and Troubleshooting
Currency symbols not rendering correctly: Ensure your spreadsheet cells are formatted as text or use consistent currency formatting. If the PDF displays unexpected characters, try using plain numbers without currency symbols and add the symbol as static text on the template.
Line items overflowing the page: If you have invoices with many line items, the text may overlap with the totals section. Design your template with enough vertical space, or split long invoices into page breaks.
Client names with special characters: Names containing accents (e.g., “Cafe Rene”), ampersands, or parentheses are fully supported. Ensure your CSV file is saved with UTF-8 encoding if exporting from Excel.
Incorrect amounts after merge: Check that your spreadsheet columns contain the values you expect. Excel formulas should be calculated (copy and paste as values if needed). Leading zeros in amounts may be lost if the column format isn’t set to text.
Get Started
Upload your invoice template and client spreadsheet to the Mergram editor. Place your fields, preview with real data, and generate your entire batch of invoices in one click.