MarkPrep
All posts
Published · Updated · 6 min

How to Give an LLM a Spreadsheet It Can Read

To give an LLM a spreadsheet it can read, convert the Excel workbook to Markdown tables and paste those. Copy a range of cells from Excel into a chat instead, and the LLM receives a stream of values separated by tabs and line breaks. It has no reliable way to know that "£4,200" belongs to March in the North region. The layout that made the grid readable to you is gone, and the LLM is left guessing which number goes with which label.

In Excel, a value's meaning comes from its row and column, and pasted text loses those positions. Converting Excel to Markdown turns the grid into a real Markdown table, where every value stays bound to its column header.

Why a Markdown table beats a pasted grid

A Markdown table is pipes and dashes:

| Region | Month | Revenue |
| --- | --- | --- |
| North | March | £4,200 |

Each row repeats the same columns, and the | characters mark where each column starts and ends. So the LLM never has to infer alignment from whitespace. The header row tells it what each column means. Ask "what was North's March revenue?" and the answer sits in one row, linked to its labels.

The parts that usually break

Four parts of a workbook need checking after conversion:

  • Multiple sheets. A workbook often holds several sheets. MarkPrep writes each sheet as a separate table, headed by the sheet's name.
  • Merged cells and headers. A merged cell's value lands in the first cell of the range, and the other cells come out blank. Multi-level headers don't map cleanly to a flat table, so check them after converting.
  • Empty rows. Spacer rows that made the sheet readable become noise in Markdown. MarkPrep skips fully blank rows.
  • Numbers and dates. Values come out as the sheet displays them, so currency symbols, thousands separators and date formats stay as you see them in Excel.

The Excel to Markdown converter handles both .xlsx and older .xls workbooks. It treats the first row of each sheet as the header row.

What about large spreadsheets?

Every cell, pipe and row of a Markdown table adds tokens. A sheet that looks small can be large once it is a table. Before you give a large table to the LLM, check its size with the token counter, which gives an estimate. If the table is over your model's context window, split it by sheet or by section instead of cutting a table halfway through.

Keep the data on your machine

Workbooks can hold financial models, pricing, customer lists or payroll. MarkPrep reads the workbook, walks the sheets and builds the tables in your browser, so the numbers are not uploaded.

Next step

Convert the spreadsheet first, check that each sheet's header row is right, then paste the tables into your LLM. For a single exported sheet, the CSV to Markdown converter does the same job.

Try it on your own file

Convert a document and watch the token counter. It's free, needs no account and uploads nothing.