3-Way Match in Excel: A Free Template With Tolerance and Status Columns
A 3-way match checks each vendor invoice line against the purchase order line that authorised it and the receiving record that proves the goods arrived, and only approves payment when quantity and price agree within a tolerance. You can do it in Excel with three input sheets and one match sheet: XLOOKUP pulls the PO price and quantity, SUMIFS totals the receipts, and a few IF formulas produce a MATCH or EXCEPTION status with a reason. The template below does exactly that, and every formula is shown so you can adapt it.
Download: three-way-match-template.xlsx. It contains sample data on four sheets (Match, PO, Receipts, Invoices) plus a Settings sheet for the tolerances. It uses XLOOKUP, so you need Excel 2021, Excel 365 or a current LibreOffice. Note that this is a working spreadsheet, not accounting advice: tolerance values are starting points, not a standard.
2-way, 3-way and 4-way match, briefly
| Match | Documents compared | Typical use |
|---|---|---|
| 2-way | Purchase order + invoice | Services and subscriptions, where there is no physical receipt |
| 3-way | Purchase order + goods receipt + invoice | Physical goods; the default for most AP teams |
| 4-way | Adds an inspection or quality record | Regulated or inspected goods |
The point of the receipt is simple: a PO proves you ordered it and an invoice proves the vendor wants paying, but only the receipt proves it arrived. Skipping it is how you pay for short shipments.
How the template is laid out
Everything joins on one key: PO number plus line number, written as PO-1001-2. Each input sheet builds that key with a formula so you never type it.
| Sheet | Columns | Notes |
|---|---|---|
| Settings | Price tolerance %, price tolerance $ per line, quantity tolerance % | Edit B2:B4. Defaults 2%, $5, 3%. |
| PO | PO Number, Line, Key, SKU, Description, Qty Ordered, Unit Price, Line Total | Key = PO Number & "-" & Line |
| Receipts | PO Number, Line, Key, Receipt Date, Qty Received | Several receipts per line are fine; they are summed |
| Invoices | Invoice Number, Vendor, PO Number, Line, Key, Qty Invoiced, Unit Price, Line Total | One row per invoice line |
| Match | One row per invoice line, with lookups, differences, Duplicate?, Status, Reason | This is the sheet you review |
The formulas, column by column
On the Match sheet, row 2 is the first invoice line. C is the key, copied from Invoices!E2. The rest:
Pull the PO quantity and price (D and G)
D2: =IFERROR(XLOOKUP(C2,PO!$C:$C,PO!$F:$F),"NO PO")
G2: =IFERROR(XLOOKUP(C2,PO!$C:$C,PO!$G:$G),"")If the key is not on the PO sheet, D says NO PO and the status logic stops there. That catches the single most common exception: an invoice quoting a PO number you never issued, or no PO number at all.
Total the receipts for that line (E)
E2: =IF(D2="NO PO","",SUMIFS(Receipts!$E:$E,Receipts!$C:$C,C2))SUMIFS rather than XLOOKUP, because goods often arrive in several deliveries. A line with no receipts sums to 0, which the status logic treats as "invoiced before goods receipt".
Price and quantity differences (I to L)
I2 Price Diff $: =IF(G2="","",ROUND((H2-G2)*F2,2))
J2 Price Diff %: =IF(OR(G2="",G2=0),"",(H2-G2)/G2)
K2 Qty Diff vs Received: =IF(E2="","",F2-E2)
L2 Qty Diff %: =IF(OR(E2="",E2=0),"",(F2-E2)/E2)Price difference in dollars is per line (unit difference times quantity invoiced), because a one-cent unit difference on 10,000 units is a $100 problem and the percentage alone hides it. Quantity is compared with the quantity *received*, not ordered: being invoiced for what arrived is correct even if the PO said more.
Duplicate invoice lines (M)
M2: =IF(COUNTIFS($A$2:$A$8,A2,$C$2:$C$8,C2)>1,"DUP","")Same invoice number and same key appearing twice is a duplicate submission. Extend the ranges to your last row. For a looser check (same vendor, same key, same amount, different invoice number), add a second COUNTIFS on B, C and H.
Status and reason (N and O)
N2: =IF(D2="NO PO","EXCEPTION",
IF(M2="DUP","EXCEPTION",
IF(E2=0,"EXCEPTION",
IF(AND(ABS(J2)>Settings!$B$2,ABS(I2)>Settings!$B$3),"EXCEPTION",
IF(ABS(L2)>Settings!$B$4,"EXCEPTION","MATCH")))))
O2: =IF(D2="NO PO","No PO found for this key",
IF(M2="DUP","Duplicate invoice line",
IF(E2=0,"Invoiced before goods receipt",
IF(AND(ABS(J2)>Settings!$B$2,ABS(I2)>Settings!$B$3),"Unit price outside tolerance",
IF(ABS(L2)>Settings!$B$4,"Quantity differs from receipt","")))))The price test passes if the line is within *either* the percentage or the dollar tolerance. That is deliberate: a 12% difference on a $1.25 bracket is $0.15 a unit, and on a 10-unit line it is below any sensible $ threshold, while 0.5% on a $50,000 line is $250 and should stop. If you prefer a stricter rule, change AND to OR.
What the sample data shows
The template ships with seven invoice lines chosen to trigger each path once. With the default tolerances (2%, $5, 3%), the Match sheet should read as follows. We generated the file with a script and recomputed every expected status independently in Python; it was not opened in a desktop Excel on the machine that built it, so if a cell shows something different in your copy, that is worth a note to us.
| Invoice | Key | What is going on | Status | Reason |
|---|---|---|---|---|
| INV-77 | PO-1001-1 | 100 units at $4.55 vs PO $4.50: +1.1%, $5.00 per line | MATCH | Within tolerance |
| INV-77 | PO-1001-2 | 50 invoiced, 48 received (short shipment): +4.2% | EXCEPTION | Quantity differs from receipt |
| INV-78 | PO-1002-1 | 200 units at $1.40 vs PO $1.25: +12%, $30 per line | EXCEPTION | Unit price outside tolerance |
| INV-79 | PO-1003-1 | Exact match, but the line appears twice on the same invoice | EXCEPTION | Duplicate invoice line |
| INV-80 | PO-1004-1 | No receipt yet | EXCEPTION | Invoiced before goods receipt |
| INV-81 | PO-9999-1 | PO number does not exist | EXCEPTION | No PO found for this key |
| INV-79 | PO-1003-1 | The duplicate of row 4 | EXCEPTION | Duplicate invoice line |
Choosing tolerances
There is no published standard; these are ranges we see described as common practice, and your auditor or controller may have a view.
| Check | Typical tolerance | When to use zero |
|---|---|---|
| Unit price | 1% to 5%, or a fixed amount per line such as $5 to $50 | Contracted or catalogue prices that must not move |
| Quantity | 3% to 5% for bulk, weighed or perishable goods | Serialised items, capital equipment, anything counted one by one |
| Freight and tax | Often matched separately against a quote rather than the PO line | When the PO includes delivered pricing |
The exceptions you will actually see
In rough order of frequency, and what the template does with each:
- No PO number on the invoice, or a number you did not issue: NO PO. Send it back to the vendor or raise a retrospective PO, depending on policy.
- Invoice before goods receipt: receipts sum to 0. Hold the invoice until receiving posts; do not pay on the vendor's say-so.
- Short shipment or over-shipment: quantity outside tolerance. Pay for what arrived, or wait for the back-order.
- Price increase: unit price outside tolerance. Approve against a quote, or dispute.
- Duplicate invoice: DUP. The second copy is the one to reject; the template flags both so you can see them together.
- Freight or tax added on the invoice but not the PO: the template matches the line, and the header-level total will not. Add a header check if this is common for you.
Getting the three files into shape first
The template assumes the PO number is written the same way in all three sources. It rarely is. ERP exports give "PO-1001", the vendor types "PO 1001" or "1001", and receiving writes "po1001". XLOOKUP matches text exactly, so every variant is a NO PO. Before you paste the data in, normalise the key column in each file: trim, uppercase, strip spaces, and standardise the prefix. Leading zeros matter too: "001042" and "1042" are different keys, and Excel will silently drop the zeros if the column is numeric.
That key-cleaning step is the same problem as merging inventory CSVs by SKU, and the same deterministic steps fix it: trim, case, find-and-replace on the prefix, and a dedupe on the key before the join. PipeSheets does those as previewable steps and can also perform the join itself on one exact key across up to 20 files, which gives you the matched and unmatched rows as a CSV before you open Excel. It does not do tolerance comparison; that stays in the template, where you can see the thresholds.
Extending the template
- Header-level check: add a sheet that sums Invoices!H by invoice number and compares it with the vendor's invoice total, to catch freight, tax and rounding.
- Date window: add a column for days between receipt date and invoice date, and flag negatives (invoiced before receipt by date, not just by quantity).
- Approval trail: add Reviewed By and Decision columns to the Match sheet and keep each month's file.
- Larger volumes: convert the three input ranges to tables so the formulas extend automatically, or move the join to Power Query and keep only the tolerance logic in formulas.
If your purchase and receiving data comes out of different systems with different column names, the merge bank and Stripe exports page shows how a one-key merge works in PipeSheets; the mechanics are identical for PO, receipt and invoice files, and the output drops straight into the input sheets of this template.
Related guides
- Stripe Payout CSVs for Accounting: Gross, Fees, Net, and Matching Transfers to DepositsYour bank shows one Stripe deposit; Stripe made hundreds of charges. Here's how to pull the right report, split gross, fees, and net, and tie every payout to its bank line.
- Merge Bank, Stripe, and PayPal CSV Exports for Monthly ReconciliationMerging bank, Stripe, and PayPal CSVs for monthly reconciliation double-counts revenue unless you handle payouts correctly. Here is how to normalize all three to one schema and match payouts to deposits.
- What Is a "Stripe Transfer" on My Bank Statement?A deposit labelled STRIPE or STRIPE TRANSFER on your business bank statement is a Stripe payout: a batch of many customer payments, minus Stripe's fees and any refunds or disputes, sent from your Stripe balance to your bank. Here is why the amount never matches your sales, how to find exactly what is inside each deposit, and how to book it without counting revenue twice.
- AI Bank Reconciliation: What It Can Match, and What It Can'tAI bank reconciliation works by layering rules, exact matches, your own history and predictions, then auto-reconciling only above a confidence threshold. It handles clean one-to-one matches well and still struggles with fee-netted deposits and one payment covering several invoices. Here is how the tools decide, with a worked Stripe example.
Try the automated solution
PipeSheets can fix these issues automatically. Create a free account to clean your first file.
Create a free accountOr see how it works: Merge Bank & Stripe Exports