Manuscript Offprint
arXiv:2610.24729fxBench: Evaluating and Understanding Formula Suggestions in Spreadsheets
Sanket Mhatre
Proximal
Sumit Gulwani
Microsoft, USA
Yu Le
Microsoft, USA
Yasharth Bajpai
Microsoft, India
Gust Verbruggen
Microsoft, Belgium
Abstract
Spreadsheets are among the most widely used tools for computations, and formulas are their core building blocks. Besides agentic spreadsheet tools, proactive formula suggestions enable significant productivity gains and are now available in popular spreadsheet software (Microsoft Excel and Google Sheets). Such suggestions pose interesting challenges: the right context must be collected and represented for a machine learning model, which must then be able to write a correct formula, in a way that is fast and cheap enough to trigger on every = (or subsequent keystrokes for auto-completion) without taking users out of their editing flow. Surprisingly, there is no public benchmark for formula suggestions on real spreadsheets. In this paper, we therefore (1) introduce fxBench as a manually curated benchmark of 503 formula suggestion tasks based on Sheetpedia, (2) break down the formula suggestion problem into four capabilities—gather context, understand context, understand intent, write formula—that a formula suggestion system requires, and (3) evaluate existing and new approaches to understand bottlenecks in these capabilities that pose interesting research directions. Specifically, we annotate each benchmark with the cells that describe intent to determine the theoretical performance limit of a given context selection strategy, we evaluate performance of small and large models on different representations of context—including a dense format with high theoretical coverage at low token counts—and we fine-tune smaller language models to show that we can learn to understand such dense formats. Additionally, we perform quantitative and qualitative analysis on failure modes to understand bottlenecks in the formula writing capability—the best configuration only achieved 58.8% correct suggestions.
1 Introduction
Spreadsheets are among the most widely used computational tools in the world, and formulas are the computational backbone of every spreadsheet. Yet, writing such formulas is still tedious and prone to errors for end-users [Gulwani, 2011, Hermans et al., 2012]. Modern spreadsheet assistants aim to resolve this by allowing users to describe specifications in natural language. Often, however, the required context is already there, and describing it requires more keystrokes or precise language than
Work completed while at Microsoft.
Copilot in Microsoft Excel, Gemini in Google Sheets, or external tools like Shortcut, Claude for Excel, ChatGPT for Excel, and more.
Preprint.
Figure 1: The formula suggestion workflow. Given a spreadsheet and a target cell (left), a preprocessing step extracts and serializes the relevant context (middle), which is passed to an LLM that predicts the formula (right).


simply writing the formula. Excel and Google Sheets therefore both expose formula suggestions that trigger when users type the = sign, indicating that they are about to write a formula.
SpreadsheetCoder [Chen et al., 2021b] introduced this task—suggesting a formula from the surrounding context—as a research problem, but (1) did not introduce a public benchmark, (2) relied on a fixed and local context that limits applicability, (3) used embeddings (BERT, 40M parameters, 512 tokens context) to predict formulas using LSTMs, which limited capabilities compared to modern decoder models. In this paper, we tackle each of these limitations with the following main contributions.
We present fxBench, the first benchmark for formula suggestions, which consists of of 503 manually verified cases spanning 147 Excel formula types across 441 real workbooks from the Sheetpedia corpus [Tian et al., 2025]. Each case consists of a workbook, a target cell, and either the expected formula (454 cases) or an abstention indicator where we expect no formula because the intent is not clearly specified (49 cases). An example of the formula suggestion problem and language model solution is shown in Figure 1.
We break down formula suggestions in four capabilities by annotating each problem with the spreadsheet cells that describe the intent for that formula (and release those annotations), as well as a natural language description. This allows us to perform isolated experiments on context gathering, representation understanding, intent understanding, and formula writing.
We evaluate pre-trained and fine-tuned models on fxBench to understand key properties of the formula suggestion problem, including (1) the effect of context gathering (higher theoretical performance, lower actual performance) and representation (9.1% difference between best and worst) using inference-only models, and (2) the effect of supervised fine-tuning on smaller open models (Qwen3, Yang et al. [2025]), showing that the dense spreadsheet representation can be taught (pass@1 +11.1%, pass@3 +18.2%, best@8 +23.5% on the 8B model), that gains begin to saturate within Sheetpedia, and that fine-tuned models often produce a correct formula in their top-k candidates but struggle to rank it first (best@8 exceed pass@1 by +16.8% for 8B and +20.7% pp on 14B).
Figure 2: The fxBench curation pipeline.

sheetCoder [Chen et al., 2021b] predicts formulas from semi-structured spreadsheet context; Fortap [Cheng et al., 2022] uses formulas for numerical reasoning aware table pretraining and evaluates formula prediction; HermEs [He et al., 2023] improves formula prediction through hierarchical formula expansion and an interactive completion interface; and Auto-Formula [Chen et al., 2024] recommends formulas by retrieving and adapting formulas from similar spreadsheets. None of these release a curated benchmark or support generic and novel formulas based on surrounding intent. Other formula oriented tasks change the available specification: FLAME [Joshi et al., 2024] models formula syntax and prefix completion, NL2Formula [Zhao et al., 2024] uses explicit natural-language intent, and FoRepBench [Singha et al., 2025] repairs faulty formulas.
Recent work also studies broader spreadsheet agents and table representations for LLMs. Spreadsheet-Bench [Ma et al., 2024], SheetCopilot [Li et al., 2023], Finch [Dong et al., 2025], and InstructExcel [Payan et al., 2023] evaluate spreadsheet manipulation from explicit natural language tasks, with tools and multi-turn interaction. They measure broad workflow completion rather the inline authoring moment. Separately, table and spreadsheet representation work shows that serialization, sampling, packing, and structure-aware encoding strongly affect LLM performance [Sui et al., 2024a,b, Dong et al., 2024]. Table-specialized models have also improved reasoning through pretraining, instruction tuning, learned table encoders, and parameter-efficient adaptation [Wang et al., 2021, Yin et al., 2020, Herzig et al., 2020, He et al., 2025, Zhang et al., 2024, Xing et al., 2025, Zhang et al., 2025, Liu et al., 2021]. Sheetpedia [Tian et al., 2025] provides a corpus of 300K real-world spreadsheets, and serves as the source corpus for fxBench.
3 fxBench
fxBench is a benchmark of 503 manually verified formula completion records spanning 147 unique Excel formula types across 441 distinct spreadsheets. We use Sheetpedia—a collection of 300K spreadsheets compiled from enterprise email archives, public web crawls, and Excel forums, covering domains like financial models, inventory tracking, and academic data—as the source of spreadsheets [Tian et al., 2025]. Each record consists of (1) a version of the workbook with potential leaks removed, (2) the ground-truth formula authored by the original user, and (3) the target cell.
3.1 Construction
An overview of the curation process is shown in Figure 2. We briefly highlight the three main steps in this section. Full details, examples, and LLM prompts are provided in Appendix A.
Filtering We filter files that are encrypted, corrupted, or , (2) files with sheets with cells cells, formula ratio , not English, has any external link, and (3) files with functions that are not in the Excel 365 standard library. This reduces 211K workbooks down to 53.6K, yielding formulas.
To control redundancy, we apply two levels of de-duplication. Sketch de-duplication replaces literal arguments with typed placeholders (SUM(<range>)) and keeps one record per (workbook, sketch) pair, retaining 335K formulas across 136K unique sketches. Signature de-duplication further abstracts each sketch into a tuple of (ordered function list, operator group set, nesting depth), where operators are binned into arithmetic, comparison, and concatenation. For example, the sketches SUM (<range>), SUM(<int>), and SUM(<cell>, <cell>, <cell>) all share the signature (SUM) | | 1 (one function, no operators, depth one) but differ in argument structure. This collapses 136K sketches into 15,845 signatures. 23,963 representative sketches are selected per signature—maximizing frequency, complexity, and argument-style diversity—which are then sampled at up to 5 formulas per sketch, yielding 35,253 candidates.
Annotation and Ranking We annotate each candidate and select a ranked subset for manual review. Symbolic annotations are target cell location relative to tables and blobs, reference types, and sheet size. An LLM annotates each candidate with the dominant contextual intent available in the worksheet: column header, row label, adjacent formula, adjacent value, combination, or no hint (based on local context + local context of references). These categories describe what cues are present, not what models use, and are only used to curate a balanced distribution across hint types. De-duplication based on intent and greedy diversity selection (Appendix A.1.2) reduce 35,253 candidates to 8,277 spanning 296 functions.
Manual Curation and Verification Two challenges remain. To address leakage—cells below or to the right of the target often follow obvious patterns a model can copy rather than infer—we build the state of the workbook as it plausibly existed at the moment the user was about to write the formula, which is also the state an inline formula completion system observes at inference time. A two-pass LLM pipeline segments the sheet into logical regions and their ordering, and strips regions added after the region with the target cell (Appendix A.1.3). Within the target region, we remove formulas with the same template below and to the right of the target formula. To address solvability, we inspect both the original workbook and the snapshot, and retain a record only if the snapshot preserves enough context to infer the target formula while removing post-target leakage. Each snapshot is reviewed for formula correctness, context sufficiency, task realism, and solvability without external domain knowledge. A subset of 49 records are flagged as abstain: target cells where no formula should reasonably be written, testing a model's ability to withhold prediction when context is insufficient. The 8,277 candidates reduce to the final 503 verified records spanning 147 formula types: 145 Excel functions, expression-only formulas and abstention cases.
3.2 Evaluation
Execution-based Evaluation We evaluate by execution, not string match, to avoid false negatives for equivalent formulas such SUM(A1:A10) and A1+A2+...+A10. We write the predicted and ground-truth formulas into the target cell and compare their formatted displayed values.
Metrics TP (predicted and expected display values match), FP (prediction parsed but produced wrong value or error value), TN (abstention expected and model abstained), FN (formula expected but model abstained). We report pass@k accuracy as the primary metric [Chen et al., 2021a].
Through xlwings: www.xlwings.org.
Table 1: Properties of fxBench.
| Feature | % of Records |
|---|---|
| Target cell location | |
| Inside structured region (table cell) | 62.0% |
| Adjacent to structured region | 33.4% |
| Unstructured | 4.6% |
| Formula reference types | |
| Range reference (A1:A10) | 59.2% |
| Cell reference (A1) | 58.4% |
| Absolute reference (1) | 47.5% |
| Cross-sheet reference | 8.5% |
| Whole row/column (A:A) | 8.3% |
| Named reference | 4.8% |
| Intent hint source (strongest contextual clue) | |
| Column header | 44.3% |
| Row label | 31.6% |
| Adjacent formula | 10.5% |
| Combination | 9.9% |
| No hint | 2.0% |
| Adjacent values | 1.6% |
Not mutually exclusive
Figure 3: fxBench distribution by function category, nesting depth, and formula length

| Depth | Count | Length | Count |
|---|---|---|---|
| 0 | 46 | 0–25 | 105 |
| 1 | 144 | 25–50 | 161 |
| 2 | 113 | 50–75 | 63 |
| 3 | 94 | 75–100 | 36 |
| 4 | 49 | 100–200 | 63 |
| 5 | 26 | 200–300 | 15 |
| 6+ | 31 | 300+ | 11 |
Figure 4: Minisheet representation. Blob detection finds contiguous non-empty regions; edge extraction keeps boundary cells; semantic grouping emits a compact view of values, numeric clusters, formulas and tables sections.

4 Decomposing Formula Suggestions
We break down the formula suggestion problem into four main capabilities that are needed: context gathering, context understanding, intent understanding and formula writing. In the following three subsections—intent and formula are combined—we perform experiments that evaluate properties of these capabilities to determine core challenges for future work on this problem.
4.1 Context Gathering
Given a spreadsheet and a target cell, the first challenge is determining the right context: the cells that provide the relevant intent. There is a trade-off between the size of the context and the theoretical performance of formula suggestions under that context. Motivations for keeping the context small are speed, cost, and the needle-in-a-haystack effect [Gao et al., 2026, Li et al., 2025].
To analyze context gathering without the effects of context understanding and formula writing, we annotate each problem with the cells that describe its intent. We build a small, local context of all cells within 4 rows and columns of the target cell and each corner of a range (B6:F23 → (B6, F6, B23, F23)) and use an LLM (GPT 5.2) to select the cells that describe the direct intent (like “Total”) and data description (like “Cats”). Full Details are provided in Appendix B.2.
Given any serialization (prompt) of a context gatherer, we expect (1) all direct intent to be printed (address inferable, content visible) and (2) all data intent and data references to be mentioned—this is a heuristic upper limit on the performance of an oracle agent (Refer Appendix B.1).
We consider the following serializations:
-
Full-sheet serialization. Render each non-empty (address, value) pair in a sheet. Token cost grows linearly with sheet size, prohibitive for non-trivial spreadsheets.
-
Windowed Context. Windowed approaches restrict serialization to a fixed region around the target cell. We evaluate two pipe-delimited variants: Viewport (20 rows, 10 columns centered on the target cell) and SpreadsheetCoder [Chen et al., 2021b], a tighter window augmented with the detected table header row. Both are token-bounded but lose coverage when relevant cells fall outside the window.
-
SheetCompressor [Dong et al., 2024] compresses spreadsheets through three sequential modules: structural-anchor extraction, inverted-index translation (merges cells with identical values into a value-keyed dictionary), and data-format aware aggregation into type-address tuples. String cells with arbitrary values preserve their exact text, and formulas are rendered individually with full text. The approach achieves full coverage with substantial token reduction on regular tabular layouts.
-
We introduce Minisheet, a compact context representation for inline formula completion, based on simple ideas: (1) detect blobs on non-empty cells using flood fill, (2) print the boundary string cells of each blob, (3) collapse sibling formulas, (4) leverage the inverted-index translation from SheetCompressor to print every numeric range (clustered by format string), and (5) explicitly print information from structured tables. This is shown in Figure 4.
Table 2: Required-cell exposure coverage and token cost by context strategy on fxBench.
| Context | Intent printed | Intent mentioned | Ref. printed | Ref. mentioned | Upper | Tok (Avg) | Tok (Median) |
|---|---|---|---|---|---|---|---|
| Pipe-delimited | 100.0% | 100.0% | 100.0% | 100.0% | 100.0% | 19,984 | 3,128 |
| Viewport (20 × 10) | 82.1% | 82.1% | 70.8% | 70.8% | 69.0% | 2,603 | 1,913 |
| Viewport (30 × 20) | 94.6% | 94.6% | 85.7% | 85.7% | 85.1% | 3,806 | 2,574 |
| Viewport (40 × 30) | 98.2% | 98.2% | 90.1% | 90.1% | 89.9% | 4,533 | 2,881 |
| SpreadsheetCoder | 74.8% | 74.8% | 61.8% | 61.8% | 59.0% | 1,806 | 1,364 |
| SheetCompressor | 90.5% | 100.0% | 43.5% | 100.0% | 94.6% | 5,156 | 1,372 |
| Minisheet (w = 1) | 80.7% | 91.8% | 34.0% | 90.1% | 78.1% | 1,736 | 673 |
| Minisheet (w = 2) | 86.3% | 98.6% | 35.4% | 96.6% | 88.3% | 1,798 | 725 |
| Minisheet (w = 3) | 87.1% | 99.4% | 35.6% | 98.4% | 90.5% | 1,817 | 732 |
| Minisheet (w = 4) | 87.5% | 99.8% | 35.6% | 99.0% | 91.5% | 1,842 | 738 |
Table 2 shows the how many of the required cells are mentioned and printed, as well as token statistics (cl100k_base) for each method. Figure 19 shows how the median number of tokens grows in function of # of non-empty cells for different approaches.
Local context is not sufficient Full-sheet serialization guarantees coverage but is prohibitively expensive—especially for large sheets (20K average versus 3.1K median). Window-based methods are cheaper, but miss long-range dependencies: increasing the viewport from to leaves about of problems without all required evidence, while increasing median tokens by . The gap is larger for references than for intent, suggesting that local context often captures nearby labels but misses distant data ranges. Minisheet and SpreadsheetCoder instead combine global summarization of potential data ranges with local structural anchors.
Mentioning unlocks dense representations By focusing on printing key string values and mentioning clustered numeric ranges, Minisheet is able to produce a very dense representation, losing at most theoretical coverage compared to the biggest viewport at fewer tokens. SheetCompressor also uses blob-based heuristics (based on tracking changes between subsequent rows and columns) and achieves high coverage, but also prints significantly more values references) yielding a increase in median # of tokens.
Intent lives on the edges of blobs Increasing the border width in Minisheet yields diminishing returns for printing intent after ( versus ) indicating that intent lives on these edges. The gap to printing all intent happens due to semantic blobs being connected, which SheetCompressor's detection based on row and column differences catches.
Neither SpreadsheetCoder nor SheetCompressor has an official public implementation; we re-implement both following the original papers. Reference code is released with fxBench.
?
fxBench enables controlled experiments on context gathering for formula suggestions.
4.2 Representation Understanding
Table 3: Content strategy baselines on fxBench.
| Class | Representation | GPT 5.2 | Sonnet 4.6 | Qwen3-8B | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| ACC | OVL | ACC | OVL | ACC | OVL | |||||
| F | HTML | 58.3 | 58.3 | 67.6 | 60.0 | 60.0 | 71.0 | 20.7 | 20.7 | 36.1 |
| CSV | 49.7 | 49.7 | 63.5 | 53.3 | 53.3 | 64.9 | 9.3 | 9.3 | 21.6 | |
| JSON | 56.9 | 56.9 | 67.1 | 60.4 | 60.4 | 69.7 | 14.5 | 14.5 | 30.6 | |
| Markdown | 53.3 | 53.3 | 66.1 | 54.7 | 54.7 | 67.5 | 11.3 | 11.3 | 25.2 | |
| Pipe-delimited | 58.8 | 58.8 | 66.3 | 59.8 | 59.8 | 69.9 | 12.1 | 12.1 | 27.4 | |
| W | Viewport | 56.9 | 82.4 | 64.9 | 58.4 | 84.7 | 67.4 | 14.1 | 20.5 | 27.9 |
| SpreadsheetCoder | 52.9 | 89.6 | 62.7 | 57.1 | 96.7 | 68.0 | 14.7 | 24.9 | 27.3 | |
| D | SheetCompressor | 54.7 | 57.8 | 64.8 | 50.7 | 53.6 | 63.7 | 11.3 | 12.0 | 25.4 |
| MiniSheet | 42.3 | 48.0 | 54.3 | 49.7 | 56.3 | 62.8 | 12.5 | 14.2 | 26.5 | |
To evaluate context (and representation) understanding, we perform zero-shot experiments on all formats from Section 4.1, with five strategies for representing the full sheet: HTML, CSV, JSON, Markdown and pipe-delimited. Table 3 shows results for GPT 5.2 (non-reasoning) and Claude Sonnet 4.6 as representative frontier models, and Qwen3-8B as a small open model. The relevant metrics are accuracy relative to upper bound (ACC, to separate gathering from understanding) and the % of references that was correctly recovered (OVL, can the model infer data references from context).
Dense representations expose an understanding bottleneck. Minisheet, despite having among the highest theoretical coverage (+29.3% over SpreadsheetCoder and +19.3% over Viewport), is much less usable by frontier models. SpreadsheetCoder improves over Minisheet by +41.6% ACC for GPT 5.2 and +40.4% for Sonnet 4.6. Windowed methods are mostly limited by missing evidence, while dense methods are limited by whether the model can understand the representation.
Mentioned ranges are not yet reliably usable. Minisheet's compression comes from mentioning references instead of printing them: at , reference mention coverage is +61.2% higher than reference print coverage. However, these mentioned ranges are not reliably grounded back into cell addresses. For GPT 5.2, Minisheet has -10.6% OVL compared to Viewport and -13.3% compared to HTML; Sonnet 4.6 shows the same trend (-4.6% and -8.2%). The main bottleneck is therefore dense numeric range clusters not being understood. Minisheet is a good representation to study if we can teach these representations (through fine-tuning or prompting).
Models are (still) sensitive to representation. Even when representing the exact same information, newer frontier models still suffer from divergent performance on different table representations [Singha et al., 2023] with GPT 5.2 (-9.1% ACC) and Sonnet 4.6 (-7.1% ACC) having significant differences between the best and worst format—they also do not agree. Minisheet uses a pipe-delimited representation, which is a compact mapping-based format that works well (JSON is mapping based).
?
fxBench enables research on (1) finding representations that are dense and understandable, and (2) training models to understand dense representations.
4.3 Understanding intent
To analyze the intent understanding capability, we perform zero-shot inference with oracle context. The base oracle context contains the referenced cells and their values, the function names, and the annotated intent cells. Seven variants are (1) + cell format (if available), (2) + dependency chain (of formula references and intermediate values), (3) + same column (other formulas in target column with their computed values), (4) + neighbor ( viewport), (5) + all formulas in the worksheet, (6)
Table 4: Oracle results on fxBench (GPT 5.2). Variants are additive over base. TP does not include abstention.
| Oracle variant | TP | ACC | |
|---|---|---|---|
| base | 57.1 | 66.2 | — |
| + cell format | 57.1 | 66.2 | +0.0 |
| + dependency chain | 63.2 | 72.4 | +6.2 |
| + same column | 63.4 | 70.8 | +4.6 |
| + neighbor | 67.4 | 70.6 | +4.4 |
| + formulas | 66.2 | 71.4 | +5.2 |
| all of the above | 72.4 | 76.9 | +10.7 |
| + NL | 88.1 | 97.2 | +31.0 |
Figure 5: Failure modes

- all of the above, (7) + an LLM annotated natural language description of the target formula. The results are in Table 4. Further details, examples and qualitative analysis is discussed in Appendix B.3.
Formula writing is mostly intent understanding. With oracle evidence but no explicit description, GPT 5.2 reaches only 66.2% ACC, despite being given the referenced cells, their values, function names, and intent cells. This shows that the bottleneck is not simply producing valid spreadsheet syntax, but inferring what computation the author intended from ambiguous spreadsheet evidence. The strongest structured signals are those that indirectly reveal intent: dependency chains (+6.2%), worksheet formulas (+5.2%), same-column formulas (+4.6%), and neighbors (+4.4%). Formatting gives no gain, suggesting that surface-level presentation is much less useful than cues about how nearby values are computed.
Structured context provides weak intent supervision Spreadsheet context helps most when it reveals the intended operation: wrong formula type failures drop from 77 to 43 with all structured signals. However, wrong ranges remain flat (15 to 16), partial matches only slightly improve (19 to 14), and wrong abstentions increase (15 to 26). Thus, structured context often makes the computation more plausible, but not precise enough to determine exact arguments, ranges, or answerability.
Explicit intent nearly solves formula writing Adding natural language raises accuracy to 97.2% (+31.0% over base), and collapses almost all failure modes: wrong formula type drops from 77 to 1, while wrong arguments and wrong ranges disappear. This suggests that GPT 5.2 can usually write the formula once intent is explicit. The remaining bottleneck is therefore intent understanding: turning labels, layout, values, and formulas into the intended operation.
fxBench enables controlled experiments on intent understanding with oracle context, separating failures caused by missing evidence from failures caused by composing the wrong formula.
5 Fine-Tuning for Compact Context
To overcome the gap between Minisheet's high theoretical coverage and poor zero-shot usability, models must learn how to interpret dense compact context. We therefore fine-tune Qwen3 [Yang et al., 2025] models directly on Minisheet and evaluate (1) if supervised training can turn compact open models into useful formula completion systems, (2) the effect of model size and dataset scaling. The training data is constructed from the remaining Sheetpedia workbooks, excluding all workbooks used in manual review (8,277 candidates). Appendix C gives dataset construction and training details. Table 5 shows pass@1 and pass@3 (both over 8 generations) and best@8 (any correct in eight candidates correct).
Fine-tuning teaches representation and intent understanding. Zero-shot Qwen3 models remain near 10% pass@1 under Minisheet, suggesting that larger base models (1) do not automatically know how to use dense spreadsheet context, (2) struggle to infer intent from that context. After supervised fine-tuning, however, all models improve substantially in pass@1 (+11.1% for 8B) and show even higher gains when pass@3 (+18.2% for 8B) and best@8 (+23.5%) control for clarity about the intent. This is not just the model learning to write harder formulas: in best@8 we see +12.9% from simple formulas (details in Appendix C.1) and +23.5% from additional curation, indicating that the model is also learning the representation.
Performance begins to saturate within Sheetpedia. Increasing scale within the same data source yields only modest gains. Scaling up curated data slightly improves over the base 25K dataset on sampled metrics, reaching the best pass@3 (30.5%) and best@8 (38.8%), but is -0.6% lower on pass@1. Scaling up even more (2×) reduces all three metrics relative to Scaled (-1.0% pass@1, -1.3% pass@3, -1.4% best@8). Model scale shows a similar pattern: under the same Curated data, 14B is essentially on par with 8B, with -1.7% pass@1, -0.1% pass@3 and only +2.2% best@8. Together, these results suggest that progress is beginning to saturate on the remaining Sheetpedia distribution. Further gains may require curating more diverse supervision from additional sources.
A remaining bottleneck is ranking intent, not generating candidates. Even after fine-tuning, pass@higher k remains much stronger than pass@1. For 8B on Curated, best@8 exceeds pass@1 by +16.8%; for 14B, the gap is +20.7%. The model thus often produces a correct formula somewhere in a small set of samples. That pattern is consistent with intent uncertainty: the model can often guess plausible computations, but cannot reliably identify which one the spreadsheet author intended. Interestingly, fine-tuning does not hurt diversity. This motivates further work on generate-and-rank [Ni et al., 2023], or top-k suggestion UX for formula suggestions [Chen et al., 2025].

fxBench enables research on (1) teaching dense spreadsheet representations to (smaller) models for efficient formula suggestions, (2) synthetic data generation for formula suggestions, (3) intent disambiguation and ranking, (4) and user experience research on formula suggestions.
6 Limitations and Future Work
fxBench has a few limitations, most notably, as (1) only considering suggestions within one worksheet, (2) the intent annotations do not consider partial intent sufficiency, and (3) being scoped to English workbooks only. None of these limitations diminish our contributions: fxBench is a solid starting point to encourage research fast, cheap and qualitative formula suggestions. Besides improving the benchmark, fxBench enables new research on different aspects and capabilities for in-line formula suggestions (marked with ♡).
Table 5: Combined fine-tuning results on fxBench, comparing model size on Curated training data and dataset choice at fixed Qwen3-8B scale using eight sampled completions per problem.
| Comparison | Model | Training data | Records | pass@1 | pass@3 | best@8 |
|---|---|---|---|---|---|---|
| Base context | Qwen3-4B | - | - | 10.8% | 12.6% | 13.9% |
| Base context | Qwen3-8B | - | - | 9.7% | 12.2% | 14.5% |
| Base context | Qwen3-14B | - | - | 10.0% | 13.4% | 15.5% |
| Model size | Qwen3-4B | Curated | 25,614 | 16.5% | 25.7% | 32.8% |
| Model size / anchor | Qwen3-8B | Curated | 25,614 | 21.2% | 30.4% | 38.0% |
| Model size | Qwen3-14B | Curated | 25,614 | 19.5% | 30.3% | 40.2% |
| Dataset | Qwen3-8B | Random | 25,000 | 11.3% | 17.3% | 22.1% |
| Dataset | Qwen3-8B | Simple Only | 25,000 | 14.1% | 21.2% | 27.4% |
| Dataset | Qwen3-8B | Complex Only | 25,000 | 14.8% | 23.5% | 31.2% |
| Dataset | Qwen3-8B | Scaled | 39,161 | 20.6% | 30.5% | 38.8% |
| Dataset | Qwen3-8B | Scaled 2× | 50,000 | 19.6% | 29.2% | 37.4% |
| Closed-model reference | GPT-5.2 | - | - | 40.2% | 48.0% | 53.9% |
7 Conclusion
We introduce fxBench, a benchmark of 503 in-line formula suggestion problems that consist of (workbook, target cell, expected formula or abstention marker) triples. Each problem is further annotated with (1) cells that describe the intent, (2) cells that describe data sources, (3) and six other pieces of oracle information; to facilitate controlled experiments on different capabilities: context gathering, representation understanding, intent understanding, and formula writing. We perform experiments to motivate further research, by (1) highlighting that dense representations are less understandable, (2) that intent understanding and disambiguation is a key problem, (3) that we can teach models to understand dense representations and detecting candidate intents (more diversity after fine-tuning).
References
Mark Chen, Jerry Tworek, Heewoo Jun, Qiming Yuan, Henrique Ponde De Oliveira Pinto, Jared Kaplan, Harri Edwards, Yuri Burda, Nicholas Joseph, Greg Brockman, et al. Evaluating large language models trained on code. arXiv preprint arXiv:2107.03374, 2021a.
Sibei Chen, Yeye He, Weiwei Cui, Ju Fan, Song Ge, Haidong Zhang, Dongmei Zhang, and Surajit Chaudhuri. Auto-formula: Recommend formulas in spreadsheets using contrastive learning for table representations. Proceedings of the ACM on Management of Data, 2(3):1–27, 2024.
Valerie Chen, Alan Zhu, Sebastian Zhao, Hussein Mozannar, David Sontag, and Ameet Talwalkar. Need help? designing proactive ai assistants for programming. In Proceedings of the 2025 CHI Conference on Human Factors in Computing Systems, pages 1–18, 2025.
Xinyun Chen, Petros Maniatis, Rishabh Singh, Charles Sutton, Hanjun Dai, Max Lin, and Denny Zhou. Spreadsheetcoder: Formula prediction from semi-structured context. In International Conference on Machine Learning, pages 1661–1672. PMLR, 2021b.
Zhoujun Cheng, Haoyu Dong, Ran Jia, Pengfei Wu, Shi Han, Fan Cheng, and Dongmei Zhang. Fortap: Using formulas for numerical-reasoning-aware table pretraining. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 1150–1166, 2022.
Haoyu Dong, Jianbo Zhao, Yuzhang Tian, Junyu Xiong, Mengyu Zhou, Yun Lin, José Cambronero, Yeye He, Shi Han, and Dongmei Zhang. Encoding spreadsheets for large language models. In Proceedings of the 2024 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 20728–20748. Association for Computational Linguistics, 2024.
Haoyu Dong, Pengkun Zhang, Yan Gao, Xuanyu Dong, Yilin Cheng, Mingzhe Lu, Adina Yakefu, and Shuxin Zheng. Finch: Benchmarking finance & accounting across spreadsheet-centric enterprise workflows. arXiv preprint arXiv:2512.13168, 2025.
Yunfan Gao, Yun Xiong, Wenlong Wu, Bohan Li, Yijie Zhong, and Haofen Wang. U-niah: Unified rag and llm evaluation for long context needle-in-a-haystack. ACM Transactions on Information Systems, 44(3):1–30, 2026.
Sumit Gulwani. Automating string processing in spreadsheets using input-output examples. In Proceedings of the 38th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL '11, page 317–330, New York, NY, USA, 2011. Association for Computing Machinery. ISBN 9781450304900. doi: 10.1145/1926385.1926423. URL https://doi.org/10.1145/1926385.1926423.
Wanrong He, Haoyu Dong, Yihuai Gao, Zhichao Fan, Xingzhuo Guo, Zhitao Hou, Xiao Lv, Ran Jia, Shi Han, and Dongmei Zhang. HermEs: Interactive spreadsheet formula prediction via hierarchical formulet expansion. In Anna Rogers, Jordan Boyd-Graber, and Naoaki Okazaki, editors, Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 8356–8372, Toronto, Canada, July 2023. Association for Computational Linguistics. doi: 10.18653/v1/2023.acl-long.465. URL https://aclanthology.org/2023.acl-long.465/.
Xinyi He, Yihao Liu, Mengyu Zhou, Yeye He, Haoyu Dong, Shi Han, Zejian Yuan, and Dongmei Zhang. Tablelora: Low-rank adaptation on table structure understanding for large language models. In Proceedings of the 63rd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 22376–22391, 2025.
Felienne Hermans, Ben Sedee, and Arie van Deursen. Measuring spreadsheet formula understandability. In Proceedings of the EuSpRIG 2012 Conference. EuSpRIG, 2012. URL https://pinzger.github.io/papers/Hermans2012-understandability.pdf.
Jonathan Herzig, Pawel Krzysztof Nowak, Thomas Müller, Francesco Piccinno, and Julian Eisenschlos. Tapas: Weakly supervised table parsing via pre-training. In Proceedings of the 58th annual meeting of the association for computational linguistics, pages 4320–4333, 2020.
Harshit Joshi, Abishai Ebenezer, José Cambronero Sanchez, Sumit Gulwani, Aditya Kanade, Vu Le, Ivan Radiček, and Gust Verbruggen. Flame: A small language model for spreadsheet formulas. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 38, pages 12995–13003, 2024.
Hongxin Li, Jingran Su, Yuntao Chen, Qing Li, and Zhao-Xiang Zhang. Sheetcopilot: Bringing software productivity to the next level through large language models. Advances in Neural Information Processing Systems, 36:4952–4984, 2023.
Tianle Li, Ge Zhang, Quy Duc Do, Xiang Yue, and Wenhu Chen. Long-context LLMs struggle with long in-context learning. Transactions on Machine Learning Research, 2025. ISSN 2835-8856.
Qian Liu, Bei Chen, Jiaqi Guo, Morteza Ziyadi, Zeqi Lin, Weizhu Chen, and Jian-Guang Lou. Tapex: Table pre-training via learning a neural sql executor. arXiv preprint arXiv:2107.07653, 2021.
Zeyao Ma, Bohan Zhang, Jing Zhang, Jifan Yu, Xiaokang Zhang, Xiaohan Zhang, Sijia Luo, Xi Wang, and Jie Tang. Spreadsheetbench: Towards challenging real world spreadsheet manipulation. Advances in Neural Information Processing Systems, 37:94871–94908, 2024.
Ansong Ni, Srini Iyer, Dragomir Radev, Veselin Stoyanov, Wen-tau Yih, Sida Wang, and Xi Victoria Lin. Lever: Learning to verify language-to-code generation with execution. In International Conference on Machine Learning, pages 26106–26128. PMLR, 2023.
Justin Payan, Swaroop Mishra, Mukul Singh, Carina Negreanu, Christian Poelitz, Chitta Baral, Subhro Roy, Rasika Chakravarthy, Benjamin Van Durme, and Elnaz Nouri. Instructexcel: A benchmark for natural language instruction in excel. In Findings of the Association for Computational Linguistics: EMNLP 2023, pages 4026–4043, 2023.
Ananya Singha, José Cambronero, Sumit Gulwani, Vu Le, and Chris Parnin. Tabular representation, noisy operators, and impacts on table structure understanding tasks in llms. In NeurIPS 2023: Second Table Representation Learning Workshop, 2023.
Ananya Singha, Harshita Sahijwani, Walt Williams, Emmanuel Aboah Boatang, Nick Hausman, Miguel Di Luca, Keegan Choudhury, Chaya Binet, Vu Le, Tianwei Chen, et al. Benchmark dataset generation and evaluation for excel formula repair with llms. 2025.
Yuan Sui, Mengyu Zhou, Mingjie Zhou, Shi Han, and Dongmei Zhang. Table meets llm: Can large language models understand structured table data? a benchmark and empirical study. In Proceedings of the 17th ACM International Conference on Web Search and Data Mining, pages 645–654, 2024a.
Yuan Sui, Jiaru Zou, Mengyu Zhou, Xinyi He, Lun Du, Shi Han, and Dongmei Zhang. Tap4llm: Table provider on sampling, augmenting, and packing semi-structured data for large language model reasoning. In Findings of the Association for Computational Linguistics: EMNLP 2024, pages 10306–10323, 2024b.
Zailong Tian, Zhuoheng Han, Houfeng Wang, and Lizi Liao. Sheetpedia: A 300k-spreadsheet corpus for spreadsheet intelligence and LLM fine-tuning. In The Thirty-ninth Annual Conference on Neural Information Processing Systems Datasets and Benchmarks Track, 2025. URL https://openreview.net/forum?id=4vLYwlA3X5.
Zhiruo Wang, Haoyu Dong, Ran Jia, Jia Li, Zhiyi Fu, Shi Han, and Dongmei Zhang. Tuta: Tree-based transformers for generally structured table pre-training. In Proceedings of the 27th ACM SIGKDD Conference on Knowledge Discovery & Data Mining, pages 1780–1790, 2021.
Junjie Xing, Yeye He, Mengyu Zhou, Haoyu Dong, Shi Han, Dongmei Zhang, and Surajit Chaudhuri. Table-llm-specialist: Language model specialists for tables using iterative fine-tuning. In Proceedings of the 2025 Conference on Empirical Methods in Natural Language Processing, pages 35431–35448, 2025.
An Yang, Anfeng Li, Baosong Yang, Beichen Zhang, Binyuan Hui, Bo Zheng, Bowen Yu, Chang Gao, Chengen Huang, Chenxu Lv, et al. Qwen3 technical report. arXiv preprint arXiv:2505.09388, 2025.
Pengcheng Yin, Graham Neubig, Wen-tau Yih, and Sebastian Riedel. Tabert: Pretraining for joint understanding of textual and tabular data. In Proceedings of the 58th annual meeting of the association for computational linguistics, pages 8413–8426, 2020.
Tianshu Zhang, Xiang Yue, Yifei Li, and Huan Sun. Tablellama: Towards open large generalist models for tables. In Proceedings of the 2024 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies (Volume 1: Long Papers), pages 6024–6044, 2024.
Xiaokang Zhang, Sijia Luo, Bohan Zhang, Zeyao Ma, Jing Zhang, Yang Li, Guanlin Li, Zijun Yao, Kangli Xu, Jinchang Zhou, et al. Tablellm: Enabling tabular data manipulation by llms in real office usage scenarios. In Findings of the Association for Computational Linguistics: ACL 2025, pages 10315–10344, 2025.
Wei Zhao, Zhitao Hou, Siyuan Wu, Yan Gao, Haoyu Dong, Yao Wan, Hongyu Zhang, Yulei Sui, and Haidong Zhang. Nl2formula: Generating spreadsheet formulas from natural language queries. In Findings of the Association for Computational Linguistics: EACL 2024, pages 2377–2388, 2024.
Appendices
A fxBench
A.1 fxBench Construction Details
A.1.1 Phase 1: Programmatic Filtering
Beyond the file and sheet thresholds reported in §3.1, we also drop workbooks containing VBA macros, cap worksheet count per workbook at 50, and exclude sheets composed entirely of formulas with no input data or just formulas and no data.
§3.1 introduces sketch and signature de-duplication; we expand on the example side here.
Sketch examples.
Signature example.
Three functions in nesting order, one comparison-operator group, nesting depth two.
Hierarchy. Counts at each abstraction level:
| functions | signatures | sketches | formulas | |
|---|---|---|---|---|
| count | 148 | 15,845 | 136K | 24.6M |
Why both levels. Sketch de-duplication alone leaves many structurally identical patterns; signature de-duplication alone collapses useful argument diversity. The three formulas
all share signature (SUM) | | 1 (one function, no operators, depth one) but their sketches—SUM(<range>), SUM(<int>, <int>, <int>), and SUM(<cell>, <cell>, <cell>)—capture distinct authoring styles: a contiguous range, literal integers, and an explicit cell list. Both levels are needed to control redundancy while preserving this kind of variety.
A.1.2 Phase 2: Annotation and Ranking
Programmatic annotation computes structural attributes derivable directly from the workbook.
Target cell location. Each target cell is classified by its position relative to structured regions (Figure 6): inside_ctrl_t (inside a structured Excel Table), inside_blob (inside a contiguous rectangular region that is not a formal Table), adjacent_ctrl_t / adjacent_blob (immediately bordering such a region but not part of it), and unstructured (neither inside nor adjacent to any structured region).
Reference types. Each formula is annotated with the types of references it uses (not mutually exclusive): cell_ref (A1), range_ref (A1:A10), absolute_ref (1), cross_sheet_ref (Sheet2!A1), whole_row_col_ref (A:A), and named_ref (revenue_total).
Sheet-size bucket. The worksheet is assigned to a size bucket based on total cell count, enabling downstream analysis of model performance across sheet scales.
LLM-based intent cue classification annotates each record with its strongest available intent hint. For each record, we extract a row, column window around the target cell, serialize it as a markdown table with the target cell marked as [TARGET] and formulas preserved as strings, and pass it to GPT-5.2 using the prompt in Listing 1. The judge returns three fields: location classification, intent hint source, and a one-sentence description of what the formula computes. These labels describe what cues are present, and these are only used as an axis for sampling to curate a balanced distribution across intent cue types. Table 1 reports the distribution across fxBench.

Figure 6: Target cell location categories on a single worksheet. Dashed blue marks a structured Excel Table (Ctrl+T); dashed purple marks a blob. Each formula is color-coded by its location class: =SUM(E3:E6) is inside_ctrl_t, =SUM(I3:I5) is inside_blob, =E71.1 is adjacent_ctrl_t, and =A9B10+3 is unstructured.
Intent-aware de-duplication groups record by (signature, intent hint source), and we caps formulas per group. Informative hint categories (col_header, row_label, adjacent_formula, combination) are capped at 3 records per signatures, weaker hint categories (adjacent_values, no_hint) at 5, preserving coverage of structurally unusual records. Within each group, records are drawn from distinct workbooks via shuffled round-robin sampling with a fixed seed.
Greedy diversity selection operates within each primary-function bucket, defined by the outermost function in the formula (e.g., SUMIFS, VLOOKUP, IF), capped at 100 records per function. At each step, the candidate maximizing a composite score is selected and the score components are updated before the next pick. The score combines four signals:
• Signature rarity: rewards previously unseen structural signatures.
• Intent-source rarity: favors under-represented hint categories.
• Workbook novelty: prefers records from workbooks not yet selected.
• Nesting complexity: a small bonus for deeper formulas.
Functions like IF and bare arithmetic expressions exhibit wide internal variety (e.g., simple conditionals vs. deeply nested ones), so we subdivide their budgets proportionally across complexity tiers before applying greedy selection.
A.1.3 Phase 3: Manual Curation and Verification
The third phase converts ranked candidates into a verified benchmark through three steps.
Temporal Snapshots. A spreadsheet at corpus collection time reflects its final state, including formulas authored after the target cell. Cells later in the sheet may follow obvious patterns, allowing a model to copy rather than predict. No prior spreadsheet benchmark controls for this. We generate a plausible historical snapshot of each workbook; an approximation of the state the user likely saw before entering the target formula. We use a two pass LLM pipeline illustrated in Figure 7.
Pass 1: Segmentation. The target sheet is rendered as a dense markdown table with Excel-style row and column labels. An LLM is asked to partition all non-empty cells into non-overlapping logical regions, each with a type, range and dependency list (Figure 8). The pipeline then identifies the region containing the target cell and reconstructs a focused version of the sheet, retaining only the
You are an expert spreadsheet analyst. You will be given a spreadsheet region as a markdown table, a target cell location, and the formula in that cell.
The target cell is marked with [TARGET] in the table. Formulas in other cells are shown as their formula strings (e.g., =B2+C2), not their computed values.
Spreadsheet Context
{markdown_table}
Target cell: {cell_location} Formula: {formula}
Annotations Required
1. Location Classification
table_cell- Inside a structured table or rectangular data region with clear headerstable_adjacent- Within 5 cells of a structured tableunstructured- No obvious tabular structure nearby
2. Intent Hint
Pick the single strongest hint source:
col_header- A column header describes the intentrow_label- A row label describes the intentadjacent_formula- Neighboring cells contain similar formulas suggesting a patternadjacent_values- A pattern in adjacent cell values hints at the computationcombination- Multiple hint sources contribute equallyno_hint- No clear contextual clue available
3. Intent Description
In one short sentence, describe what this formula computes.
Respond ONLY with JSON: { "location": "...", "intent_hint": {"source": "...", "hint_text": "..."}, "intent_description": "..."} }
Listing 1: Prompt used for LLM-based intent cue classification. Template variables {markdown_table}, {cell_location}, and {formula} are filled per record.

Figure 7: Temporal snapshot pipeline
regions the formula depends on and all data tables. The result is a chronologically ordered subset of the sheet containing only the context that would have existed at the time the user was about to write the formula.
Pass 2: Cleaning. The focused workbook is re-rendered to dense markdown and a second LLM identifies ranges to delete (Figure 8). The cleaning pass assumes a plausible authoring order: top-to-bottom, left-to-right. It deletes cells sharing the same logical role as the target that appear later in authoring order, while preserving cells referenced by the formula, headers and labels, raw input regions, and cells serving different logical roles. When uncertain, the LLM is instructed to prefer preservation over deletion. Deleted cells are blanked without shifting coordinates, keeping all formula references stable.
You are an expert Excel analyst. Identify logical segments in the sheet.
Region Types:
- "data_table": Structured table with headers
- "calculation_section": Formulas/computed results separate from main tables
- "sheet_title_header": Main title/heading
- "text_description": Notes, instructions
- "miscellaneous": Other content
Principles:
- Separate different business purposes
- Follow content to its natural end
- Use section headers for groupings
- Prioritize logical function over layout
Requirements:
- Unique integer 'id' starting from 0
- 'range' in Excel notation (e.g. "A1:G32")
- Cover ALL non-empty cells, no overlap
- Include 'dependencies' listing region IDs
Output: { "regions": [ {"id": 0, "range": "A1:G32", "type": "data_table", "dependencies": []}, {"id": 1, "range": "J7:K9", "type": "calculation_section", "dependencies": [0]} ] }
You are an expert Excel analyst. Identify cell ranges to DELETE to create a historical snapshot--the state BEFORE a specific formula was written.
Core Assumptions:
- Users populate top-to-bottom, left-to-right
- Raw data entered BEFORE referencing formulas
- Earlier time periods before later ones
Deletion Rules: Delete cells logically written after the active cell. Use headers/labels to identify the active cell's role (e.g. "Total", "Sum"). Delete cells sharing that role authored after.
Authoring order:
- Reading: same row right, then rows below
- Temporal: later period columns come later
Preservation Rules (Never Delete):
- Cells referenced by the active formula
- Row/column headers providing context
- Data regions the formula operates on
- Raw input data regions
- Cells with different logical roles
Output: { "regions_to_delete": ["A10:D20", "G15"] }
NEVER delete referenced cells. When uncertain, prefer preservation.
(a) Segmentation (Pass 1).
(b) Cleaning (Pass 2).
Figure 8: System prompts for the temporal snapshot pipeline.
Figure 9 and Figure 10 shows a real before-and-after example from FxBench.
Saturation pruning. Beyond the four criteria of manual review listed in §3.1, we also drop records whose pattern is already sufficiently represented—e.g., column totals such as =SUM(B2:B10) that recur in near-identical form across many workbooks.
ABSTAIN records. A small subset of candidates are flagged as ABSTAIN, target cells where no formula should reasonably be written or where intent is ambiguous even to a human reviewer. For example, a cell adjacent to a data table with no header, no row label, and no siblings formulas to suggest what computation in expected. These test a model's ability to recognize when context is insufficient and withhold a prediction than guess.
A.2 Release Statement
fxBench will be released under CC BY-SA 4.0, inherited from Sheetpedia. We respect the original license and redistribute content only within the terms they allow. The construction pipeline and evaluation code will also be publicly released.
| C25 | :=COUNTIF(CX4,TEXT(24,"HH:MM")&*") | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | ||
| 1 | ||||||||||||||||
| 2 | 23-Oct | 10-Sep | 14-Sep | 15-Sep | 19-Oct | 22-Oct | 19-Aug | 21-Oct | 20-Oct | 7-Aug | 26-Oct | 27-Oct | 4-Sep | 5-Sep | ||
| 3 | Tuesday | Monday | Friday | Saturday | Friday | Monday | Sunday | Sunday | Saturday | Tuesday | Friday | Saturday | Tuesday | Wednesday | ||
| 4 | A | 0:00-18:0 | 0:00-18:0 | 0:00-18:0 | 0:00-18:0 | 0:00-18:0 | 0:00-18:0 | 0:00-18:0 | 0:00-18:0 | 0:00-18:0 | 0:00-18:0 | 0:00-18:0 | 0:00-18:0 | 0:00-18:0 | 0:00-18:0 | |
| 5 | B | 3:00-21:0 | 3:00-21:0 | 3:00-21:0 | 3:00-21:0 | 3:00-21:0 | 3:00-21:0 | 3:00-21:0 | 3:00-21:0 | 3:00-21:0 | 3:00-21:0 | 3:00-21:0 | 3:00-21:0 | 3:00-21:0 | 3:00-21:0 | |
| 6 | C | OFF | 6:00-14:0 | 6:00-14:0 | 6:00-14:0 | 7:00-15:0 | 6:00-14:0 | OFF | OFF* | OFF/VAC* | OFF/VAC* | OFF/VAC* | OFF/VAC* | OFF/VAC* | 7:00-15:0 | |
| 7 | D | OFF/STAT* | OFF | 3:00-21:0 | 3:00-21:0 | OFF* | 3:00-21:0 | OFF/VAC* | OFF/VAC* | 00-06:00 | 00-06:00 | 00-06:00 | 3:00-21:0 | 3:00-21:0 | 7:00-15:0 | |
| 8 | E | OFF/STAT | OFF | OFF | 00-06:00 | 4:00-22:0 | 00-06:00 | 7:00-15:0 | 7:00-15:0 | 4:00-22:0 | 4:00-22:0 | 4:00-22:0 | 5:00-23:0 | 5:00-23:0 | OFF | |
| 9 | F | OFF/VAC* | 6:00-00:0 | 6:00-00:0 | 6:00-00:0 | OFF/VAC* | OFF* | 5:00-23:0 | 6:00-00:0 | 5:00-23:0 | 5:00-23:0 | 5:00-23:0 | 6:00-14:0 | 6:00-14:0 | 00-06:00 | |
| 10 | G | 7:00-15:0 | 4:00-22:0 | 4:00-22:0 | 4:00-22:0 | OFF | OFF | 6:00-14:0 | 6:00-14:0 | 0:00-18:0 | 0:00-18:0 | OFF | 7:00-15:0 | 7:00-15:0 | 0:00-18:0 | |
| 11 | H | 5:00-23:0 | 6:00-14:0 | 6:00-14:0 | 6:00-14:0 | 5:00-23:0 | 6:00-14:0 | 00-06:00 | 00-06:00 | 4:00-22:0 | 4:00-22:0 | OFF | 5:00-23:0 | 5:00-23:0 | 7:00-15:0 | |
| 12 | I | OFF | OFF/VAC* | OFF/VAC* | OFF/VAC* | 00-06:00 | OFF/VAC* | OFF | OFF | 7:00-15:0 | 7:00-15:0 | 7:00-15:0 | 6:00-14:0 | 6:00-14:0 | OFF/STAT | |
| 13 | J | OFF | 7:00-15:0 | 7:00-15:0 | MORN | 6:00-14:0 | OFF* | OFF | OFF | OFF | OFF/VAC* | OFF/VAC* | OFF | 4:00-22:0 | 4:00-22:0 | |
| 14 | K | 6:00-14:0 | 7:00-15:0 | 7:00-15:0 | 7:00-15:0 | 6:00-14:0 | 7:00-15:0 | 4:00-22:0 | OFF/STAT | 6:00-00:0 | 6:00-00:0 | 6:00-00:0 | OFF | OFF | 6:00-14:0 | |
| 15 | L | OFF | 30-06:30 | 30-06:30 | OFF/STAT* | 30-06:30 | OFF/VAC* | 30-06:30 | 30-06:30 | OFF | 30-06:30 | 30-06:30 | 30-06:30 | 30-06:30 | 30-06:30 | |
| 16 | M | 4:00-22:0 | 00-06:00 | 00-06:00 | 00-06:00 | 4:00-22:0 | 00-06:00 | 5:00-23:0 | 5:00-23:0 | OFF | OFF | 6:00-14:0 | 7:00-15:0 | 7:00-15:0 | 6:00-14:0 | |
| 17 | N | 7:00-15:0 | 7:00-15:0 | 7:00-15:0 | 7:00-15:0 | 7:00-15:0 | 7:00-15:0 | 2:00-20:0 | 2:00-20:0 | 3:00-21:0 | 3:00-21:0 | 3:00-21:0 | 4:00-22:0 | 4:00-22:0 | 4:00-22:0 | |
| 18 | ||||||||||||||||
| 19 | ||||||||||||||||
| 20 | ||||||||||||||||
| 21 | ||||||||||||||||
| 22 | ||||||||||||||||
| 23 | Shift Start Times - Total | |||||||||||||||
| 24 | 6:00 | 7:00 | 10:00 | 12:00 | 13:00 | 14:00 | 15:00 | 16:00 | 22:00 | Off | ||||||
| 25 | A | 0 | 0 | 35 | 23 | 6 | 0 | 0 | 0 | 0 | 37 | |||||
| 26 | B | 0 | 0 | 3 | 13 | 46 | 0 | 0 | 0 | 0 | 36 | |||||
| 27 | C | 5 | 25 | 0 | 0 | 0 | 7 | 15 | 1 | 5 | 43 | |||||
| 28 | D | 0 | 17 | 9 | 8 | 10 | 0 | 1 | 4 | 7 | 44 | |||||
| 29 | E | 10 | 12 | 0 | 0 | 0 | 19 | 10 | 0 | 5 | 44 | |||||
| 30 | F | 13 | 3 | 0 | 0 | 0 | 14 | 10 | 5 | 9 | 43 | |||||
| 31 | G | 7 | 24 | 10 | 1 | 2 | 15 | 3 | 0 | 3 | 35 | |||||
| 32 | H | 15 | 7 | 3 | 0 | 0 | 13 | 14 | 3 | 8 | 38 | |||||
| 33 | I | 8 | 24 | 0 | 2 | 2 | 0 | 14 | 2 | 5 | 40 | |||||
| 34 | J | 22 | 10 | 0 | 0 | 2 | 11 | 4 | 3 | 7 | 39 | |||||
| 35 | K | 25 | 11 | 6 | 0 | 0 | 7 | 0 | 4 | 5 | 43 | |||||
| 36 | L | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 41 | |||||
| 37 | M | 20 | 17 | 1 | 4 | 4 | 11 | 5 | 3 | 5 | 30 | |||||
| 38 | N | 11 | 13 | 1 | 2 | 5 | 10 | 7 | 8 | 10 | 33 | |||||
| 39 | ||||||||||||||||
| 40 | Weekend | Saturday/Sunday Off | ||||||||||||||
| 41 | A | |||||||||||||||
| 42 | B | |||||||||||||||
| 43 | C | |||||||||||||||
| 44 | D | |||||||||||||||
| 45 | E | |||||||||||||||
| 46 | F | |||||||||||||||
| 47 | G | |||||||||||||||
| 48 | H | |||||||||||||||
| 49 | I | |||||||||||||||
| 50 | J | |||||||||||||||
| 51 | K | |||||||||||||||
| 52 | L | |||||||||||||||
| 53 | M | |||||||||||||||
| 54 | N | |||||||||||||||
| 55 | ||||||||||||||||
| 56 | ||||||||||||||||
Figure 9: Temporal snapshot: before.
| C25 | ✓ | : | × | ✓ | fx | ✓ | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | |||
| 1 | |||||||||||||||||
| 2 | 23-Oct | 10-Sep | 14-Sep | 15-Sep | 19-Oct | 22-Oct | 19-Aug | 21-Oct | 20-Oct | 7-Aug | 26-Oct | 27-Oct | 4-Sep | 5-Sep | |||
| 3 | Tuesday | Monday | Friday | Saturday | Friday | Monday | Sunday | Sunday | Saturday | Tuesday | Friday | Saturday | Tuesday | Wednesday | |||
| 4 | A | 0:00-18:0 | 0:00-18:0 | 0:00-18:0 | 0:00-18:0 | 0:00-18:0 | 0:00-18:0 | 0:00-18:0 | 0:00-18:0 | 0:00-18:0 | 0:00-18:0 | 0:00-18:0 | 0:00-18:0 | 0:00-18:0 | 0:00-18:0 | ||
| 5 | B | 3:00-21:0 | 3:00-21:0 | 3:00-21:0 | 3:00-21:0 | 3:00-21:0 | 3:00-21:0 | 3:00-21:0 | 3:00-21:0 | 3:00-21:0 | 3:00-21:0 | 3:00-21:0 | 3:00-21:0 | 3:00-21:0 | 3:00-21:0 | ||
| 6 | C | OFF | 6:00-14:0 | 6:00-14:0 | 6:00-14:0 | 7:00-15:0 | 6:00-14:0 | OFF | OFF* | OFF/VAC* | OFF/VAC* | OFF/VAC* | OFF/VAC* | OFF/VAC* | 7:00-15:0 | ||
| 7 | D | OFF/STAT | OFF | 3:00-21:0 | 3:00-21:0 | OFF* | 3:00-21:0 | OFF/VAC* | OFF/VAC* | 00-06:00 | 00-06:00 | 00-06:00 | 4:30-21:0 | 3:00-21:0 | 7:00-15:0 | ||
| 8 | E | OFF/STAT | OFF | OFF | 00-06:00 | 4:00-22:0 | 00-06:00 | 7:00-15:0 | 7:00-15:0 | 4:00-22:0 | 4:00-22:0 | 4:00-22:0 | 5:00-23:0 | 5:00-23:0 | OFF | ||
| 9 | F | OFF/VAC* | 6:00-00:0 | 6:00-00:0 | 6:00-00:0 | OFF/VAC* | OFF* | 5:00-23:0 | 6:00-00:0 | 5:00-23:0 | 5:00-23:0 | 5:00-23:0 | 6:00-14:0 | 6:00-14:0 | 00-06:00 | ||
| 10 | G | 7:00-15:0 | 4:00-22:0 | 4:00-22:0 | 4:00-22:0 | OFF | OFF | 6:00-14:0 | 6:00-14:0 | 0:00-18:0 | 0:00-18:0 | OFF | 7:00-15:0 | 7:00-15:0 | 0:00-18:0 | ||
| 11 | H | 5:00-23:0 | 6:00-14:0 | 6:00-14:0 | 6:00-14:0 | 5:00-23:0 | 6:00-14:0 | 00-06:00 | 00-06:00 | 4:00-22:0 | 4:00-22:0 | OFF | 5:00-23:0 | 5:00-23:0 | 7:00-15:0 | ||
| 12 | I | OFF | OFF/VAC* | OFF/VAC* | OFF/VAC* | 00-06:00 | OFF/VAC* | OFF | OFF | 7:00-15:0 | 7:00-15:0 | 7:00-15:0 | 6:00-14:0 | 6:00-14:0 | OFF/STAT | ||
| 13 | J | OFF | 7:00-15:0 | 7:00-15:0 | MORN | 6:00-14:0 | OFF* | OFF | OFF | OFF | OFF/VAC* | OFF/VAC* | OFF | 4:00-22:0 | 4:00-22:0 | ||
| 14 | K | 6:00-14:0 | 7:00-15:0 | 7:00-15:0 | 7:00-15:0 | 6:00-14:0 | 7:00-15:0 | 4:00-22:0 | OFF/STAT | 6:00-00:0 | 6:00-00:0 | 6:00-00:0 | OFF | OFF | 6:00-14:0 | ||
| 15 | L | OFF | 30-06:30 | 30-06:30 | OFF/STAT | 30-06:30 | OFF/VAC* | 30-06:30 | 30-06:30 | OFF | 30-06:30 | 30-06:30 | 30-06:30 | 30-06:30 | 30-06:30 | ||
| 16 | M | 4:00-22:0 | 00-06:00 | 00-06:00 | 00-06:00 | 4:00-22:0 | 00-06:00 | 5:00-23:0 | 5:00-23:0 | OFF | OFF | 6:00-14:0 | 7:00-15:0 | 7:00-15:0 | 6:00-14:0 | ||
| 17 | N | 7:00-15:0 | 7:00-15:0 | 7:00-15:0 | 7:00-15:0 | 7:00-15:0 | 7:00-15:0 | 2:00-20:0 | 2:00-20:0 | 3:00-21:0 | 3:00-21:0 | 3:00-21:0 | 4:00-22:0 | 4:00-22:0 | 4:00-22:0 | ||
| 18 | |||||||||||||||||
| 19 | |||||||||||||||||
| 20 | |||||||||||||||||
| 21 | |||||||||||||||||
| 22 | |||||||||||||||||
| 23 | Shift Start Times - Total | ||||||||||||||||
| 24 | 6:00 | 7:00 | 10:00 | 12:00 | 13:00 | 14:00 | 15:00 | 16:00 | 22:00 | Off | |||||||
| 25 | A | 0 | |||||||||||||||
| 26 | |||||||||||||||||
| 27 | |||||||||||||||||
| 28 | |||||||||||||||||
| 29 | |||||||||||||||||
| 30 | |||||||||||||||||
| 31 | |||||||||||||||||
| 32 | |||||||||||||||||
| 33 | |||||||||||||||||
| 34 | |||||||||||||||||
| 35 | |||||||||||||||||
| 36 | |||||||||||||||||
| 37 | |||||||||||||||||
| 38 | |||||||||||||||||
| 39 | |||||||||||||||||
| 40 | |||||||||||||||||
| 41 | |||||||||||||||||
| 42 | |||||||||||||||||
| 43 | |||||||||||||||||
| 44 | |||||||||||||||||
| 45 | |||||||||||||||||
| 46 | |||||||||||||||||
| 47 | |||||||||||||||||
| 48 | |||||||||||||||||
| 49 | |||||||||||||||||
| 50 | |||||||||||||||||
| 51 | |||||||||||||||||
| 52 | |||||||||||||||||
| 53 | |||||||||||||||||
| 54 | |||||||||||||||||
| 55 | |||||||||||||||||
| 56 | |||||||||||||||||
| 57 | |||||||||||||||||
Figure 10: Temporal snapshot: after.

Figure 11: Sheet Size Distribution
Table 6: Exhaustive per-category function inventory of fxBench. Every distinct function is listed under its Excel category with its record count in parentheses.
| Statistical (36 functions, 139 records) | |||
|---|---|---|---|
| AVERAGE (17) | COUNTIFS (16) | COUNTIF (15) | MIN (13) |
| MAX (12) | LARGE (10) | COUNTA (7) | COUNT (4) |
| INTERCEPT (4) | SMALL (4) | AVERAGEIF (3) | AVERAGEIFS (3) |
| FORECAST (3) | MINIFS (3) | LINEST (2) | STDEV.P (2) |
| MAXA (2) | AVERAGEA (1) | CORREL (1) | COUNTBLANK (1) |
| FORECAST.LINEAR (1) | MAXIFS (1) | MINA (1) | MODE.MULT (1) |
| NORM.S.INV (1) | PEARSON (1) | PERCENTILE.INC (1) | QUARTILE.EXC (1) |
| RSQ (1) | STDEV.S (1) | TRIMMEAN (1) | MEDIAN (1) |
| SLOPE (1) | TREND (1) | VAR.S (1) | STDEVA (1) |
| Math & trigonometry (38 functions, 128 records) | |||
| ABS (22) | SUMPRODUCT (14) | SUMIF (13) | SUM (8) |
| AGGREGATE (6) | INT (6) | EXP (5) | MOD (5) |
| ROUNDUP (4) | MROUND (3) | CEILING (2) | CEILING.MATH (2) |
| COS (2) | FLOOR (2) | LN (2) | MMULT (2) |
| ROUNDDOWN (2) | SQRT (2) | SUBTOTAL (2) | SUMIFS (2) |
| POWER (2) | QUOTIENT (2) | LOG (2) | SERIESSUM (2) |
| ACOS (1) | ATAN (1) | DEGREES (1) | GCD (1) |
| LOG10 (1) | PRODUCT (1) | ROUND (1) | SIN (1) |
| SUMSQ (1) | SUMXMY2 (1) | TRUNC (1) | SIGN (1) |
| TAN (1) | RADIANS (1) | ||
| Date & time (20 functions, 49 records) | |||
| HOUR (9) | DATE (6) | DATEDIF (6) | DAY (4) |
| DATEVALUE (3) | MONTH (3) | DAYS (2) | EDATE (2) |
| NETWORKDAYS (2) | TIMEVALUE (2) | DAYS360 (1) | MINUTE (1) |
| NETWORKDAYS.INTL (1) | YEAR (1) | WORKDAY (1) | EOMONTH (1) |
| WORKDAY.INTL (1) | WEEKNUM (1) | YEARFRAC (1) | WEEKDAY (1) |
| Lookup & reference (9 functions, 43 records) | |||
| LOOKUP (11) | INDEX (9) | MATCH (7) | VLOOKUP (6) |
| HLOOKUP (4) | XLOOKUP (3) | CHOOSE (1) | INDIRECT (1) |
| TRANSPOSE (1) | |||
| Financial (19 functions, 33 records) | |||
| FV (6) | NPV (5) | IRR (3) | PRICE (2) |
| PV (2) | DB (2) | ACCRINT (1) | COUPNCD (1) |
| COUPPCD (1) | CUMIPMT (1) | FVSCHEDULE (1) | IPMT (1) |
| NPER (1) | PMT (1) | PPMT (1) | RATE (1) |
| SLN (1) | YIELD (1) | XIRR (1) | |
| Logical (5 functions, 28 records) | |||
| IF (11) | IFERROR (7) | AND (5) | IFS (3) |
| IFNA (2) | |||
| Text (7 functions, 11 records) | |||
| CONCAT (3) | RIGHT (2) | TRIM (2) | CODE (1) |
| CONCATENATE (1) | VALUE (1) | REPT (1) | |
| Compatibility (7 functions, 9 records) | |||
| QUARTILE (3) | CONFIDENCE (1) | MODE (1) | PERCENTILE (1) |
| RANK (1) | STDEV (1) | STDEVP (1) | |
| Database (2 functions, 2 records) | |||
| DMAX (1) | DSUM (1) | ||
| Engineering (1 functions, 1 records) | |||
| CONVERT (1) | |||
| Information (1 functions, 1 records) | |||
| N (1) | |||
| Abstain (1 functions, 49 records) | |||
| ABSTAIN (49) (no formula expected) | |||
| Expression (1 functions, 10 records) | |||
| EXPRESSION (10) (no top-level function) | |||
B Context Representations
B.1 Coverage Analysis
We define a family of coverage metrics that measure how completely a context strategy exposes the cells a formula depends on. For each fxBench problem i we compare required cell sets against what the strategy renders, and report the fraction of problems whose required cells are all exposed.
Required sets.
• : direct_intent cells—headers and labels that hint at what the formula computes.
• : data_description cells describing the input data being used.
• : all intents cells for problem .
• : cells referenced by the ground-truth formula.
We drop empty cells and the target cell itself from every required set, since every strategy blanks the target by design. The intent sets come from the fxBench annotations §B.2.
Exposed sets. For strategy s on problem i we track two cell sets:
• (printed): cells appearing on their own with their exact address and exact value or formula text. Compressed ranges and type-aggregated tuples do not count as printed.
• (mentioned): cells named or recoverable from the output—an explicit address, a range or cluster region containing the cell, or a header notation pointing at its location. By construction .
Coverage metrics. Let N be the number of benchmark problems (503). We do not give partial credit: one missing cell fails the check. The five reported metrics are:
The first four ask whether each required set is fully printed or merely mentioned. UPPER captures the realistic ceiling. Table 2 reports these metrics together with token cost on fxBench.
B.2 Intent Cells Annotation
The intent cells used by the structural coverage metrics are the cells a model must wire together to arrive at the formula. They are the headers and row labels needed either to identify parts of the spreadsheets serve as inputs to the formula or to describe what the formula is supposed to compute.
Annotation procedure. For each problem we build a small local context for the annotator by collecting all non-empty cells within rows and columns of (1) the target cell, (2) each individual cell referenced by the ground-truth formula, and (3) each corner cells of every range referenced by the formula. Sampling around range corners, rather than every cell in the range. For a rectangular
[System] You are an expert at identifying cells in Excel that help understand formula intent.
Given a formula, its target cell, and surrounding cell context, identify three types of cells and the formula intent:
-
Direct Intent: Cells describing what the OUTPUT/RESULT represents
- Column header above the target cell (where the formula lives)
- Row labels next to the target cell
- Focus: What is being CALCULATED or PRODUCED
- Example: If target is G6 with header "Percent Rank" at G2, return ["G2"]
-
Data Description: Cells describing the INPUT data being used
- Column headers for ranges/cells referenced IN the formula
- Row labels for data being consumed
- Focus: What data is being READ or CONSUMED
- Example: For =F6/SUM(F6:F23), if F2 is "Percent Male", return ["F2"]
-
Data Range: Full range notations used in the formula
- Use colon notation: "F6:F23" not separate boundaries
- Include all ranges found in the formula
- Example: For SUM(F6:F23), return ["F6:F23"]
-
Intent: A concise description (at most 10 words) of what the formula calculates.
- Example: "Total sales for east region"
Return cell addresses as a JSON object with four fields: { "direct_intent": ["G2"], "data_description": ["F2"], "data_range": ["F6:F23"], "intent": "Percentage of male respondents in the survey" }
Important guidelines:
- Return actual cell addresses, not descriptions
- Direct intent describes the target cell's meaning (OUTPUT)
- Data description describes the referenced data's meaning (INPUT)
- Data range uses colon notation for ranges
- Use the context to identify relevant headers and labels
- Return all categories; use empty lists if nothing applies
[User]
Target Cell
{target_cell}
Formula
{formula}
Context
The following cells surround the formula target and referenced cells: {context}
Data Ranges
The formula operates on these ranges: {data_ranges}
Listing 2: Prompt used for intent cell annotation. Template variables {target_cell}, {formula}, {context}, and {data_ranges} are filled per FxBench record. {context} is a newline-separated list of Address | value pairs for non-empty cells in local windows around the target cell and around the corners of each formula-referenced range. {data_ranges} is a comma-separated list of formula ranges, or None (individual cell references only) when the formula contains no ranges.
range such as B6:F23 all four corners (B6, F6, B23, F23) contribute to their own local windows. Cell values are truncated to 32 characters. The annotator is prompted with the target cell, the ground-truth formula, and this local context as show in Figure 2.
Why an LLM annotator. While data_range is directly derivable from the ground-truth formula, identifying intent headers and row labels for each formula requires manual analysis. Most real-world spreadsheets do not use structured tables, data is messy and unstructured, so simple positional heuristics are unreliable, and doing this by hand across the benchmark is time-consuming.
B.3 Oracle Analysis
B.3.1 Oracle Variants
All oracle variants share a common Base context: the gold formula’s referenced cells with their values, the formula’s function names, the annotated intent cells, and the target marked as [TARGET].
Table 7: Deterministic failure labels used in the oracle failure analysis. Labels are assigned only to actual failures (FP/FN/Error); correct predictions and correct abstentions are excluded.
| Failure label | Description |
|---|---|
| incorrect_formula_type | The prediction uses a different root function or a substantially different nested-function strategy from the target. |
| right_type_incorrect_args | The root and nested function structure are broadly correct, but non-range arguments such as criteria, constants, operators, argument order, or wrapper arguments are wrong. |
| right_type_incorrect_range | The root and nested function structure are broadly correct, but one or more referenced cells or ranges are wrong. |
| partial_correct | The prediction shares the outer formula strategy and some nested structure, but an important nested subexpression is missing, added, or replaced. |
| abstain_wrong | The model makes an abstention mistake: it abstains when a formula is expected, or produces a formula when abstention is expected. |
| syntax_error | The predicted formula cannot be parsed or accepted as a valid Excel formula. |
| execution_error | The predicted formula is syntactically valid but evaluates to an Excel runtime error such as #N/A, #VALUE!, or #NUM!. |
| other_formula_mismatch | A valid, executable formula mismatch that does not fit the deterministic type, range, argument, or partial-structure rules. |
Cell values are grouped by exact value or by structural pattern, and formula cells show their computed values. Base removes the comprehension load of locating the relevant cells while preserving the model's task of assembling them into a formula.
We define seven variants over Base:
-
cell format: the target cell's expected display format (percentage, currency, date, time, etc) when detectable.
-
dependency chain: the recursive dependency chain of the formula's references, including intermediate computed values.
-
same column: other formulas in the target's column with their computed values, capturing drag-down patterns.
-
neighbor: a grid centered on the target cell, capturing local spatial layout.
-
formulas: every formula in the worksheet, grouped by structural pattern, exposing sheet-wide conventions.
-
all of the above: stacks all of the above, the strongest oracle using only spreadsheet derived signals.
-
NL Prompt: a natural-language description of the target formula and how to wire its arguments. Prompts are LLM-generated; we treat this as an upper bound where the model is told what to compute. Refer B.3.3 for NL prompt generation details.
B.3.2 Oracle Variant Examples
We illustrate the oracle variants on a single fxBench problem: the target cell Data!E26 on a workbook tracking starting-amps measurements by side and status. The expected formula is =AVERAGE(AVERAGEIF(E3:E23,{side a,"low}), I3:I23)). Figure 12 shows Base in full, followed by the additions made by all of the above and +NL Prompt. Workbook contents are PII-redacted; status strings shown as HIGH_COLLECTING_DATA and LOW_COLLECTING_DATA are placeholder tokens.
B.3.3 NL Prompts for Formulas
For each FxBench record, an annotator LLM (GPT-5.2) receives the ground-truth formula, target cell, and intent annotation and a small surrounding context window. The window is built from a 3 cell radius around the target and each cell referenced in the formula. Each context cell is serialized as Address | value with values truncated to 32 characters. The annotator's system prompt is shown in Listing 3
Base Oracle Prompt (full)
Sheet: Data Target cell: E26 Intent: Average starting amps for side A or low status Consider using: AVERAGE
Intent cells: E2,I2 | Status, Starting Amps Value | input_header E25,D26 | SKU, Collected Value Average | output_header
Referenced cells (grouped by value): E3,E6:E7,E9,E11,E13,E16:E17 | HIGH_COLLECTING_DATA E4:E5,E8,E10,E12,E14:E15,E18,E20 | LOW_COLLECTING_DATA E19,E21 | side b, side a I3..I21 | numeric values (16 entries)
E26 | [TARGET] Data ranges: E3:E23, I3:I23
+ all of the above (additions over Base)
Consider using: AVERAGE, AVERAGEIF [function hint expanded]
Computation chain: E3 = HIGH_COLLECTING_DATA; I3 = 1.5831 E23 = (empty); I23 = (empty) -> E26 = [TARGET]
All sheet formulas (grouped by pattern): F26 | =AVERAGE(AVERAGEIF(E3:E23,{"side a", "low", M3:M23})) G26 | =AVERAGE(AVERAGEIF(E3:E23,{"side a", "low", P3:P23})) J26 | =AVERAGE(AVERAGEIF(E3:E23,{"side b", "high", I3:I23})) K26,L26 | (same pattern over M3:M23, P3:P23) ... (15 unrelated MAXIFS/MINIFS/COUNT patterns omitted)
+NLPrompt (additions over Base)
Formula instruction: In E26, return the average starting amps for rows where the status in E3:E23 contains either "side a" or "low" anywhere in the text. Use AVERAGEIF with an array of those two wildcard criteria against E3:E23 and average the matching values from I3:I23, then wrap that result in AVERAGE so the two criteria results are combined into one final average.
Figure 12: Oracle variants for the same fxBench problem (Data!E26). The first panel shows the full Base prompt; the + all of the above and +NL Prompt panels show only the lines they add.
[System] You are an expert Excel formula instructor. Given a target cell, the ground-truth Excel formula, and surrounding worksheet context, write a concise natural-language instruction that another Excel expert could use to reconstruct the formula exactly.
Your instruction must include:
- Goal - what the target cell should display.
- Method - which Excel functions to use and how the logic connects.
- Data - exact cells/ranges to operate on.
- Tricky - exact string literals, argument order, omitted arguments, array behavior, where multipliers go, and any non-obvious wiring.
Constraints:
- Do not just emit the formula text.
- Do not be vague about string literals, ranges, or argument order.
- Keep the explanation to 1-4 sentences.
Return JSON: {"nl_prompt": "...", "complexity": "simple|moderate|complex"}
[User]
Formula
{ground_truth_formula}
Target Cell
{target_cell}
Intent
{intent_text_if_available}
Surrounding Context
{local_context}
Listing 3: System and user prompt template used to generate the natural-language instructions consumed by the +NL PROMPT oracle.
B.3.4 Qualitative Analysis
Case 1: Missing the intent-hint The intent says moving average and a window length lives in C2 (=15), but the model returns the raw aggregation =MAX(G3:G310) over the full column. It latches onto the function noun (MAX) and ignores the windowing modifier, defaulting to the simplest aggregation that matches the verb.
The expected formula:
=MAX(SUBTOTAL(1,OFFSET(G2:G3,ROW(G3:G310)-ROW(G3),,C2)))
constructs a trailing C2-row window at every offset via OFFSET+SUBTOTAL and takes the max over those window averages. The cue is local (C2=15 plus the Highest Moving Average header), so this is a context-utilization failure rather than under-specification.
Context
Sheet: Max Moving Average (3) Target cell: B2 Intent: Highest moving average for P Consider using: MAX
Intent cells: B1 | Highest Moving Average | output_header G1 | P | input_header C1 | C | input_header A2 | Highest Moving Average P | output_header
Referenced cells (grouped by value): C2,G145,G199 | 15 G2:G21,G25:G26,G50,G53:G55,... | 0 ... [truncated]
B2 | [TARGET]
Data ranges: G2:G3, G3:G310
Task
Current cell: "B2" Prefix: "="
| B2 : × √ fx √ {=MAX(SUBTOTAL(1,OFFSET(G2:G3,ROW(G3:G310)-ROW(G3),,C2)))} | |||||||||
|---|---|---|---|---|---|---|---|---|---|
| A | B | C | D | E | F | G | H | I | |
| 1 | Highest Moving Average | OFFSET | Column Check | Column Check | P | C | |||
| 2 | Highest Moving Average P | 275,8000 | 15 | 181 | 1 | 0 | 0 | ||
| 3 | Highest Moving Average C | 15 | 143 | 2 | 0 | 0 | |||
| 4 | Lowest Moving Average of C (EXCLUDING 0's) | 15 | 143 | 3 | 0 | 0 | |||
| 5 | 4 | 0 | 0 | ||||||
| 6 | 5 | 0 | 0 | ||||||
| 7 | 6 | 0 | 0 | ||||||
| 8 | 7 | 0 | 0 | ||||||
| 9 | 8 | 0 | 0 | ||||||
| 10 | 9 | 0 | 0 | ||||||
| 11 | 10 | 0 | 0 | ||||||
| 12 | 11 | 0 | 0 | ||||||
| 13 | 12 | 0 | 0 | ||||||
| 14 | 13 | 0 | 0 | ||||||
| 15 | 14 | 0 | 0 | ||||||
| 16 | 15 | 0 | 30 | ||||||
| 17 | 16 | 0 | 80 | ||||||
Figure 13: Sheet view for Case 1 (Max Moving Average!B2). The formula bar shows the trailing-window construction; C2 holds the window length (15).
Case 2: Missing tie-breaking over matched candidates. The model recovers the broad lookup structure—find the minimum price in B2:F2 and return the corresponding quantity from B3:F3—with
=INDEX(B3:F3,MATCH(MIN(B2:F2),B2:F2,0))
However, the minimum price (50.00) appears for multiple suppliers (Sup2, Sup4). The predicted MATCH returns the first tied supplier (Sup2, quantity 50), while the expected formula
=LARGE(IF(2:2=MIN(2:2),3:3),1)
considers all minimum-price suppliers and returns the largest corresponding quantity (Sup4, quantity 70). The Consider using: LARGE hint in the prompt points directly at this construction; the model ignores it. This is a hint-utilization failure: the tie-breaking rule is not visually obvious from the data, but the function hint exposes it.
Context
Sheet: Sheet2 Target cell: B6 Intent: Quantity corresponding to the lowest supplier price Consider using: LARGE
Intent cells: A2 | Price | input_header A3 | Quantity | input_header A6 | lowest price | output_header
Referenced cells (grouped by value): B2,D2,F2 | 172.5 C2:C3,E2 | 50 B3 | 90 D3 | 40 E3 | 70 ... [truncated]
B6 | [TARGET]
Data ranges: B2:F2, B3:F3
Task
Current cell: "B6" Prefix: "="
| A | B | C | D | E | F | G | |
|---|---|---|---|---|---|---|---|
| 1 | Supplier | Sup1 | Sup2 | Sup3 | Sup4 | Sup5 | |
| 2 | Price | 172.50 € | 50.00 € | 172.50 € | 50.00 € | 172.50 € | |
| 3 | Quantity | 90 | 50 | 40 | 70 | 20 | |
| 4 | |||||||
| 5 | |||||||
| 6 | lowest price | 70.00 € | |||||
| 7 | lowest price | ||||||
| 8 |
Figure 14: Sheet view for Case 2 (Sheet2!B6). The minimum price 50.00 ties between Sup2 (quantity 50) and Sup4 (quantity 70); the expected formula breaks the tie by selecting the larger quantity.
Case 3: Right formula, incorrect range. The model selects the right statistical operation ( ) but grounds it to a single visible column E4:E13 instead of the full data block. The expected formula is . The data range B4:F13 is named verbatim in the prompt header (Data ranges), so this is a clean context-utilization failure: the model anchors on the column closest to the target cell rather than the explicitly enumerated range.
Context
Sheet: Example 1.3-answers
Target cell: E19
Consider using: VAR.S
Intent cells:
D19 | Variance = | input_header
Referenced cells (grouped by value):
B4 | 990
C4 | 4610
D4 | 5740
E4 | 7170
F4 | 9010
... [truncated]
E19 | [TARGET]
Data ranges: B4:F13
Task
Current cell: "E19"
Prefix: =
| E19 | |||||||
|---|---|---|---|---|---|---|---|
| A | B | C | D | E | F | G | |
| 1 | Example 1.3:Ranked data from problem 1.7 is | ||||||
| 2 | |||||||
| 3 | Years 1-10 ears 11-2ears 21-3ears 31-4ears 41-50 | ||||||
| 4 | 990 | 4610 | 5740 | 7170 | 9010 | ||
| 5 | 1310 | 4710 | 6210 | 7380 | 9180 | ||
| 6 | 1720 | 4780 | 6360 | 7460 | 9500 | ||
| 7 | 2120 | 4780 | 6540 | 7760 | 9790 | ||
| 8 | 2580 | 5050 | 6660 | 7930 | 10300 | ||
| 9 | 3160 | 5150 | 6700 | 8250 | 10700 | ||
| 10 | 3180 | 5380 | 6700 | 8350 | 10810 | ||
| 11 | 3270 | 5500 | 6930 | 8670 | 11350 | ||
| 12 | 3760 | 5530 | 6930 | 8730 | 11900 | ||
| 13 | 4550 | 5580 | 7020 | 8860 | 12900 | ||
| 14 | |||||||
| 15 | |||||||
| 16 | What is the mean and mediane for the data? | ||||||
| 17 | |||||||
| 18 | Mean = | Standard Deviation = 2804.584 | |||||
| 19 | Median = | Variance = | 7865690 | ||||
| 20 | Skew = | ||||||
Figure 15: Sheet view for Case 3
Case 4: Right formula, wrong rate frequency. The model recovers the right financial function and argument order with =NPER(Q3,Q6,-Q2,0,Q5), while the expected formula is =NPER(Q3/12,Q6,-Q2,0,Q5)
The mismatch is unit reconciliation: Q3 holds an annual interest rate (11%), but the output header Months implies the period count must be in months, so the rate must be divided by 12. The model picks up the rate cell by header match (Interest) but does not reconcile its unit against the output column. The model fails to operationalize the intent—the unit mismatch is invisible from the cell values alone and only the juxtaposition of the two header semantics (Interest=annual, Months=monthly periods) reveals it
Context
Sheet: restruct
Target cell: Q4
Intent: Number of months to repay the loan
Consider using: NPER
Intent cells:
M2 | Loan | input_header
M3 | Interest | input_header
M4 | Months | output_header
M5 | Adv/Arr | input_header
M6 | Installment | input_header
Referenced cells (grouped by value):
Formulas (grouped by pattern):
Q2 | =P13
Q3, Q5: Q6 | =N@
Q4 | [TARGET]
Task
Current cell: "Q4"
Prefix: =
| K | L | M | N | O | P | Q | R | S | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Loan | 5,000,000 | 3,393,783 | |||||||||||||||
| Interest | 11.0000% | 11.0000% | |||||||||||||||
| Months | 12 | 8 | |||||||||||||||
| Adv/Arr | 0 | 0 | |||||||||||||||
| Installment | 441,908 | 441,908 | |||||||||||||||
| Interest | 396,229 | ||||||||||||||||
| No Installment | Paid Interest | Paid Principa | Outstanding Principa | Outstanding Interest | |||||||||||||
| 1 | 441,908 | 45,833 | 396,075 | 4,603,925 | 350,395 | ||||||||||||
| 2 | 441,908 | 42,203 | 399,706 | 4,204,219 | 308,193 | ||||||||||||
| 3 | 441,908 | 38,539 | 403,370 | 3,800,850 | 269,654 | ||||||||||||
| 4 | 441,908 | 34,841 | 407,067 | 3,393,783 | 234,813 | ||||||||||||
| 5 | 31,110 | 31,110 | 0 | 3,393,783 | 203,703 | ||||||||||||
| 6 | 31,110 | 31,110 | 0 | 3,393,783 | 172,594 | ||||||||||||
| 7 | 31.110 | 31.110 | 0 | 3.393.783 | 141.484 | ||||||||||||
Figure 16: Sheet view for Case 4 (restruct!Q4). Interest is quoted as an annual rate (11.0000%) in Q3 but the output column is Months, so NPER needs the monthly rate Q3/12.

Figure 17: Sheet view for Case 5 (Data_Recruitment Act!AC6). The expected formula bar shows a trailing window anchored to the last populated row of column S, with length 4=3.
Case 5: Partially correct (moving average over the wrong window). The target asks for a 3-period moving average of % to interview and the model produces a structurally plausible prediction =AVERAGE(OFFSET(S6, 0, 0, 4, 1)) : it correctly identifies the function (AVERAGE), the window-size parameter (4=3), and the relevant column (S). The expected formula is
=AVERAGE(OFFSET(S5, COUNT(6:31), 0, -4, 1))
which constructs a trailing window: it anchors at the last populated cell of S6:S31 via COUNT and walks backwards 4 rows using a negative height. The model's window starts at the current row and walks forward, so it averages future rather than past values—right shape, wrong direction. The intent line names a moving average over completed periods, but the model anchors at the current row and walks forward instead. We classify this as partially correct.
Context
Sheet: Data_Recruitment Act
Target cell: AC6
Intent: Moving average of percentage to interview
Consider using: AVERAGE
Intent cells:
AC4 | Moving average period >>> | input_header
S5 | % to interview | input_header
AC5 | 3 Period avg - Apps to interv... | output_header
Referenced cells (grouped by value):
AD4 | 3
S6:S10 | 0
Formulas (grouped by pattern):
S11:S31 | =IFERROR(R@/Q@,"")
AC6 | [TARGET]
Data ranges: S6:S31
Task
Current cell: "AC6"
Prefix: '='
C Fine-Tuning Details
C.1 Training Data Variants
We construct fine-tuning datasets from Sheetpedia formulas after excluding, every workbook in Phase 3 manual review and every workbook appearing in the fxBench. From this remaining pool we build six training variants.
Curated. The Curated corpus is sampled by primary Excel function. We target up to 1000 formulas per primary function type. For small function pools, we keep all available records while limiting each workbook to at most five records per function type. For larger pools, we select 1000 records using a greedy diversity selection similar to Appendix A.1.2, prioritizing signature diversity, workbook diversity, and formula complexity. The final Curated corpus contains 25,614 records from 17,892 workbooks and 172 formula types.
Simple-only. Same target size as Curated, restricted to simple formulas: function depth ≤ 2 length, ≤ 100 commonly used functions, no cross-sheet references, signature frequency ≥ 10 in the candidate pool. Final: 25,000 records from 13,533 workbooks across 59 formula types.
Complex-only. Counterpart to Simple-only: deeper nesting, longer formulas, rare function types, rare functions signatures, or cross-sheet references. Final: 25,000 records from 9,503 workbooks across 74 formula types.
Curated-Scaled-Up. Starts from Curated and adds 13,547 workbook-disjoint records via the same greedy procedure, raising the per-function cap to 2,000. Final: 39,161 records from 27,327 workbooks across 172 formula types.
Curated-Scaled-2X. Forced-scaling variant targeting 50K records: starts from Curated-Scaled-Up, then fills the remaining budget by sampling per primary function type. Larger but more concentrated among frequent types. Final: 50,000 records from 32,020 workbooks across 172 formula types.
Random. As an additional baseline, we create a dataset by random sampling records from the training pool without any function balancing or complexity targeting.
Together, these variants let us study how fine-tuning is affected by three factors: formula diversity, formula complexity, and dataset scale.
C.2 Fine-Tuning Configuration
All fine-tuned Qwen3 models use full-parameter supervised fine-tuning on MiniSheet prompts. All runs use AdamW 8-bit optimization, peak learning rate , cosine decay with 5% warmup, weight decay 0.01, maximum gradient norm 1.0, maximum sequence length 4096, effective batch size 32, and unmasked prompt loss. For the Qwen3-8B data-variant experiments, Curated, Simple-only, and Complex-only are trained for 1100 steps; Curated-Scaled-Up is trained for 1800 steps and Curated-Scaled-2x is trained for 2200 steps. All fine-tuning experiments were run on 2 x H100 GPUs.

Figure 18: Left: share of records (%) covered by the to three and top ten primary function types. Right: distribution of function nesting depth across dataset variants.
Table 8: Content strategy baselines on fxBench: outcome counts and auxiliary metrics across GPT-5.2, Sonnet-4-6, and Qwen3-8B.
| Context Builder | Model | TP | FP | TN | FN | Acc% | Overlap% | Syntax% | Sketch% |
|---|---|---|---|---|---|---|---|---|---|
| Full-sheet strategies | |||||||||
| HTML | GPT-5.2 | 281 | 204 | 12 | 6 | 58.3 | 67.6 | 98.0 | 27.4 |
| Sonnet-4-6 | 288 | 199 | 14 | 2 | 60.0 | 71.0 | 91.3 | 27.4 | |
| Qwen3-8B | 90 | 352 | 14 | 47 | 20.7 | 36.1 | 81.9 | 3.2 | |
| CSV | GPT-5.2 | 236 | 243 | 14 | 10 | 49.7 | 63.5 | 96.8 | 25.6 |
| Sonnet-4-6 | 251 | 230 | 17 | 5 | 53.3 | 64.9 | 91.8 | 24.9 | |
| Qwen3-8B | 38 | 396 | 9 | 60 | 9.3 | 21.6 | 78.3 | 2.0 | |
| JSON | GPT-5.2 | 276 | 209 | 10 | 8 | 56.9 | 67.1 | 98.2 | 25.8 |
| Sonnet-4-6 | 290 | 195 | 14 | 4 | 60.4 | 69.7 | 91.3 | 27.4 | |
| Qwen3-8B | 65 | 388 | 8 | 42 | 14.5 | 30.6 | 81.3 | 1.8 | |
| Markdown | GPT-5.2 | 251 | 217 | 17 | 18 | 53.3 | 66.1 | 95.6 | 25.0 |
| Sonnet-4-6 | 256 | 220 | 19 | 8 | 54.7 | 67.5 | 91.8 | 25.6 | |
| Qwen3-8B | 44 | 411 | 13 | 35 | 11.3 | 25.2 | 83.3 | 2.8 | |
| Pipe delimited Full-sheet | GPT-5.2 | 285 | 199 | 11 | 8 | 58.8 | 66.3 | 98.0 | 25.8 |
| Sonnet-4-6 | 284 | 199 | 17 | 3 | 59.8 | 69.9 | 92.2 | 26.6 | |
| Qwen3-8B | 50 | 395 | 11 | 47 | 12.1 | 27.4 | 81.5 | 2.6 | |
| Windowed approaches | |||||||||
| Viewport | GPT-5.2 | 274 | 212 | 12 | 5 | 56.9 | 64.9 | 98.6 | 26.8 |
| Sonnet-4-6 | 275 | 202 | 19 | 7 | 58.4 | 67.4 | 91.1 | 27.4 | |
| Qwen3-8B | 61 | 410 | 10 | 22 | 14.1 | 27.9 | 86.1 | 2.2 | |
| SpreadsheetCoder | GPT-5.2 | 257 | 222 | 9 | 15 | 52.9 | 62.7 | 95.6 | 25.0 |
| Sonnet-4-6 | 263 | 206 | 24 | 10 | 57.1 | 68.0 | 92.4 | 28.0 | |
| Qwen3-8B | 66 | 402 | 8 | 27 | 14.7 | 27.3 | 84.1 | 1.8 | |
| Compact strategies | |||||||||
| SheetCompressor | GPT-5.2 | 263 | 221 | 12 | 7 | 54.7 | 64.8 | 98.2 | 25.6 |
| Sonnet-4-6 | 243 | 236 | 12 | 12 | 50.7 | 63.7 | 89.9 | 23.9 | |
| Qwen3-8B | 46 | 407 | 11 | 39 | 11.3 | 25.4 | 81.5 | 2.6 | |
| MiniSheet | GPT-5.2 | 199 | 280 | 14 | 10 | 42.3 | 54.3 | 84.7 | 20.7 |
| Sonnet-4-6 | 230 | 248 | 20 | 5 | 49.7 | 62.8 | 92.8 | 26.2 | |
| Qwen3-8B | 53 | 417 | 10 | 23 | 12.5 | 26.5 | 79.3 | 2.0 | |
Counts are abstain-aware outcomes. Acc is Pass@1, . Range Overlap is expected-reference recall over expanded cell sets. Syntax and Sketch are abstain-aware: correct abstentions contribute as positives and wrong abstentions as zeros; Error rows are excluded from auxiliary metric denominators. Values in metric columns are percentages; bold marks the best value within each strategy group and model.

Figure 19: Token Usage