---
title: Recipe: Analyze my spreadsheet · Agent Playground docs
description: Reads a messy sales sheet, writes an analysis, and when it crashes reads the error and fixes itself until the numbers come out. What it does, when to use it, how to make it yours, and what a run costs.
url: https://www.quietrobot.ai/docs/playground/recipes/spreadsheet-analysis
---

# Recipe: Analyze my spreadsheet

Reads a messy sales sheet, writes an analysis, and when it crashes reads the error and fixes itself until the numbers come out. What it does, when to use it, how to make it yours, and what a run costs.

Reads a messy sales spreadsheet, writes an analysis, and when the analysis crashes on a messy cell, reads the error and fixes itself, until the totals come out. It ends with sales by region and a bar chart.

| At a glance | |
|---|---|
| **Category** | Data |
| **Shape** | A loop that reads its own errors |
| **Plan** | Free and up |
| **Needs a Claude key** | No |
| **Limits it comes with** | 4 loops, 180 seconds, $0.05 |

```flow
{"title": "Analyze my spreadsheet, as it is on the canvas.", "nodes": [["setup", "run", "Load the spreadsheet"], ["profile", "code", "Look at the data"], ["write", "run", "Write the analysis", "go back here"], ["analyze", "run", "Run the analysis", "no internet"], ["fix", "code", "Read the error, fix it"], ["report", "run", "Show the summary"]], "edges": [["setup", "profile"], ["profile", "write"], ["write", "analyze"], ["analyze", "fix", "Failed"], ["fix", "analyze"], ["analyze", "report", "Passed"]]}
```

<figure class="shot">
  <img class="art-light" src="/docs/playground/recipes/spreadsheet-analysis-light.webp" alt="The Analyze my spreadsheet recipe in the builder after a run, with each step's result on the canvas and the run's steps listed on the right." width="1440" height="900" loading="lazy">
  <img class="art-dark" src="/docs/playground/recipes/spreadsheet-analysis-dark.webp" alt="" width="1440" height="900" loading="lazy">
  <figcaption>A real run of the recipe. The panel on the right lists every step with what it printed.</figcaption>
</figure>

## When to use it

* You have a spreadsheet export with messy cells (commas in numbers, `n/a`, blanks) and want totals and a chart.
* A weekly report from the same export, without fixing it by hand each time.
* Any script that should learn from its own errors.

## Run it

1. Open **Agent Playground** in the dashboard and find **Analyze my spreadsheet** under **Start from a recipe**. In the builder, **Recipes** in the toolbar lists them too.
2. Choose **Use this recipe**. It becomes a flow of your own, so changing it never changes the recipe.
3. Choose **Simulate** to see the forecast, then **Run**.

**What you'll see:** The first try crashes on `1,200.50`, the second on `n/a`, and the third skips what it can't read and finishes: sales by region, the top region, and how many rows were left out. The summary is in `summary.md` and the chart in `chart.svg`.

## Make it yours

1. Change **Load the spreadsheet** to load your own sheet: download it from a link, or start the flow from a webhook that sends it.
2. Change **Write the analysis** to the totals you want: by month, by product, by customer.
3. Replace **Read the error, fix it** with an **Agent** whose goal is `The analysis crashed with this error. Fix analysis.py.`, with the output of **Run the analysis** added through **Insert…**.
4. Have the last step send the summary somewhere useful, after an approval if it goes outside your team.

## What a run costs

These are the builder's own forecast for the recipe as it comes, with its limits, rounded. **Simulate** shows the same numbers for your version, and they change as you change the flow.

| | Typical | 1 in 10 runs | At most |
|---|---|---|---|
| **Sandbox time** | $0.0002 | $0.0003 | $0.0023 |
| **How long it takes** | 17 seconds | 21 seconds | 180 seconds |

A typical run uses $0.0002 of sandbox time, so about 4,700 runs cost $1, and every plan includes $5 of usage a month. **At most** is the most a run could cost with these limits: it stops at $0.05 or 180 seconds, whichever comes first.

## Related

* [Tutorial 3: Keep trying until it works](https://www.quietrobot.ai/docs/playground/tutorials/loops)
* [Tutorial 5: Add AI to a flow](https://www.quietrobot.ai/docs/playground/tutorials/ai-steps)
* [Data and evals recipes](https://www.quietrobot.ai/docs/playground/recipes/data-and-evals)
* [All recipes](https://www.quietrobot.ai/docs/playground/recipes)
