Blog

How to convert invoices to Excel with AI.

VibeTasking Team10 min read
Purchase invoices · batch of 56€0.08 per invoice
invoice_0412.pdf
SupplierSuministros Vega, S.L.
Tax IDB45021987check digit
Total€1,502.34adds up
entries.xlsxReady to import

Every month it's the same: a folder with forty PDF invoices, three receipts photographed with a phone, a supplier's spreadsheet with merged cells and an order written in the body of an email. And on the other side, a program that accepts exactly one thing: its file. Its spreadsheet with its columns in its order, its CSV with its separator, its XML with its schema.

OCR (optical character recognition) reads the text on an invoice. Preparing it for accounting takes another step: getting what was read into the exact format your software imports, with every value checked, and having someone warn you about what doesn't add up before it slips into the books.

That is what a VibeTasking agent does. An accounting firm has used one since July to turn its clients' purchase invoices into the spreadsheet its software imports. In September it cost them about €0.08 per invoice. Here is how it works, and how the same thing carries to any document and any format.

From invoice OCR to Excel for your accounting software

There are hundreds of tools to extract data from an invoice with AI, and nearly all of them read the supplier, the date and the total just fine. What separates an OCR from a file prepared for import comes down to three things.

The output has to be exactly your file, not "a spreadsheet": your software's template, with its columns, its codes and its date format. Every value has to come checked, because a tax ID with two digits swapped is a supplier that does not exist. And whatever is doubtful has to come flagged, with the reason, so you look at that and only that.

From the pile to the file

What happens between the document and your program

Documents that look nothing alike come in. Every value is read with the check that makes it trustworthy. And the same data comes out in the file each system accepts.

In

invoice_0412.pdfThe supplier's PDF
receipt_cafe.jpgA phone photo
order.emlAn order in an email
pricelist.xlsxMerged-cell spreadsheet

Read and check

invoice_0412.pdf
SupplierSuministros Vega, S.L.
Tax IDB45021987check digit
Net · VAT1,241.60 · 260.74
Total€1,502.34adds up
Account600confirmed before

Out

entries.xlsxYour program's templateimports
batch.xmlSEPA for the bankvalid
invoice.xsigFacturae for the portalvalid
list.csvSemicolons, UTF-8opens

Same every month: the folder goes in, the file comes out, and whatever does not add up arrives as a list with the reason.

What it checks before handing you the file

This list is the difference between a demo and something an accounting firm runs every week on its clients' invoices.

  • Every document adds up. Net amounts plus VAT plus surcharge, minus withholding, plus disbursements, has to equal the printed total. When it doesn't, the agent looks in the footer for the global discount nobody subtracted or the eco-fee nobody added. The base that goes into the books is the one after the discount, not the one printed in bold.
  • The check digit of every tax ID. If it fails, the ID is not accepted. The agent rasterises the first and last pages, crops and rotates the margins (large companies often print their tax ID in the text running sideways down the edge) and only takes a candidate that passes the check. One supplier with two IDs, or one ID with two names, comes out as a warning.
  • The VAT regime as the number your software expects. Fourteen cases: domestic, exempt, out of scope, intra-EU goods, intra-EU services, import, non-EU services, reverse charge, equivalence surcharge, second-hand goods, travel agencies, agricultural, simplified invoice, and the Canary Islands and Ceuta and Melilla taxes. Up to three VAT rates per invoice, which is normal in food distribution.
  • The ledger account. First it checks whether that supplier already has a confirmed account for that client, and if so, that one wins even when the description suggests another. Only with no history does it infer one (purchases, rent, professional services, utilities and the rest). When nothing fits, it leaves the field empty and flags it, instead of inventing.
  • Credit notes. A document with negative amounts is booked as a credit, whether or not it says so in words.
  • Duplicates. Same supplier, same number and same date is never saved twice.
  • What cannot be read. A password-protected or damaged PDF is set aside and reported. Not investigated, not guessed.

Whatever it cannot settle on its own reaches you as a list of warnings with the reason, in plain language: "the document carries two dates, the issue date was used", "the tax ID as read failed its check digit, the one printed on another invoice from the same supplier was used". You read that list, not the forty invoices.

PDF invoices to Excel: one accounting firm, every week

The firm keeps the books for food distributors, among others. Its clients upload their purchase invoices to a portal, one agent sorts what arrives by finding the client's tax ID inside each document, and another agent turns every batch into the spreadsheet the firm's software imports: one row per document, with the invoice type as a number, net amounts and VAT in blocks, withholding, the ledger account, and the path of the PDF on the firm's disk with Windows separators, so the software links every entry to its document.

One batch on a Thursday in September: 56 documents, 47 invoices and 9 credit notes, all in the spreadsheet in 15 minutes. None left out. Of the 56 ledger accounts, 52 came from the firm's memory and the agent inferred 4. And the warning list had 14 lines: the 9 credit notes detected by their sign, two invoices whose issue and transaction dates differed, some disbursements outside the base, one €0.48 line at 0% that had to be reread, and one tax ID corrected because the one read failed its check digit and the right one was printed on another invoice from the same supplier.

That batch cost 467 credits, 8.3 cents per document. The five batches processed from September 1 to 10 totalled 127 documents, averaging 18 seconds and 8.4 cents per document.

The August 4 batch cost 13.4 cents per document. The drop is not a cheaper model: the mechanical work (unzipping, removing duplicates, building the spreadsheet, validating the totals, writing the delivery note) moved from the model into seven scripts that travel with the agent, and the model kept only what needs judgment: reading the document, inferring the account when there is no history, and fixing what the scripts flag.

The same data, in the file each program asks for

It is worth being precise about what the agent does. It does not operate your software. It writes and reads files, which is exactly what your software knows how to import and export. And because it can run code, any format described in a manual is a format it can write.

  • Your accounting software's import spreadsheet or CSV. Contasol, Factusol, Sage 50, a3ERP, Holded, Odoo or whichever it is: the template with its columns in its order, its invoice-type codes and its date format. The firm's is a one-row-per-document spreadsheet and the agent fills it in as is.
  • SEPA batches. From a spreadsheet of payments or direct debits to the pain.001 or pain.008 XML your bank uploads, with every IBAN checked and the amounts adding up to the header.
  • Facturae. From your invoices to the XML Spanish public administrations require for their e-invoicing portal.
  • Bank statements, the other way round. From the Norma 43 file your bank gives you to a spreadsheet you can reconcile.
  • Your software's own file. The one described in an eighty-page manual with fixed positions and three-letter codes. The agent reads the manual and writes the file.

If your software is a desktop program that has been installed for fifteen years, this is what matters: nothing has to be replaced, connected, or asked for an API it does not have. It keeps importing the file it always has. What changes is who writes it.

And not only invoices

Invoices are the most common case, not the only one. The same agent reads receipts, delivery notes, orders that arrive in the body of an email, contracts, payslips, statements, scanned forms and PDF listings someone exported years ago that now need to be a spreadsheet again.

"Any document" means anything a person could read. A PDF with text, a scanned PDF, a crooked photo, Word, Excel, an email with attachments, or a zip with everything mixed inside. When the document is an image, it looks at it. When the text runs sideways, it turns it. And if what comes in carries personal data that should not leave the office, it is anonymised first.

How you know the file is valid

A demo that looks right is not the proof. The proof is that the file passes where it has to pass.

For a SEPA file, your bank's validator or any of the public ISO 20022 schema validators. For Facturae, the official validator of the public administration's portal. For your software's spreadsheet, an import into a test company. And for everything, the totals: every row adds up to what the document says, or it comes in the warning list with the reason.

That list is the deal. The agent does not promise never to be wrong; it promises to tell you where to look.

How much AI invoice data extraction costs

VibeTasking costs €30 a month with 3,000 credits, and a credit is one cent. What the agent spends depends on how many documents it reads, not how many arrive.

The firm in the example processed 127 documents from September 1 to 10 for 1,065 credits: €10.65 in credit usage, or €0.084 per document. That is an agent tuned over five weeks and thirty-five revisions, so a freshly built agent spends more at first, as theirs did in August. What brings the cost down is the usual: the model reads only what it needs to read, and scripts do the mechanical part.

How it is put together

Three pieces, and none of them is custom software.

  • An agent with the case's instructions: how an invoice is read under Spanish and EU rules, what to check, what to flag. The seven scripts travel with it as resources. When one of the firm's rules changes, one sentence changes.
  • A database with the clients, the suppliers and the ledger accounts the firm has confirmed. It is the memory: every batch learns for the next one, and what someone confirmed from the web app outranks what the agent infers.
  • A portal where the firm's clients upload their documents and a second agent sorts them by tax ID. Anything doubtful stays in a tray with the proposed client and the reason.

And behind it, the warning list of every delivery, which is where a person looks.

Extracting data from other documents with the same process

Almost every company has a program that accepts only its own file and a folder of documents that look nothing alike. A ten-year-old ERP, a payroll program, a large customer's platform that demands its CSV, a bank that wants its XML. The shape of the problem is always the same: anything comes in, exactly one thing has to come out, and in between there is someone copying by hand.

Start with this month's folder. Upload it, say which file your software needs, and look at the first spreadsheet. You can build it yourself, or tell us which software you use and we'll stand up the first version with you.

Keep reading