Skip to content
Agents Handbook
PlaybooksJobsAgentsLessonsField logFor agents
Corroborated· Two or more independent accountsmedium risk

Build a weekly KPI report from your spreadsheets and send the draft for approval

Have an agent write a small script that pulls last week's numbers from your spreadsheets or exports, computes each KPI from a written definition, and checks row counts and totals. The model writes the short commentary only after the numbers exist. The draft goes to one approver, and a person sends it to the team. Public tests show chat assistants inventing counts and dropping rows when they do the maths themselves.

By the Agents Handbook editors · CC BY 4.0

What you get

Every Monday you get a draft report with this week's KPIs, the change from last week, a data check section and three lines of commentary, ready for one person to approve and send.

Difficulty
Intermediate
Time
2-4 hours to set up, then 10 minutes a week to review
Sources
6 · 6 independent
Updated
2026-10-13
Cost:
Your agent plan, plus n8n or a scheduler if you automate the run
Start here

The prompt

Fill the blanks here, or leave them for your agent to ask. Pick the tab for your agent. The hand-off button gives any agent this page as markdown.

Build a weekly KPI report for [team or company].

Sources (read only)
- [Google Sheet "Sales log", tab "Deals"], [Stripe export CSV at path], [GA4 export at path].

KPI definitions (use exactly these; ask me if one is unclear)
- [New MRR] = sum of [amount] where [status = won] and [close date] in the week.
- [Active customers] = count of distinct [customer id] with [status = active] at the end of the week.
- [Add up to 8 more.]
- Week = Monday 00:00 to Sunday 23:59 in [time zone]. Report the most recent complete week and the week before.

1. Write a script ([Python / Apps Script]) that loads each source, applies the definitions and outputs a table: KPI, this week, last week, change, change %.
2. Data checks in the same script: rows loaded per source, rows in the week, rows dropped and why (blank, bad date, duplicate id), and the date range found. If any source has zero rows for the week, or more than 5% of rows were dropped, mark the report "DO NOT SEND" at the top.
3. Run the script and show me its raw output. Do not type any number yourself. Every number in the report must come from the script output.
4. Write the report: the KPI table, a "Data checks" section, and three short sentences on the biggest changes. Say "not explained by the data" if you do not know why a number moved. Do not guess causes.
5. Save the draft as [Google Doc / email draft to approver@company.com / Slack draft]. Stop.

Hard rules
- Do not send the report to anyone. A person approves and sends it.
- Do not edit, sort or delete anything in the source files.
- If a definition does not fit the data (a column is missing or renamed), stop and ask me.
Open in ClaudeOpen in ChatGPT15 of 15 blanks left

Human checkpoints: the agent stops and asks you

  • Approve the written KPI definitions and the week boundary before the first run.
  • Check the data section and approve the draft before it is sent to anyone.
  • Approve any change the agent proposes to a source spreadsheet. The default prompt makes none.

A wrong number in a report shapes decisions and is hard to take back once sent. Nothing goes to the team until a person has checked the data section and approved the draft.

Before you start

What you need

  • Source spreadsheets or exportsdata

    The same files or sheets each week, with stable column names.

  • Written KPI definitionsdata

    One line each, with the column and the filter. This is the most important input.

  • A scheduler (optional)app

    cron with Claude Code, an n8n Schedule Trigger, or a scheduled task in your assistant.

  • An approverpermission

    The person who checks the numbers before the report goes out.

6 steps

Steps

0/6 done
  1. Write the KPI definitions

    Agree each KPI in one line with the column, filter and week boundary. Pick the time zone on purpose.

    Check: Two people read the definitions and compute the same number for last week.

  2. Build the script and checks

    Paste the prompt. The agent writes code that loads sources, computes KPIs and prints data checks.

    Check: The script prints rows loaded, rows dropped with reasons, and the KPI table.

  3. Test against a week you already know

    Run it on a past week where you have trusted numbers. Fix definitions until they match.

    Check: Every KPI matches your trusted numbers, or you know why it differs.

  4. Review the commentary

    Read the three sentences. Remove any cause the data does not show.

    Check: Every claim in the commentary points to a number in the table.

  5. Schedule the run and the draft

    Run it weekly and save the result as a draft to the approver. Do not wire it to send.

    Check: On Monday a draft is waiting with the right week dates in the title.

  6. Approve and send

    The approver reads the data checks first, then the numbers, then sends.

    Check: The sent report has no DO NOT SEND flag and matches the draft.

7 known failures

What goes wrong

  • The assistant states counts that are not in the data, or shows code it never ran.

    Fix: Make every number come from code output, and tell the agent to remove any number it cannot trace to that output.

    Read the lesson →
  • Rows drop out silently, for example blanks removed by the analysis library, or a tool reads only part of the file.

    Fix: Print rows loaded and rows dropped with reasons in every run, and stop when the drop rate is above your limit.

    Read the lesson →
  • The report computes a different metric from the one you meant, and an AI review pass approves it.

    Fix: Write definitions down and test against a week you already know. Do not rely on the model to review its own logic.

  • Week boundaries shift because the time zone defaults to UTC or month length is hard-coded.

    Fix: Set the time zone and week start in the definitions and in the scheduler, and print the date range in the data checks.

  • A recent trend looks like progress but comes from records that are not complete yet, such as orders still in transit.

    Fix: Ask the agent to report how many records in each week are still open, and treat the latest week with care.

  • Numbers stored as text in a spreadsheet break the sums.

    Fix: Have the script convert and count values it could not convert, and show that count in the data checks.

  • Different models catch different problems in the same workbook.

    Fix: Keep the deterministic checks as the main safety net, and use the strongest model you have for the review pass.

Corroborated

Evidence

Two or more public accounts from different people or sites describe the same job. We summarise each source in our own words. Open the original before you rely on it.

  • News2026-09-03· ChatGPT
    I asked ChatGPT to analyze 3 datasets. It made the same mistakes every time

    Rosidi reports that ChatGPT computed the wrong delivery metric, stated order counts that did not match a 40-row file, showed code it had not run, and used 126 of 352 rows without saying blanks were dropped. A review pass fixed the counts but approved the wrong metric.

    Nate Rosidi · kdnuggets.com
  • Blog2024-04-03· ChatGPT
    Using ChatGPT for data analytics, what could go wrong?

    Mistelbacher analysed a year of post data with a ChatGPT data analysis GPT and says none of its partner mention counts matched his own check in Google Sheets. He switched to asking it for spreadsheet formulas and doing the counts himself.

    Rolf Mistelbacher · freshvanroot.com
  • Blog2026-05-05· Claude
    AI help with Claude

    Lenning had the Claude add-in for Excel audit a four-sheet workbook with a KPI dashboard. It found a total that left out service revenue, hard-coded values and faulty status flags, and fixed them after approval. One model flagged a headcount mismatch that the other model missed.

    Jeff Lenning · excel-university.com
  • Web· n8n
    Weekly business metrics report with Stripe, Notion, Sheets, Claude, SendGrid and Slack (n8n template)

    The template computes last week's window in a set time zone, pages through all Stripe charges and other sources, aggregates the numbers in code and then has Claude write the narrative. The page warns the time zone defaults to UTC if unset. It sends directly with no approval step.

    Mychel Garzon · n8n.io
  • Web· n8n
    Weekly KPI executive summaries from Google Sheets via Gemini, Gmail and Slack (n8n template)

    The template computes week-over-week changes and target checks in workflow steps before Gemini writes the summary. The page warns that values stored as text can break calculations and lists an approval step only as a possible add-on.

    WeblineIndia · n8n.io
  • Hacker News
    Comments on Copilot in Excel

    Several commenters describe spreadsheet assistants giving wrong figures. One says Copilot read a contract minimum as $1000 when it was $1500 and never reached the right value over a dozen questions. Another says ChatGPT did not check how many tables a sheet held.

    conductr and other commenters · news.ycombinator.com
Close the loop

Report how it went

Every report makes this page better for the next person and the next agent. Reports are reviewed before they count. Agents can report with the report_run tool.

How did it go?