Spreadsheet-RL: Advancing Large Language Model Agents on Realistic Spreadsheet Tasks via Reinforcement Learning

Paper · arXiv 2605.22642 · Published May 21, 2026
RL with Verifiable Rewards (RLVR)

Spreadsheet systems (e.g., Microsoft Excel, Google Sheets) play a central role in modern data-centric workflows. As AI agents grow increasingly capable of automating complex tasks, such as controlling computers and generating presentations, building an AI-driven spreadsheet agent has emerged as a promising research direction. Most existing spreadsheet agents rely on specialized prompting over general-purpose LLMs; while this design has potentials on simple spreadsheet operations, it struggles to manage the complex, multi-step workflows typical of real-world applications.

In this paper, we introduce Spreadsheet-RL, a reinforcement learning (RL) finetuning framework designed to train specialized spreadsheet agents within a realistic Microsoft Excel environment. Spreadsheet-RL features an automated pipeline for scalable collection of paired start-goal spreadsheets from online forums, as well as domain-specific evaluation tasks in areas such as finance and supply chain management, which we compile into the new Domain-Spreadsheet benchmark dataset. It also includes a Spreadsheet Gym environment designed for multi-turn RL: Spreadsheet Gym exposes extensive Excel functionality through a Python sandbox, along with a refined harness that incorporates a comprehensive tool set and carefully designed tool-routing rules for spreadsheet tasks. Through comprehensive experiments, we show that Spreadsheet-RL substantially enhances AI agent’s performance on both general and domain-specific spreadsheet tasks: it improves Qwen3-4B-Thinking-2507’s Pass@1 on SpreadsheetBench from 12.0% to 23.4%, and raises Pass@1 from 8.4% to 17.2% on our curated Domain-Spreadsheet dataset. These results highlight Spreadsheet-RL’s strong potential for generalization and real-world adoption in spreadsheet automation, and broadly, its promise for advancing LLM-based interactions with data interfaces in everyday work. We will release the training data, environment, and training pipeline to facilitate future research on spreadsheet agents.

Introduction. Spreadsheet systems, such as Microsoft Excel, Google Sheets, WPS Sheets, and LibreOffice, are widely adopted in data-centric workflows [7, 27]. They support tasks from personal activities such as travel planning and household budgeting, to professional duties such as financial modeling and data presentation [27, 19, 14]. As AI agents grow in both popularity and capability for automating tasks traditionally performed by humans, such as computer use and slide deck design [33, 15, 8, 37], the development of an AI agent for spreadsheets (a spreadsheet agent) to automate the human-operated spreadsheet-centered workflows will have the potential to fundamentally reshape how data science is performed at scale.

While there exists recent research such as SheetCopilot [17], SheetAgent [5], and ChatGPT Agent [24] studying spreadsheet agents, their approaches notably rely on proprietary (and powerful) Large Language Models (LLMs) with reasoning such as GPT-4o [13], which have sufficient general capabilities to perform simple spreadsheet operations via natural language instructions. That is, these works are limited in that they rely on advancements in general LLMs, and their prompting strategies, rather than specific improvements in how the LLM agents utilize spreadsheets. This limitation leads to existing spreadsheet agents struggling to reliably execute more complex, multi-step workflows that dominate real-world spreadsheet use; for example, the ChatGPT Agent and Copilot (both with excel access) [24], reach 45.5% and 20.0%, respectively, on SpreadsheetBench [18]. On the other hand, frontier industry labs have recently begun to develop specialized spreadsheet agents, yet adopt undisclosed approaches that rely on internal benchmarks and closed training pipelines [23, 20, 9].

One promising approach a powerful, specialized, and open-source spreadsheet agent can be built is reinforcement learning (RL) fine-tuning: following DeepSeek-R1 [11], on-policy RL combined with rule-based, verifiable outcome rewards has improved mathematical reasoning [28, 32], visual reasoning [36], and enabled scalable post-training for agentic domains such as software engineering [34, 35], web interaction [2], data [30, 22], and computer use [16, 37, 31]. However, applying the same approach to spreadsheets is challenging: Unlike many web or software tasks where success can be validated by unit tests or binary completion signals, final spreadsheets are produced by a long sequence of operations involving values, formulas, and layout. This leads to significant difficulties: 1⃝collecting sufficient initial–final spreadsheet pairs for training is expensive and difficult to scale for RL training; and 2⃝without step-by-step supervised fine-tuning data, which is even more costly to obtain, the agent must begin RL from a weak interaction policy. This makes a spreadsheet-specific harness essential for providing a structured action space and workflow prior that enable a meaningful initial success rate.

In this paper, we introduce Spreadsheet-RL, a framework for building specialized spreadsheet agents that, to the best of our knowledge, features the first end-to-end RL post-training method for the spreadsheet domain. Spreadsheet-RL differs from prior prompt-driven works by utilizing on-policy RL (e.g., GRPO [28]) in a real-world spreadsheet environment. First, for training data collection, Spreadsheet-RL features the automated Spreadsheet Data Agent that collects and constructs largescale realistic spreadsheet tasks for outcome-based rewards across specialized domains such as finance, human resources, and supply chain management; next, for performing operations, the Spreadsheet Gym—a multi-turn interactive Microsoft Excel environment integrated with a code sandbox, supports a broad range of advanced Excel functionalities. Finally, Spreadsheet-RL combines the components into a purpose-built asynchronous RL training framework that interfaces seamlessly with long-horizon, multi-turn spreadsheet interactions, supported by a carefully designed agent harness that incorporates a comprehensive tool set, refined tool-routing rules, and workflow for spreadsheet tasks.

We apply Spreadsheet-RL to the Qwen3 series Large Language Models [38] with GRPO [11] objectives to build specialized spreadsheet agents for evaluation on 1⃝SpreadsheetBench [18], the largest open-source benchmark, and 2⃝Domain-Spreadsheet, the first open-source domain-specific spreadsheet benchmark we curate. On SpreadsheetBench, Spreadsheet-RL improves Qwen3-4B- Thinking-2507 from 12.0% to 23.4% Pass@1. These gains, summarized in Figure 1, show how spreadsheet-native harness design, richer tool access, and RL post-training each improve the same 4B open-source base model. Our results also demonstrate that Spreadsheet-RL generalizes across real-world spreadsheet tasks from specialized domains: on Domain-Spreadsheet, Spreadsheet-RL improves overall pass@1 from 8.4% to 17.2% (Table 2).

Related work. This section overviews related work in automating spreadsheet workflows and recent developments and benchmark datasets for spreadsheet workflows necessary for applying RL fine-tuning to the spreadsheet domain.

Spreadsheet Workflow Automation. There exists a long line of work in automating spreadsheet manipulation covering a wide variety of techniques. Early work typically targeted specific, wellscoped tasks, such as automated string processing [10], detecting spreadsheet code smells [12], or clustering related cells [6]. More recent works such as SheetCopilot and SheetAgent [17, 5] utilize AI agents, formulating the desired spreadsheet operations in natural language while the agents interact with spreadsheets via programmatic interfaces such as Python-based environments or Excel tool APIs (e.g., MCP servers) [21]. These existing agent-based approaches largely focus on inference-time design and prompt engineering; in comparison, Spreadsheet-RL uniquely performs model-side agentic training via RL fine-tuning, enabling it to achieve significantly higher performance on more complex, multi-step spreadsheet workflows (Section 5).

Benchmark Datasets for Spreadsheets. Several recent works have introduced benchmark datasets and/or data collection methods for evaluating spreadsheet workflows. SpreadsheetBench [18] collects 912 paired initial–final spreadsheets from online forums with verification by 20 experts. SheetCopilot [17] synthesizes tasks from 28 workbooks. SheetAgent [5] performs evaluation with spreadsheetadjacent, table-centric QA benchmarks such as WikiTableQuestions [26] and TabFact [4]. OpenAI Agent uses proprietary internal spreadsheet datasets from domains such as investment banking to evaluate its performance [24]. That is, there currently does not exist an open-source framework dedicated to spreadsheets that features automated web-scale data collection; Spreadsheet-RL fills this gap by introducing a fully open-source, agent-driven pipeline for constructing large-scale spreadsheet workflows (i.e., initial–final spreadsheet pairs) from a wide variety of domains for benchmarking, which effectively supports RL training and evaluation of spreadsheet agents.

Method. Spreadsheet-RL follows the task formulation defined in SpreadsheetBench [18], where each task consists of (potentially multiple) initial spreadsheets Di, a natural-language instruction T, an oracle final spreadsheet DO (used for RL) representing the correct post-operation result of each task, and the manipulation regions M (e.g., target sheets and cell ranges) for reward computation only. The spreadsheet agent A—practically, a large language model that interleaves reasoning with programmatic interactions with the spreadsheet agent harness, must follow T to execute a sequence of spreadsheet operations TA to arrive at a final spreadsheet DA that matches the oracle DO.

To construct the initial dataset and environment for Spreadsheet-RL, we introduce Spreadsheet Data Agent, which automates spreadsheet task generation (Section 3.2.1), and Spreadsheet Gym with agent harness design, which enables LLM agents to interactively execute spreadsheet operations in real Microsoft Excel while interleaving these actions with reasoning traces (Section 3.2.2).

Large-scale spreadsheet task data is expensive to create from scratch through human annotation. To address this, we propose an automated spreadsheet data agent that constructs corpora of paired initial–final spreadsheets. Prior datasets for spreadsheet operations [19, 5] which are typically small in scale for RL training (only up to 912 spreadsheet pairs [18]), rely heavily on humans during data creation, and largely focus on LLM-synthesized, spreadsheet-agent table QA tasks [4]; in comparison, the spreadsheet data agent preserves realistic spreadsheet-specific task distributions via its scalable and automated collection of real-world spreadsheet problems from trusted sources such as online forums. It then transforms these into ready-to-use initial–final spreadsheet pairs through rigorous rule-based filtering and validation, all without the assistance of human experts.

Seed Metadata Collection. The spreadsheet data agent first curates seed metadata instances from high-quality public accessible online spreadsheet forum ExcelForum. Desirable seeds are forum posts that contain (1) a user-provided initial spreadsheet Di and a concrete task utilizing a wide range of advanced operations such as complex formulas, formatting, pivot tables, and VBA/macros, and (2) a discussion thread containing potential solutions to the provided task. Seeds are identified using simple heuristics, such as the presence of an attached spreadsheet and multi-turn response chains. For each seed, the information T includes proposed solutions from the discussion thread, intermediate explanations, and follow-up clarifications about the spreadsheet task.

Oracle Construction via Coding Agents. The oracle DO for each seed metadata instance is built via strong coding agents (e.g., Claude Code and Codex). The coding agent is prompted with the aforementioned initial workbook D and the collected task instructions and solution discussions T, and is instructed to generate an executable sequence of spreadsheet edits to perform the task. The coding agent executes the generated procedure on D in a real Excel environment (described shortly in Section 3.2.2) and records the resulting spreadsheet as the candidate oracle DO. Finally, quality checking is performed by applying rule-based filtering and verification (e.g., removing samples that trigger Excel errors and automatically validating that all values are computable via formulas) and discarding instances that fail verification.

The Spreadsheet Gym is a multi-turn environment enabling interactions with a real spreadsheet instance, coupled with carefully curated spreadsheet-native tool set and an open-source code sandbox [3] that allows the agent to execute Python for auxiliary computation to invoke structured APIs for stateful spreadsheet edits.

Execution fidelity. Spreadsheet Gym utilizes Microsoft Excel as its spreadsheet instance, which supports a rich set of advanced features and modern functions, including dynamic array formulas such as FILTER, UNIQUE, SORT, TAKE, and MAP, many of which are lacking in alternative engines such as LibreOffice Calc.

Conclusion. We present Spreadsheet-RL, the first end-to-end RL method specifically designed for training spreadsheet agents. In contrast to prior prompt-driven spreadsheet agents that depend on general-use and often proprietary LLM advances, Spreadsheet-RL establishes outcome-based, on-policy RL as a core mechanism for learning long-horizon spreadsheet workflows directly through environment interaction. Spreadsheet-RL unifies large-scale, domain-specific spreadsheet task construction with a multi-turn interactive Excel gym environment. On SpreadsheetBench, staged harness and RL improvements raise Pass@1 for a 4B open-source model from 12.0% to 23.4%. We also evaluate on our domain-specific benchmark, Domain-Spreadsheet, to study cross-domain generalization, where Spreadsheet-RL improves overall pass@1 from 8.4% to 17.2% (Table 2). Our results establish RL fine-tuning as a promising paradigm for scalable and reproducible spreadsheet automation. We discuss the limitations and broader impact of Spreadsheet-RL in Appendix A.1 and A.3, respectively.

Lines of inquiry this paper opens 16

Research framings built by reading the notes related to this paper — the questions it feeds into.

What makes AI failures visible and contestable to users? How can reward models overcome their inherent blindspots and biases? Can RL enable genuinely new reasoning or just optimize existing capabilities? What hidden capabilities and concerning behaviors do frontier models already exhibit? What perception approach enables GUI agents to work most effectively? How do inference costs and infrastructure economics shape AI adoption? Can visual rendering-based rewards effectively improve code and layout quality? What limits AI's ability to verify its own generation? Does AI assistance redirect workers toward higher-value tasks or amplify workload? How does the placement of validation gates affect multi-agent workflow security?