Duplicate invoice detection means finding the same vendor invoice twice in a batch before it is approved or paid twice; a duplicate row after PDF extraction is a different problem, where one line of a genuine invoice appears twice in your spreadsheet. Check documents first (vendor, invoice number, date, currency and amount), then rows inside each confirmed document (source page and line position), and flag every candidate for review instead of deleting it.
What is the difference between a duplicate invoice and a duplicate row?
A duplicate invoice is a document-level repeat: the same vendor (supplier) invoice reaches accounts payable (AP) twice, for example as an emailed PDF and later as a scan, or once as an original and once as a reminder copy. If both are entered, the business can pay the same amount twice. Preventing a duplicate payment also needs your payment records, which an invoice spreadsheet does not contain.
A duplicate row is a line-level repeat created during extraction or copying: a page imported twice, a table that continues on the next page and repeats its last line, or the same PDF loaded into the workbook in two sessions. The invoice itself is fine; the spreadsheet overstates it.
The two problems need different keys and different fixes. Removing a repeated document removes all of its lines. Removing a repeated row keeps the document and drops one representation of one line. A legitimate invoice can also bill the same article twice at the same quantity and price, so identical cells alone never prove a duplicate.
InvoiceLineLab extracts invoice line items from PDF to Excel or CSV and keeps the invoice number and PDF page beside each row. That puts the document key and the line evidence in one table, so a reviewer can sort, compare and flag candidates; the decision to exclude a document or a row stays with that reviewer.
Which fields identify a duplicate invoice in a batch?
Start with a document key that includes the vendor. Invoice numbers are scoped to the issuer: Peppol defines the invoice number (BT-1) as a unique identification of the invoice within the seller’s records, and the UK VAT guide (Notice 700, section 16.3.1) asks for a sequential number that uniquely identifies the document. Two vendors can both issue INV-42 without any duplication.
| Field | Why it belongs in the key | Typical trap |
|---|---|---|
| Vendor identifier | Scopes the invoice number | Same vendor under two spellings |
| Invoice number | The vendor’s identifier for the document | INV-42, INV42 and INV-042 in different files |
| Document type | Separates an invoice from a credit note (credit memo) | A credit note that references the same number |
| Invoice date | Separates a reissued number or a new period | Day and month swapped during import |
| Currency and total | Confirms the content | Same total on two different invoices |
Treat an exact match on vendor + number + type as a strong candidate. Treat a match on vendor + date + total with a different number as a weaker candidate: it can be a duplicate typed with a variant number, or a genuine second order. Normalize a comparison copy of the number (remove spaces, hyphens and leading zeros) to catch variants, but keep the printed value untouched in its own column. These candidates feed the same invoice data validation on extracted rows that checks quantity, price and source page.
How do duplicate rows appear after PDF extraction?
Row-level repeats usually come from the extraction boundary rather than from the vendor:
- Page overlap: the last line of page 1 is repeated at the top of page 2, or a page is imported twice.
- Repeated session: the same PDF is appended to the workbook again under another file name.
- Split descriptions: a description on two text rows is read as two items, the second without an amount or with a copied one.
- Carried subtotals: a “carried forward” amount on the next page is read as a line.
The row key is the document key plus the printed line identifier, when there is one. Peppol makes the invoice line identifier (BT-126) unique within its invoice, not across a batch. On a PDF without line numbers, use the page and the item’s order on that page, and keep the PDF page behind each extracted row so the reviewer can open the evidence.
Worked example: one batch, three kinds of repeats
This batch is synthetic. Vendors S and T are fictional, and all amounts are in US dollars, before tax.
| File | Vendor | Invoice | Date | Rows extracted | Extracted net |
|---|---|---|---|---|---|
| s-inv42.pdf | S | INV-42 | 2026-11-02 | 2 | $72.00 |
| scan_0193.pdf | S | INV-42 | 2026-11-02 | 2 | $72.00 |
| t-inv42.pdf | T | INV-42 | 2026-11-05 | 1 | $72.00 |
| s-inv57.pdf | S | INV-57 | 2026-11-09 | 4 | $123.00 |
| Raw batch | 9 | $339.00 |
Line detail:
- INV-42 from S has positions 10 and 20, each 3 packs × $12.00 = $36.00. Net $72.00. Both lines are real purchases.
- scan_0193.pdf is the same INV-42 from S, with the same date, lines and total. After opening both files, the reviewer confirms a repeated document.
- INV-42 from T shares the number and the $72.00 total, but the vendor differs. It is a different invoice.
- INV-57 from S has positions 10 ($18.00), 20 ($40.00) and 30 ($25.00), so its printed net is $83.00. Page 2 of the extraction repeats position 20, giving four rows and $123.00.
After review, exclude the two rows of scan_0193.pdf ($72.00) and the repeated position 20 of INV-57 ($40.00):
- Rows: 9 − 2 − 1 = 6.
- Net: $339.00 − $72.00 − $40.00 = $227.00.
- Cross-check by invoice: $72.00 (S, INV-42) + $72.00 (T, INV-42) + $83.00 (S, INV-57) = $227.00.
Two shortcuts would give a wrong answer. A rule on “invoice number + amount” also flags T’s INV-42: after the two confirmed exclusions, it leaves $155.00 and hides a real $72.00 purchase. A rule on “description + quantity + price” drops one of the two $36.00 positions of INV-42 and loses another real purchase.
How do you flag candidates without deleting evidence?
Keep the raw extraction untouched and work in a review copy:
- Add a candidate group column that gives the same identifier to rows or documents that may be repeats.
- Add a status column with three values: possible repeat, confirmed repeat, not a repeat.
- For each confirmed repeat, record the retained source (file and page), the excluded rows and the reason (repeated document, page overlap, repeated session).
- Exclude confirmed repeats from the analytical copy only, with a filter or an “included” flag, not by deleting rows.
- Leave an ambiguous pair in place, mark the result provisional and ask the vendor or the approver.
If two files share vendor and number but disagree on quantities or amounts, treat them as a version conflict, not a duplicate. Do not keep whichever copy happened to load first. A credit note that references an invoice is a separate document, even when its lines mirror the invoice.
Why does a spreadsheet “remove duplicates” command lose real purchases?
A spreadsheet command compares only the columns you select and then deletes the whole row. Select description and price, and the second of two legitimate identical positions disappears with its page reference. Add the file name to the comparison, and two differently named imports of the same invoice are never compared at all. Filtering unique values for display is safer than deleting, but it still hides the reason a row was dropped.
Choose the comparison fields for the level you are checking: the document key for duplicate invoices, the document key plus line identifier or page position for duplicate rows. Then use a status column, not deletion.
Which controls prove the cleaned batch is complete?
- Counts: raw rows − excluded rows = analytical rows, by file and by invoice.
- Totals by invoice and currency: each document’s extracted net should match its printed net after exclusions; a batch-level total can hide one wrong removal and one missed repeat that cancel each other.
- Exclusion log: every excluded row points to a retained counterpart and a reason, so the decision can be reversed without rebuilding the import.
- Bridge to the amount due: once lines are clean, reconcile the line totals with the amount payable before anyone approves payment.
For a small batch, a manual register with before and after counts is enough. An automated deletion rule is not required, and it should never run without the review status above.
What this check cannot prove
A clean spreadsheet shows that each document and line appears once in your extraction. It does not show that an invoice was not already paid from another channel, that a vendor did not issue two invoices for one delivery, or that a reissued invoice replaces an earlier one. Those questions need payment history, purchase orders and goods receipts. Matching totals or matching file names are never enough on their own.
FAQ
What fields are used for duplicate invoice detection?
Vendor, invoice number and document type form the core key; invoice date, currency and total confirm it. Compare a normalized copy of the invoice number to catch variants such as INV-042 and INV42, and keep the printed number unchanged.
Can two vendors use the same invoice number?
Yes. An invoice number identifies a document within its issuer’s records, so INV-42 from two vendors is two invoices. Always include the vendor in the key.
Should I use the spreadsheet’s remove duplicates command?
Only on a review copy, and only after choosing the comparison columns. It deletes whole rows, so it can drop a legitimate identical line. A status column with a reason is safer and reversible.
Does removing duplicate rows prevent a duplicate payment?
No. Duplicate rows inflate one invoice in your table; a duplicate payment happens when the same invoice is paid twice. Preventing it also needs payment records and approval controls.
Continue the checks
Before matching rows, keep leading zeros in vendor item codes so that 00172 and 172 do not look like two articles. To place each line in the document structure, compare line items with the invoice header fields.
The synthetic invoice table on the home page shows one row per line with its PDF page, and the line-by-line validation checks list what to verify before an extracted table is used.