Spreadsheets
How Parse handles Excel, CSV, and other spreadsheet inputs, with one result page per sheet, options for sub-tables, formulas, and hidden sheets, and the DCF template example.
Parse accepts spreadsheet files as input and returns each sheet as one page of the result. A sheet becomes a markdown table that keeps its row and column positions, so a worksheet with a title block, an assumptions block, and two forecast tables stacked vertically comes back as one grid you can read top to bottom. A few input_options.spreadsheet controls change how messy sheets are split up and how formulas are evaluated.
When to use it
Section titled “When to use it”- Financial models, budgets, and forecasts where the cell values matter and the layout is not a single clean table.
- Workbooks with several logical tables stacked in one sheet, separated by blank rows.
- Files that were edited but never recalculated, so cached formula values are stale.
- Exports and data dumps in
csv,tsv, orodsthat you want in the same markdown form as everything else.
Supported inputs include xlsx, xls, csv, tsv, numbers, and ods, plus xlsm, xlsb, dif, sylk, dbf, and others listed under Supported document types. The Excel example uses the agentic tier, a strong default for table-heavy documents.
Options
Section titled “Options”| Option | Type | Default | What it does |
|---|---|---|---|
input_options.spreadsheet.detect_sub_tables_in_sheets | boolean | unset | Find and extract several tables within one sheet instead of merging them. Useful when data regions are separated by blank rows or columns. |
input_options.spreadsheet.force_formula_computation_in_sheets | boolean | unset | Recompute formula cells instead of using cached values. Enable for files edited but never recalculated, or templates with placeholder values. Can slow parsing on formula-heavy sheets. |
input_options.spreadsheet.include_hidden_sheets | boolean | unset | Parse hidden sheets as well as visible ones. By default, hidden sheets are skipped. |
output_options.save_output_pdf | boolean | unset | A PDF copy of the parsed document; not produced for spreadsheet, plain-text, or audio inputs. |
These options apply to spreadsheet inputs and are ignored for other file types. The reverse direction, writing tables found in a PDF out as an XLSX workbook, is output_options.tables_as_spreadsheet; see Tables.
Example
Section titled “Example”Parse a workbook and print the second sheet:
from llama_cloud import LlamaCloud
client = LlamaCloud() # reads LLAMA_CLOUD_API_KEY from the environment
result = client.parsing.parse( file_id="FILE_ID", # an .xlsx uploaded with client.files.create(file=..., purpose="parse") tier="agentic", version="latest", input_options={ "spreadsheet": { "detect_sub_tables_in_sheets": True, "force_formula_computation_in_sheets": True, } }, expand=["markdown"],)
# One result page per sheet, in workbook order; page_number 2 is the second sheetsecond_sheet = next(p for p in result.markdown.pages if p.success and p.page_number == 2)print(second_sheet.markdown)What you get
Section titled “What you get”The markdown for a sheet is a pipe table whose columns match the sheet’s columns, with empty cells left empty. This excerpt is the second sheet of the DCF template from the Excel example, which stacks an instructions block, an assumptions block, and a forecast table in one sheet:
|Discounted Cash Flow Excel Template|||||||||||||-|-|-|-|-|-|-|-|-|-|-|-||Assumptions|||||||||||||Tax Rate|20%||||||||||||Discount Rate|15%||||||||||||||||||||||||||5 Year Weighted Moving Average|||||||||||||Year 1|Year 2|Year 3|Year 4|Year 5|Year 6|Year 7|Year 8|Year 9|Year 10|Terminal Value||Pre-tax income|50,000.00|55,000.00|45,000.00|52,000.00|60,000.00||||||||Net Cash Flow|20,000.00|27,000.00|23,000.00|29,600.00|35,000.00|29,093.33|29,817.78|30,177.48|30,469.23|30,379.74|287,188.00||Discounting Factor||||||0.8696|0.7561|0.6575|0.5718|0.4972|0.4972|Because the whole sheet is one grid, joining the pages into a prompt gives a model enough context to answer questions such as which years’ income taxes equal 20% of pre-tax income. The Excel example finishes with exactly that: a small question-answering step over the parsed markdown.
See also
Section titled “See also”- Parse and analyze Excel spreadsheets: the full example in Python, TypeScript, Go, Java, and the CLI, with the optional question-answering step
- Configuring Parse: spreadsheets
- Supported document types for every spreadsheet format Parse accepts
- Tables for table output from PDFs and scans, including XLSX export