Invoice OCR · Accounts payable · MOFU

Invoice OCR to Excel in Spain: three ways to do it and when Excel falls short

Copying the number, date, taxable base and VAT of every invoice into a spreadsheet by hand is the most repeated admin task in a small business. It is also the one that leaves the most errors at closing.

There are three ways to get that data into Excel without typing. Two of them are built into Excel and hardly anyone uses them. This guide explains which one suits each type of invoice, which columns to extract if you handle invoices in Spain, what to check before you trust the result and at what point the spreadsheet stops being the right tool.

Three glass invoices swept by a beam of blue light, their data travelling along threads to a grid of cells, with one cell circled by an amber ring
Owner of Dokuflex
Updated: 13 November 2026

For administration, accounting and accounts payable teams at small and mid-sized companies, accountancy firms and professional practices doing business in Spain. Based on Spain’s invoicing regulation (Real Decreto 1619/2012), Microsoft’s documentation on Excel and Power Query and the Spanish rules on keeping invoices, consulted on 13 November 2026. This is guidance only: for your specific case, check with your tax adviser.

Direct answer

There are three ways to get invoices into Excel with OCR: import the PDF with Power Query (PDFs with text), use Data from Picture (photos and scans, one at a time) or use AI-powered invoice OCR software (batches, no templates). For Spanish invoices, extract at least the data in article 6 of Real Decreto 1619/2012: number, date, NIF (tax ID), taxable base, VAT rate and VAT amount.

What getting invoices into Excel with OCR means

Getting invoices into Excel with OCR means turning the content of a PDF, scanned or photographed invoice into rows and columns of a spreadsheet, without typing it. OCR (optical character recognition) turns the image into text; the next step, which is the hard one, is knowing which text is the invoice number, which is the taxable base and which is the VAT amount.

That difference explains almost everything that follows. A tool that only recognises characters gives you the invoice back as text, and you still have to hunt for each value. A tool that understands the document gives you a row with its fields. The second is called data extraction or intelligent document processing (IDP).

One warning before we start: the Excel sheet is a working record, not the invoice. The document you were sent is still the supporting evidence and has to be kept, as we explain below.

Three ways to get invoices into Excel

The right method depends on two things: whether the invoice is a PDF with text or an image, and how many invoices you process each month. This table sums up the three options:

MethodWorks forLimitReasonable volume
Power Query from PDF (built into Excel)PDFs generated by invoicing software, with selectable textIt works with the text in the PDF: if the PDF is a scanned image, it finds no tables. Every supplier uses a different layout and the query has to be adjustedMany invoices from the same supplier
Data from Picture (built into Excel)Photos, screenshots and scans with a visible tableOne image at a time, with manual review. It reads tables; it does not tell tax fields apartA handful of one-off invoices
AI-powered invoice OCR softwareAny format and any supplier, in batchesIt is a separate service from Excel; the exceptions it flags have to be reviewedFrom a few dozen a month upwards

There is a fourth route that has become fashionable: uploading the invoice to a generative AI assistant and asking for a table. For a single invoice it works, but it is not a working method. Invoices have to be uploaded one at a time, the model may fill in a plausible value for something it cannot read properly and, above all, you are sending your suppliers’ data to a service your company may not have authorised (we cover this in shadow AI at work).

How to do it in Excel, step by step

Excel comes with two features that handle the simple cases without installing anything. Menu names vary slightly from one version to another.

If the invoice is a PDF with text

  1. In Excel, open Data > Get Data > From File > From PDF and choose the invoice.
  2. The Power Query Navigator shows the tables and pages it has detected. Select the one that contains the line items or the summary of amounts.
  3. Click Transform Data to remove empty rows, promote headers and set the type of each column (date, decimal number).
  4. Load the result into the sheet. If you save that supplier’s invoices in a folder, you can run the query over the whole folder and refresh it every month.

It works well for invoices from a recurring supplier, because the query is set up once. With fifty different suppliers, that is fifty queries.

If the invoice is a photo or a scan

  1. Open Data > From Picture > Picture From File (or from the clipboard, if you have taken a screenshot).
  2. Excel analyses the image and shows a preview with the cells it is unsure about highlighted.
  3. Review and correct those values. Microsoft says so in its own help page: you have to review the results and make any corrections needed before inserting.
  4. Click Insert Data.

The feature is available in Excel for Windows, Mac, the web and mobile. It reads clean tables well; with an invoice that is crooked, stamped or has several VAT bases, correcting it by hand can take longer than typing it.

Which columns to extract from each invoice

The minimum columns are the data that article 6 of Spain’s invoicing regulation (Real Decreto 1619/2012) requires on every full invoice, plus what you need to pay and post it. If any of the first group is missing from the document, the problem is not the OCR: the invoice is incomplete and you need to ask for a corrected one.

ColumnWhere it comes fromTypical extraction error
Number and seriesArt. 6.1.aConfusing it with the purchase order or delivery note number; O for 0, I for 1
Issue dateArt. 6.1.bDay and month swapped; picking up the due date
Issuer’s name or registered company nameArt. 6.1.cTaking the trade name from the logo instead of the registered name
Issuer’s NIF (tax ID)Art. 6.1.dReading your own NIF (the recipient’s) as if it were the supplier’s
Taxable baseArt. 6.1.fA single base when there are several; decimal point and comma mixed up
VAT rateArt. 6.1.gApplying 21 % by default on invoices with reduced rates
VAT amountArt. 6.1.hAdding the VAT amount to the total twice
Special mentions (exemption, reverse charge, cash accounting scheme)Art. 6.1.j, m and pNot capturing them: they appear as free text and change the VAT treatment
IRPF (personal income tax) withholding, total and due dateNeeded to pay and post the invoiceIgnoring the withholding and overpaying
Link to the original documentYour own filesHaving the row and not finding the invoice when someone asks for it

Simplified invoices (the former till receipts, generally allowed up to €400, VAT included, under article 4 of the same regulation) carry less data: they often do not break out the VAT amount or identify the recipient. If you mix them in the same sheet, add a column for the type of invoice. Employee expense receipts follow their own route, which we explain in expense receipt digitisation with OCR.

Five checks before you trust the sheet

No OCR gets it right every time, so the sheet needs controls that catch errors on their own. These five can be set up with formulas and conditional formatting:

The arithmetic adds up

Base times rate equals VAT amount, and base plus VAT minus withholding equals total, with a one-cent tolerance. This is the check that uncovers the most reading errors.

The NIF belongs to a known supplier

Match the NIF against your supplier list. A NIF that does not appear is either a new supplier or a misread character; in both cases someone should look at it.

It is not a duplicate

The combination of issuer’s NIF, number and date cannot be repeated. Invoices that arrive by email and then on paper are the usual source of double payments.

The date is possible

Not in the future and not from two financial years ago. An absurd date is almost always a day and a month in the wrong order.

The amounts are numbers

An amount read as text (“1.250,00” with the wrong separator) does not add up. Check that the whole column is numeric before you total it.

Remember the record-keeping obligation too. Spain’s invoicing regulation requires received invoices to be kept for the period laid down in the Ley General Tributaria (General Tax Act), whose article 66 sets a four-year limitation period, and article 30 of the Código de Comercio (Commercial Code) requires business records to be kept for six years. Scanning an invoice to read it with OCR does not let you throw away the paper: only certified digitisation with software approved by the AEAT (Spanish tax agency) does (Orden EHA/962/2007).

When Excel falls short

Excel falls short when the problem is no longer reading the invoice but deciding what to do with it. A sheet stores data; it does not notify anyone, it does not request approvals and it does not know whether an invoice has been paid. These are the signs:

  • Someone spends hours every week importing, correcting and re-keying the data into the accounting software.
  • An invoice has been paid twice, or one nobody had seen has turned up at closing.
  • Approvals are requested by email and there is no record of who signed off or when.
  • Several people edit the same sheet and different versions are in circulation.
  • To find out what is awaiting payment you have to ask someone.

On top of these signs comes a regulatory change. With mandatory e-invoicing between companies in Spain, the recipient will have to report the acceptance, rejection and full payment of each invoice within 4 calendar days: from 6 October 2027 for those with turnover above €8 million and from 6 October 2028 for everyone else (Orden HAC/1028/2026). We go into the detail in receiving supplier e-invoices in Spain. A spreadsheet can store those dates, but it does not generate them.

Structured invoices will not retire OCR overnight either. Until 2028, XML, PDF and paper will coexist, and invoices from foreign suppliers will keep arriving as they do today.

How to choose invoice OCR software: eight questions

Invoice OCR software should be chosen for what it does after reading, not for the reading itself. Almost all of them extract a clean invoice well; the differences show up with difficult invoices and with what happens next. Ask these questions in the demo, using your own invoices:

  1. Does it need a template per supplier? If the answer is yes, every new supplier means configuration work.
  2. Does it read several VAT bases and rates, withholdings and the recargo de equivalencia (equivalence surcharge) on the same invoice?
  3. Does it validate what it reads? Arithmetic, NIF, duplicates and, where there is one, the related purchase order.
  4. What does it do when it is unsure? It should flag the field and send it to a person, not fill it in.
  5. How do invoices come in? Mailbox, scanner, mobile, folder and, for e-invoices, XML.
  6. Is there an approval workflow by amount, cost centre or project, with a record of who approved?
  7. How does the data reach accounting? A connector to your ERP avoids manual export and import, which is just another form of typing.
  8. Where are the documents processed and stored, and for how long? Ask for the answer in writing.

If what you want is to put the whole workflow in order, how to automate supplier invoice approval explains the rules that work best in a small or mid-sized company.

How Dokuflex solves it: from invoice to accounting entry, without going through Excel

Dokuflex, the low-code BPM platform with AI, treats reading the invoice as the first step of a process, not as an end in itself. With AI-powered supplier invoice OCR software:

  • Intake from any channel: you forward the supplier’s email to a dedicated mailbox, scan the paper, take a photo with your phone or connect a folder or your ERP.
  • Extraction without templates: the AI returns supplier, taxable base, VAT rates, withholdings and due date with 99.4 % accuracy, including invoices with several VAT rates and from suppliers in other countries.
  • You only review the exceptions: anything doubtful goes to human validation within the workflow; the rest carries on.
  • Rule-based approval: the workflow sends each invoice to the approver by amount, cost centre or project, and records who approved it and when.
  • Entry in your ERP: the accounting entry is generated with deductible VAT separated and reaches SAP, Sage, A3, Holded, Dynamics or Odoo through a connector, with no exporting or re-keying.
  • Paid or pending, without asking: invoices are matched against bank transactions.

For paper, Dokuflex is approved by the AEAT for certified digitisation, which is what lets you dispose of the original. And if you want to understand the whole process before choosing a tool, the invoice digitisation guide walks through it from start to finish.

If your volume is a few invoices a month, the two Excel features in this guide are enough. If you have already recognised any of the signs above, book a 20-minute session and we will go through it with three of your invoices.

Frequently asked questions

How do I convert a PDF invoice to Excel?

If the PDF has selectable text, Excel imports it with Power Query: Data > Get Data > From File > From PDF. You pick the table it detects and load it into the sheet. If the PDF is a scanned image, you need OCR: Excel’s Data from Picture feature for one-off cases or invoice OCR software for batches.

Does Excel have OCR for invoices?

Excel includes the Data from Picture feature, which turns a photographed or captured table into cells and asks you to review the result before inserting it. It works one image at a time and reads tables; it does not understand what a taxable base or a NIF (Spanish tax ID) is. It is fine for a handful of invoices, not for processing a month of supplier mail.

Which invoice data should go into Excel?

At a minimum, the data that article 6 of Spain’s Real Decreto 1619/2012 requires on a full invoice: number and series, issue date, the issuer’s name and NIF (tax ID), taxable base, VAT rate and VAT amount. For day-to-day work, add the total, withholdings, the due date and a link to the original document.

Can I throw away the paper invoice after scanning it and putting it into Excel?

Not just because you scanned it. Spain’s invoicing regulation requires received invoices to be kept for the period set by the Ley General Tributaria (General Tax Act), and the Código de Comercio (Commercial Code) sets six years for business records. Only certified digitisation, done with software approved by the AEAT (Spanish tax agency) under Orden EHA/962/2007, lets you dispose of the paper original.

Is generative AI a good way to get invoices into Excel?

AI assistants read a single invoice well and return a table, but they have three problems for daily work: invoices have to be uploaded one at a time, the assistant may make up a value it cannot read clearly, and you are sending supplier data to an external service. For recurring use, you are better off with software that validates the amounts and leaves an audit trail.

When is invoice OCR software worth it instead of Excel?

When these signs appear: someone spends hours every week copying or correcting data, a duplicate invoice has been paid, approvals are requested by email, or you cannot tell which invoices are awaiting payment without asking. With mandatory e-invoicing in Spain, which will require acceptance, rejection and payment to be reported within 4 days, a spreadsheet does not leave that trail.

Sources

Consulted on 13 November 2026. Excel menu names may vary by version and platform.

Next step

Get the invoice read, approved and posted, with no copying and pasting

Bring us three invoices from different suppliers and in 20 minutes we show you what the AI reads, what it leaves for review and how the entry reaches your accounting software. Or create a free account and try it on your own.