If your office still retypes supplier invoices into a spreadsheet, software can take most of that typing away. Extraction tools — whether they read a digital PDF or run OCR on a scan — cut the re-keying, but the values they produce still need checking before anything is posted to your ledger. The reading step and the checking step are two different jobs.
This guide covers how to extract invoice data from PDF to Excel in a Hong Kong SME office: how software actually reads an invoice, a worked example with the checks that matter, a spreadsheet formula trap worth knowing about, and a short workflow you can put in place this week. It is an operational guide, not accounting or legal advice.
How software reads an invoice
There are two very different situations, and they need different tools.
Text-based ("born-digital") PDFs. The invoice was created by a computer and the text is already inside the file. Excel can pull tables straight out of these using Get Data ▸ From File ▸ From PDF, as described in Microsoft's Power Query PDF connector documentation. It opens a Navigator window, you pick the tables you want, and load or transform them. Two things to expect: availability of this feature varies by Excel version and platform, and where an invoice has multi-line descriptions, the rows often import misaligned and need cleanup.
Scanned or photographed invoices. Here the "invoice" is just an image. Software has to run OCR (optical character recognition) to turn the pixels into text first. Clear, straight, full-page images help; skew, faint or low-contrast text, a company chop over the figures, and handwritten annotations can all reduce how reliably the characters are read. Poor input does not always produce a wrong result; check uncertain fields against the original.
Structured (AI) extraction sits on top of either case. Instead of giving you a rough table, it returns labelled fields — invoice number, invoice date, supplier, subtotal, tax, total — and a list of line items. Microsoft's invoice processing prebuilt model documentation is a good reference for what this class of tool extracts: header fields plus line items, and a confidence score attached to fields. That documentation also notes it accepts Traditional Chinese (Hong Kong) invoices and recommends clear scans. Treat the confidence score as a signal that a field needs a human look — not as a guarantee that the value is right.
A worked example: one invoice, six checks
Illustrative example — 示範例子(非真實客戶資料).
A supplier invoice arrives as a PDF:
On a phone, scroll sideways to see the full table.
| Field | Value |
|---|---|
| Supplier | Kowloon Packaging Supplies |
| Invoice no. | KPS-24188 |
| Invoice date | 2026-08-14 |
| Payment terms | Net 30 (30 days from the invoice date) |
| Due date | 2026-09-13 |
| Currency | HKD |
On a phone, scroll sideways to see the full table.
| Line | Qty | Unit price (HK$) | Line total (HK$) |
|---|---|---|---|
| Carton box (L) | 20 | 12.50 | 250.00 |
| Bubble wrap roll | 6 | 85.00 | 510.00 |
| Fragile label | 100 | 0.40 | 40.00 |
| Subtotal | 800.00 | ||
| Delivery charge | 60.00 | ||
| Invoice total | 860.00 |
Before that total goes anywhere near your accounts, run six checks:
- Possible duplicate? Is invoice number KPS-24188 from this supplier already in the sheet — or a different number with the same supplier, date and amount? Treat a match as a candidate to investigate, not a confirmed duplicate: compare the two source documents before rejecting either.
- Is it actually an invoice, and does it read back to the source? Not a credit note, a statement, a pro-forma, or a delivery note with prices on it — each is handled differently. Check the supplier name, invoice number and invoice date in your row against the PDF in front of you, character for character.
- Do the lines add up? 20 × 12.50 = 250.00; 6 × 85.00 = 510.00; 100 × 0.40 = 40.00. Subtotal 250.00 + 510.00 + 40.00 = 800.00. Add delivery 60.00 → 860.00. It reconciles to the stated total. If it does not, stop.
- Is the currency explicit? Extraction gives you the number
860. Your row should sayHKD 860.00. If you post in a different currency, record the rate and the date you used. - Any risky cell contents? See the next section.
- Did a person approve it? A name and a date against the row.
The spreadsheet trap: cells that run as formulas
When extracted text lands in a spreadsheet cell that starts with =, +, - or @, the spreadsheet can treat that cell as a formula the moment the file is opened. A supplier reference like =REF/2026, or a note someone pasted, becomes executable content. This is known as CSV injection or formula injection, and OWASP's write-up on CSV injection explains how an exported file of untrusted values can be turned against whoever opens it.
The practical defence when you bring extraction output into Excel from a CSV: use Get Data / From Text/CSV, and in the import step set every untrusted text column (supplier name, references, description, notes) to the Text data type before loading. Then, as a separate pass, validate and convert the amount and date columns to numbers and dates. Importing is not safe on its own — a value like =1+1 still has to be caught — and OWASP notes that saving or re-opening the file later can re-expose the problem, so re-check after an export. Do not rely on a single "put a quote in front of it" trick; OWASP is explicit that there is no one sanitising step that is safe across every spreadsheet program. If the data is going into a sheet other people will open, this check is not optional.
Handling the awkward documents
Credit notes. A credit note reduces what you owe. Do not key it in as another positive bill. In the staging sheet, record it as its own entry, linked to the invoice it corrects, so the running supplier balance in the sheet reflects it. When it is posted, use your accounting system's own credit-note process rather than a hand-typed negative line.
Multi-currency. Record the invoice currency as extracted. If your ledger is in HKD, add the conversion rate and the date — do not let anyone guess it later.
Long or multi-page invoices. Born-digital tables can be pulled page by page. Where line descriptions wrap onto two rows, expect to tidy them — Microsoft's PDF connector documentation points to fill-down and grouping steps for exactly this.
Low-confidence fields. If the tool flags the total, a date, or a quantity as uncertain, check that field against the image before it moves on. That is what the confidence score is for.
A workflow you can run this week
- Sort the inbox. Split incoming invoices into born-digital PDFs and scans/photos.
- Extract. Born-digital: Excel Get Data ▸ From PDF, or a structured extractor. Scans: OCR or a structured extractor first.
- Land in a staging sheet, never straight into the ledger.
- Run the six checks. Anything that fails goes to a "query" list, not the ledger.
- Approve and file. A named person signs off; the row moves to the ledger; the original PDF or scan is kept so any entry can be verified later.
A project could wire the first four steps together — extraction, the duplicate check, and the staging sheet running automatically — leaving only the review and the approval to a person. That is a description of what such a workflow could do, not a product that is already connected to your accounts.
If you want a second opinion on your own invoice process, our note on how to write an invoice in Hong Kong covers the issuing side, and our list of small-business tasks worth automating puts this one in context. When you are ready, tell us how invoices come in today and we will suggest where automation would help and where it would not.
FAQ
Can Excel open a PDF invoice directly? Excel can import tables from text-based PDFs through Get Data ▸ From File ▸ From PDF, per Microsoft's PDF connector documentation. Availability depends on your Excel version and platform, and scanned invoices need OCR first.
Is AI extraction accurate enough to skip checking? No. A confidence score, like the ones described in Microsoft's invoice model documentation, tells you where to look — it is not a promise the value is correct. Always reconcile line items to the total and check for duplicates.
What about company chops, stamps and handwritten notes? They can reduce how reliably OCR reads the characters underneath or nearby. Check the affected fields against the image, and key them by hand where the reading looks uncertain.
Should we keep the original PDF after entering it? Yes. Keep the source document, not just the spreadsheet row, so that any entry can be traced back and checked by someone who was not involved in typing it.
