Extract PDF Tables to Excel with AI
A step-by-step guide to setting up an AI agent that extracts PDF tables to Excel using LLMs with human-in-the-loop review.
Ståle Zerener
Co-founder & CEO
Extracting PDF tables to Excel is a common challenge when working with invoices, purchase orders, financial statements, bank statements, or product catalogs. PDFs aren’t designed for structured data analysis, and manual copy-paste into spreadsheets is slow, error-prone, and difficult to scale. AI can help extract tables from PDFs and convert documents into clean, structured Excel data with fewer errors.
In this post, we show how to set up an AI agent that automatically extracts tables from PDFs and writes them to Excel in under 10 minutes, using LLMs with human-in-the-loop review.
If you are still deciding between spreadsheet output and API output, compare this walkthrough with converting PDFs to JSON using AI. For the model and OCR trade-offs behind table parsing, see Using LLMs for OCR and PDF Parsing.
Before we get started
You’ll need:
- A Microsoft 365 work or school account
- A Cradl AI account
Setting up your AI agent
Create a new agent and describe the document type it should handle, for example “Product catalogs” or “Purchase orders”. You can also start from one of the popular use cases, such as Invoices, Purchase orders, or Bank statements. Click Create agent, and Cradl AI sets up an agent with a suggested set of fields for that document type.
Choosing the table columns to extract
Open the Builder tab and select the Document AI node. Under Data to extract you’ll see every field the agent reads from the document. A table is a single field with its own list of columns.
Select the table field to add, remove, or rename columns. It helps to give every column a type: if quantities and amounts are number columns, they arrive in Excel as numbers you can sum, not as text. For columns that are easy to confuse, write a short prompt. If a document has both a unit price and a line total, say which one you want. Values that appear once per document, such as a date or a document number, should be fields of their own next to the table.
Running your first PDF table extraction
Open the Runs tab, click Upload, and add a PDF. When the run has finished, select it to review the result. You’ll see the extracted rows next to the original document, and Cradl AI asks you to check the values it is uncertain about.
Correct anything that is wrong, add or remove rows if needed, and click Confirm. Values that are already checked off were validated by the AI and need no action.
Exporting the results to Excel
Once your agent is extracting data correctly, the next step is exporting it to Excel.
For a product-level overview of spreadsheet exports, see the Microsoft Excel integration. If your workflow is built in Power Automate, the Power Automate PDF-to-Excel guide covers the platform-specific setup.
In the Builder tab, click Add export and choose Microsoft Excel. Sign in with your Microsoft work or school account, then pick how you want the data written. “Export to single workbook” adds every processed PDF to the same workbook, which is what you want for one running list, such as all line items from all invoices. “Export to separate workbooks” creates one workbook per PDF in a folder you select.
To export to a single workbook, first open the workbook in Excel and insert a Table (Insert → Table) with a column for each value you want to export. This step is required so Cradl AI knows where to write the extracted data.
Back in Cradl AI, search for the workbook in your OneDrive and choose the table. Then, under Map fields, choose which agent field is written to each Excel column. The column names in Excel don’t need to match the field names in your agent, and columns of a table field, such as line items, can be mapped like any other field.
If you add or rename columns in Excel later, refresh the columns in the export panel and update the mapping.
You can also keep a copy of the original PDF in the same folder as the workbook, which is useful when someone needs to trace a row back to its source.
If a workbook is missing from the list, it is usually stored in a shared site or SharePoint library. Use Request additional permissions in the export panel to give Cradl AI access to those locations.
Take it for a spin!
After connecting Excel, upload a new document or rerun an existing run from the Runs tab. You can also click Test agent in the builder to run a single document and follow it through each step.
Once processing is complete, you may be asked to confirm values the model is unsure about. What gets flagged is decided by the Guardrails on each field. To change them, open a field or a table column in the Document AI node and add or edit its guardrails, for example the confidence a value needs before it is accepted without review.
When everything looks good, click Confirm, and the extracted rows appear in your Excel workbook.
Sending PDFs in automatically
So far we have uploaded PDFs by hand. To skip that step as well, go to the Builder tab, click Add trigger, and choose Email. The agent gets its own email address, and PDFs sent to that address are processed and exported to Excel like any other run. Use the allow list to limit which senders or domains the agent accepts documents from.
If your PDFs live somewhere else, the same menu has triggers for the API, Power Automate, n8n, and Zapier.
That’s it. No more manual copying and pasting.