> For the complete documentation index, see [llms.txt](https://murabyte.gitbook.io/murabyte-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://murabyte.gitbook.io/murabyte-docs/readme.md). Agents can also search and read this documentation through its [MCP server](https://murabyte.gitbook.io/murabyte-docs/~gitbook/mcp).

# Three-way invoice matching in Excel: catch quantity and price mismatches before paying

Match purchase orders, receipts and invoices in Excel and catch over-billing before you pay. #excel #accountspayable

Three-way matching means checking three documents before you pay a supplier: the purchase order (what you ordered), the goods receipt (what arrived) and the supplier invoice (what they billed). If all three agree on quantity and price, the line is ready for approval. If not, flag it for review. This guide shows how to do it in plain Excel, with a small example you can copy.

### The example (synthetic data)

You order 24 units at $12.00 each. Only 20 arrive. The supplier invoices 24 units at $12.00.

* PO: 24 x $12.00 = $288.00
* Receipt: 20 units
* Invoice: 24 x $12.00 = $288.00

The invoice bills $48.00 for 4 units that have not arrived. That is a variance to review, not an instruction to pay a set amount. A split shipment may explain it, so check with the supplier or warehouse before you hold or dispute anything.

### Step 1: three sheets, one key

Make three sheets named PO, Receipts and Invoices. Give each line the same key: PO number plus item code, for example PO-1001|BOLT-M8. Columns:

* PO: key, qty\_ordered, unit\_price
* Receipts: key, qty\_received
* Invoices: key, qty\_billed, unit\_price\_billed

### Step 2: pull the numbers next to each invoice line

On the Invoices sheet, add these columns (row 2 shown). Columns A to D hold key, qty\_billed (B), unit\_price\_billed (C) and your invoice number (D):

* E, po\_price: =SUMIFS(PO!C:C, PO!A:A, A2)
* F, qty\_received: =SUMIFS(Receipts!B:B, Receipts!A:A, A2)
* G, po\_lines: =COUNTIF(PO!A:A, A2)

Receipts can have several rows per key (partial deliveries), so SUMIFS adds them. The PO should have exactly one row per key.

### Step 3: add the checks

* Key check: =IF(G2<>1, "CHECK PO KEY", "OK"). A key with no PO row, or with two, needs a look before any other result is trusted.
* Quantity check: =IF(B2>F2, "BILLED MORE THAN RECEIVED", "OK")
* Price check: =IF(ROUND(C2-E2,2)>0, "PRICE ABOVE PO", "OK")
* Variance to review: =MAX(0,B2-F2)\*C2+MIN(B2,F2)\*MAX(0,C2-E2)

The variance formula adds the value of units billed but not received to the price excess on the units that did arrive. In the example, 4 x $12.00 = $48.00.

### Step 4: test with four cases

1. Short delivery: ordered 24, received 20, billed 24 at $12.00. Expected: quantity flag, $48.00 variance.
2. Same quantity, higher price: ordered 24 at $12.00, received 24, billed 24 at $12.50. Expected: price flag, $12.00 variance (24 x $0.50).
3. Both: ordered 24 at $12.00, received 20, billed 24 at $12.50. Expected: both flags, $60.00 variance (4 x $12.50 + 20 x $0.50).
4. Clean match: ordered 24, received 24, billed 24 at $12.00. Expected: OK, $0.00.

If your sheet gives these four answers, the per-line logic works. Treat the output as a list of lines to review, not a payment decision.

### What a spreadsheet will not catch

* Several invoices that together bill more than the order.
* Duplicate invoices with a different invoice number.
* Items that are not on the PO at all.
* Tolerances such as "ignore price differences under 1%".

You can add formulas for these, but they get long fast.

### If you would rather not maintain formulas

ThreeWayMatch is an offline Windows app that does the same checks from CSV or Excel files (and text-based PDF invoices), including duplicates, tolerances, tax and freight columns, and an Excel report. It has a free 15-day trial, then $49. It is a Windows app, not an Excel workbook. Review its results before paying or disputing an invoice.

<https://murabyte.gumroad.com/l/threewaymatch>

\#excel #accountspayable #bookkeeping #invoicing #spreadsheets #smallbusiness #murabyte

*Written by Murabyte. This post was written with AI assistance.*


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://murabyte.gitbook.io/murabyte-docs/readme.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
