Practical guides

How to chat with PDF and Excel together

Upload the contract and the spreadsheet in one message, tell the AI which file sets the rules, and ask for row-level evidence you can check in Excel.

On this page
  1. Where a two-file question helps
  2. 1. Prepare the PDF and Excel files
  3. 2. Ask a cross-reference question in two passes
  4. 3. Worked example: invoices against a contract
  5. 4. Check the result in Excel
  6. 5. Export the exceptions table to Excel
  7. Do it in Chat AI App
  8. Common questions
  9. Sources

To chat with PDF and Excel together, attach the PDF and the Excel file to the same message and say what each one is. Tell the AI which file sets the rules and which holds the records. Then ask for a table that cites the clause and the row behind every finding, and check the flagged rows in Excel.

The framing matters more than the files. “Compare these files” invites a vague essay. “Check each invoice line against clauses 4.1 to 4.3” gives the AI a test it can pass or fail.

Where a two-file question helps

Most cross-file questions follow one pattern: one file is the rulebook and the other is the ledger. Naming those roles stops the AI from treating both files as equal sources of truth.

Rulebook (PDF)Records (spreadsheet)Question to ask
Supplier contract or rate cardInvoice linesWhich lines charge a rate or item the contract does not allow?
Expense policyExpense claims exportWhich claims break a spending cap or miss a required field?
Grant or project termsBudget trackerWhich costs fall outside the approved categories or dates?
Price list or quoteOrder exportWhich orders were billed at a different unit price than quoted?

If both of your files are PDFs, such as two versions of one contract, use the two-PDF comparison workflow instead. If you only need numbers from the spreadsheet, start with analyzing Excel on its own.

1. Prepare the PDF and Excel files

Open the PDF and try selecting a sentence. Selectable text is easier to work with than a photo of a page. Scanned PDFs can be uploaded, but check every number taken from a scan against the page image.

Clean the spreadsheet before you upload it:

  • One header row: Put column names in row 1 and remove notes or merged titles above the table.
  • A unique ID column: Give every record an ID, such as an invoice line number, so findings can point to a row.
  • Saved values: Recalculate and save the workbook in Excel first.
  • Units and currency: Say whether quantities are hours, visits or items, and name the currency.
  • Only the relevant sheet: Remove unrelated tabs, or name the sheet the AI should use.

Use filenames that say what each file is, such as “Service agreement.pdf” and “September invoices.xlsx”. Upload only material you are allowed to share.

2. Ask a cross-reference question in two passes

Ask for the rules first and the comparison second. In the first pass, the AI quotes each relevant clause with its number, and you check the list against the PDF. In the second pass, it applies only those confirmed rules to the spreadsheet.

Anthropic’s prompting guidance for long documents recommends the same moves: label each document and ask for relevant quotes before the task. The split also gives you a checkpoint. If a quoted rule is wrong, every finding built on it is wrong.

I have attached two files. [PDF name] is the contract and sets the rules. [Spreadsheet name] lists the records to check. Step 1: list every clause that affects price, quantity or what may be billed. Quote each one and give its clause or page number. Stop there and wait for me to confirm. Step 2, after I confirm: check every row against those clauses only. Return a table with row ID, amount billed, amount the contract allows, difference, clause, and a status of OK, Mismatch or Needs evidence. Show the arithmetic. If a rule depends on information neither file contains, mark the row Needs evidence instead of guessing. Finish by reporting how many rows you checked.

The row count is a cheap coverage test. If your sheet has 412 rows and the answer checked 380, find the missing rows before trusting any totals.

3. Worked example: invoices against a contract

This example is fictional, written for this guide. It is not a customer file or a recorded AI answer. Rebuild both files and run the prompt above. All amounts are in USD.

The PDF is a one-page cleaning service agreement with three pricing clauses:

  • Clause 4.1: Standard cleaning is billed at 40 per hour.
  • Clause 4.2: Window cleaning is billed at 60 per visit, one visit per calendar month unless the client approves more in writing.
  • Clause 4.3: Cleaning consumables are included in the hourly rate and are not billed separately.

The spreadsheet has one sheet called Lines with six September invoice lines:

LineDateServiceQtyUnit priceAmount
L1Sep 2Standard cleaning840320
L2Sep 9Standard cleaning845360
L3Sep 9Window cleaning16060
L4Sep 16Consumables12525
L5Sep 23Window cleaning16060
L6Sep 30Standard cleaning640250

A correct reconciliation should match this answer key:

  • L1 and L3: OK. Both match the contract rate and the arithmetic.
  • L2: Mismatch under clause 4.1. The rate is 45 instead of 40, so the line is 40 too high (8 × 5).
  • L4: Mismatch under clause 4.3. Consumables cannot be billed, so the full 25 is overbilled.
  • L5: Needs evidence under clause 4.2. It is the second window visit in September. It is allowed only with written approval, which neither file contains.
  • L6: Mismatch. The rate is right, but 6 × 40 is 240, not 250. The line is 10 too high.
  • Totals: Invoiced 1,075. Confirmed overbilling is 75 (40 + 25 + 10). The supported amount is 940, or 1,000 if approval for L5 turns up.

Judge each row, not just the totals. An overbilled total of 135 means L5 was wrongly counted as a confirmed error; the files cannot show whether approval exists. A missing L6 means the answer checked unit prices but not the multiplication.

4. Check the result in Excel

Do not settle a supplier dispute on an AI answer alone. Rebuild the key figures with formulas you can inspect.

  1. Add a sheet called Rates with each service in column A and its contract rate in column B, typed from the PDF. Give Consumables a rate of 0, per clause 4.3.
  2. In the Lines sheet, look up each contract rate with XLOOKUP. Microsoft’s XLOOKUP reference explains the optional if_not_found argument, which flags services the contract never mentions.
  3. Add an expected amount column, quantity × contract rate, and a difference column, billed amount minus expected amount.
  4. Add a status column with your own judgment, then total the differences by status with SUMIFS.

A sample lookup for row 2 is =XLOOKUP(C2,Rates!A:A,Rates!B:B,"Not in contract"). Your column letters may differ. For the example, the differences are 0, 40, 0, 25, 0 and 10, which total 75.

The formula cannot see the one-visit-per-month rule, so L5 shows 0. Sort by service and date to count window visits, then look for the written approval yourself.

For a long rate table, Microsoft documents a Power Query PDF connector that pulls tables from a PDF into Excel. It notes that multi-line rows are not always identified properly, so check imported rates too.

5. Export the exceptions table to Excel

Once the findings agree with your own check, ask for a clean final table with one row per invoice line. Leave out the discussion so the export holds only the tables.

Give me the final reconciliation as one table with these columns: Line, Date, Service, Billed, Contract amount, Difference, Clause, Status, Note. Add a second small table with total invoiced, confirmed overbilling, amount needing evidence and supported amount. No other text.

Download the response as an Excel file and open it. Sum the Difference column to confirm the values arrived as numbers, not text. Check the row count against your invoice sheet. Keep the original workbook unchanged as your record.

Do it in Chat AI App

Open Chat AI App and start a new conversation. Choose + → Files and attach the PDF and the spreadsheet to the same message. Wait for both to finish processing.

Start with AI Chat (Auto), which chooses a model for your request. You can also pick one from the model picker, such as Claude Opus 5.5 or GPT-6. Paste the two-pass prompt, confirm the quoted clauses, then ask for the row-by-row check.

For a second reading, switch to another model in the same conversation and ask it to recheck the Mismatch and Needs evidence rows. When the final table is ready, open the response’s Download menu and choose Excel (.xlsx).

Before you contact the supplier, confirm the quoted clauses match the PDF, the row count matches your sheet, and your formulas agree with the totals. Our Excel formula guide helps with the lookups. Plans are on the pricing page.

Common questions

Can I upload a PDF and an Excel file in the same message?
Yes. Chat AI App accepts several files in one message. Name each file in your prompt and say which one sets the rules and which one holds the records.
How do I know the AI checked every row?
Ask it to report how many rows it checked and compare that with your sheet. If the count is short, split the sheet or name the missing rows and ask again.
Can I use a scanned contract?
Scanned PDFs can be uploaded. Check every rate, date and clause number the answer quotes against the page image, because a misread digit changes every finding built on it.
Can I download the reconciliation as a spreadsheet?
Yes. Tables can be exported to Excel from the response’s Download menu. Open the file, confirm the numbers sum correctly, and keep your original workbook as the record.

Sources and further reading