For medium-sized service providers, an automated billing system in Excel can reduce errors, save time, and improve cash flow by tracking invoices efficiently. Using formulas, macros, and VBA, businesses can generate invoices, track payments, and send reminders automatically.
Step 1: Setting Up the Invoice Template
Create an Excel invoice template with the following fields:
Invoice No. | Client Name | Service | Hours Worked | Rate | Total | Status | Due Date |
---|---|---|---|---|---|---|---|
INV-001 | ABC Ltd. | Consulting | 10 | $100 | $1,000 | Unpaid | 02/28/2025 |
INV-002 | XYZ Inc. | IT Support | 5 | $80 | $400 | Paid | 02/25/2025 |
Step 2: Automating Invoice Calculations with Excel Formulas
1. Calculate the Total Amount
Use the following formula in the Total column:
=E2*D2
- E2 (Rate) × D2 (Hours Worked) = Total Amount
2. Set Payment Status Automatically
Use this formula to update the Status column:
=IF(TODAY()>H2, "Overdue", IF(G2="Paid", "Paid", "Unpaid"))
- If the due date has passed and the invoice is unpaid → Mark as Overdue.
- If marked as Paid, it remains unchanged.
- Otherwise, the invoice remains Unpaid.
Step 3: Generating Invoices Automatically with VBA
1. Open VBA Editor (ALT + F11) → Insert Module
2. Add this script
Sub GenerateInvoice()
Dim ws As Worksheet
Dim lastRow As Integer
Dim i As Integer
Dim invoiceNo As String
Dim client As String
Dim amount As Double
Dim dueDate As String
Dim invoiceText As String
Set ws = ThisWorkbook.Sheets("Invoices")
lastRow = ws.Cells(Rows.Count, 1).End(xlUp).Row
For i = 2 To lastRow
If ws.Cells(i, 7).Value = "Unpaid" Then
invoiceNo = ws.Cells(i, 1).Value
client = ws.Cells(i, 2).Value
amount = ws.Cells(i, 6).Value
dueDate = ws.Cells(i, 8).Value
invoiceText = "Invoice No: " & invoiceNo & vbCrLf & _
"Client: " & client & vbCrLf & _
"Total Amount: $" & amount & vbCrLf & _
"Due Date: " & dueDate & vbCrLf & _
"Status: Unpaid"
MsgBox invoiceText, vbInformation, "Invoice Details"
End If
Next i
End Sub
How It Works
- Loops through unpaid invoices and displays the invoice details.
- Can be extended to generate a PDF or send invoices via email.
Step 4: Automating Payment Reminders via Email
To send automated reminders for overdue invoices, use this VBA macro:
Sub SendPaymentReminder()
Dim OutlookApp As Object
Dim MailItem As Object
Dim ws As Worksheet
Dim lastRow As Integer
Dim i As Integer
Dim clientEmail As String
Dim clientName As String
Dim amountDue As Double
Dim dueDate As String
Dim emailBody As String
Set OutlookApp = CreateObject("Outlook.Application")
Set ws = ThisWorkbook.Sheets("Invoices")
lastRow = ws.Cells(Rows.Count, 1).End(xlUp).Row
For i = 2 To lastRow
If ws.Cells(i, 7).Value = "Overdue" Then
clientEmail = ws.Cells(i, 9).Value ' Assuming email is in column I
clientName = ws.Cells(i, 2).Value
amountDue = ws.Cells(i, 6).Value
dueDate = ws.Cells(i, 8).Value
Set MailItem = OutlookApp.CreateItem(0)
MailItem.To = clientEmail
MailItem.Subject = "Payment Reminder - Invoice Overdue"
emailBody = "Dear " & clientName & "," & vbCrLf & vbCrLf & _
"This is a friendly reminder that your invoice of $" & amountDue & _
" was due on " & dueDate & ". Please make the payment at your earliest convenience." & vbCrLf & vbCrLf & _
"Thank you." & vbCrLf & "Best Regards," & vbCrLf & "Your Company"
MailItem.Body = emailBody
MailItem.Send
End If
Next i
MsgBox "Payment reminders sent!", vbInformation
End Sub
How It Works
- Checks for overdue invoices and sends email reminders via Outlook.
- Uses the client’s email from column I.
- Can be modified to attach PDFs or use an email template.
Step 5: Tracking Payments and Cash Flow
Use SUMIFS to calculate total unpaid invoices:
=SUMIFS(F:F, G:G, "Unpaid")
- F:F (Total Amount)
- G:G (Status) = Unpaid
Use Conditional Formatting to highlight overdue invoices:
- Select the Status column.
- Click Conditional Formatting → New Rule.
- Use the formula:
=G2="Overdue"
- Set the formatting to red text.
Step 6: Automating Invoice Number Generation
Use this formula in the Invoice No. column:
="INV-" & TEXT(ROW(A2)-1, "000")
- Generates invoice numbers automatically (INV-001, INV-002, etc.).
Key Benefits of Automating Billing & Invoicing in Excel
✅ Eliminates Manual Errors – Automates calculations and due date tracking.
✅ Saves Time – Generates invoices and sends reminders instantly.
✅ Improves Cash Flow – Ensures timely payments with automated follow-ups.
✅ Scalability – Works for any service-based business, from consulting firms to IT support.
By using Excel formulas, VBA, and automation, medium-sized service providers can streamline invoicing, reduce manual work, and get paid faster.

Lillqvist Strat consults on business developement, software projects, automation, SOPs, analytical tools and more.
Contact me today to get started on our journey to higher profits, more revenue and happier employees!
Go to Contact now