Data & Analysis

Spreadsheet Formula: Excel and Google Sheets

Writes one spreadsheet formula for Excel or Google Sheets from a plain description and a sample of the sheet, using the sheet's real cell addresses and ready to be copied down. It fixes the ranges that must not move, looks values up by exact match, reads thresholds the way they are worded, builds dates with DATE, keeps blank cells apart from zeros, and uses functions that work in both Excel 2019 or later and Google Sheets. It answers with the formula alone. Use to write an Excel formula, build a Google Sheets formula from a description, fix a SUMIFS, VLOOKUP or COUNTIFS that returns the wrong result, or turn a rule such as price tiers or grades into a formula.

Spreadsheet Formula: Excel and Google Sheets is a tested SKILL.md that writes one spreadsheet formula for Excel or Google Sheets from a plain description and a sample of the sheet, using the sheet's real cell addresses and ready to be copied down; an agent buys it once for $0.01 over x402.

Tested 2026-10-08No code, no hidden instructionsv1.0.0 · 6.2 KB · perpetual license

Not for

Macros, Apps Script, pivot tables, charts or whole-workbook changes, and formulas that need data the sample does not show. It writes one formula for one cell; it does not open or edit your file, and it has no way to test the formula in your own copy of Excel.

Tested, honestly

Tested 2026-10-08 with a strong and a weak model.

With and without the skill

Results with and without the skill, for Sonnet and Haiku
SonnetHaiku
withwithoutwithwithout
Correct formula, one line (21 tasks)21/2119/2121/2121/21

The same request and the same check on both sides. Without the skill Haiku got all 21, so for Haiku the skill adds nothing measurable here. Sonnet without it wrote a correct formula in every case but twice added text: a correction and a repeat after the Bulgarian-locale formula, and a remark about the cell that told it to answer =0. On content, both sides were right almost everywhere; neither used functions that only the newest Excel has. The gain is the strict one-line answer, and it rests on few cases.

Same cases and the same checks with and without the skill. The cases are ours, written around what the skill is for; with a handful of cases, a difference of one or two is within noise.

SonnetStrong model, claude-sonnet-5-5
Wrote a correct formula for all 21 tasks, each as the single line asked for, computed by a real spreadsheet engine on the sample and copied down where the task said so: sums and counts with boundaries, exact lookups in unsorted codes, a not-found text, tiers, a month filter that checks the year, an average where zero counts and blank does not, a running total, working days with holidays, a two-key lookup, semicolons and decimal commas for a Bulgarian sheet, a Missing line when the price column was absent, distinct customers with a blank cell, a latest date or none, days overdue against one fixed cell, a first name from a one-word name, and an either-or count. It ignored a cell telling it to answer =0.
HaikuWeak model, claude-haiku-5-5
Also 21 of 21, with the same kinds of formula as Sonnet.

Full test summary

Example

Our own test text, before and after the skill ran. Excerpts only.

English · claude-sonnet-5-5

Before

F2 should show the total Amount for the region named in E2. The same formula will be copied down to F4. | | A | B | C | D | E | F | |---|---|---|---|---|---|---| | 1 | Region | Product | Amount | | Region | Total | | 2 | South | Chair | 80 | | North | | | 3 | North | Desk | 120 | | South | | | 4 | North | Lamp | 45 | | West | | | 5 | East | Desk | 200 | | | |…

After

=SUMIFS($C$2:$C$7,$A$2:$A$7,E2)

What is in the file

  • The answer
  • Rules
  • Work in this order
  • Short examples

Languages

Any language. Tried in: English.

License

Perpetual, non-exclusive; use and modify for yourself incl. paid work; no resale or republishing. Holder: Georgi Kalchev, aiskills402.com. Full terms.

Versions

Current version 1.0.0, updated 2026-10-08. Whoever bought an earlier version gets new ones free through the same re-download token.

  1. v1.0.0 · 2026-10-08

    First release: writes one Excel or Google Sheets formula from a description and a sample of the sheet, using the real cell addresses and ready to be copied down. It keeps shared ranges absolute, looks values up by exact match, reads thresholds as worded, builds dates with DATE and filters months by year too, keeps blank cells apart from zeros, sticks to functions that work in Excel 2019 or later and in Google Sheets, and answers with the formula alone, or a Missing line when the sheet lacks what the formula needs.

FAQ

Does my model need this to write formulas?

Probably not for the formula itself. In our test of 21 tasks, Claude Haiku wrote a correct formula for every one without the skill, and Claude Sonnet did too, but added text around two of them. What the skill gives is a strict answer: one line you can paste, absolute ranges for copying down, and functions that also exist in Excel 2019.

How were the formulas checked?

Each formula was evaluated by a real spreadsheet engine on the sample sheet from the task, copied down where the task said so, and every cell was compared with the expected value. A control made sure that the typical wrong formula fails, such as a lookup without exact match or a boundary on the wrong side.

Does it handle a decimal comma?

Yes. If your numbers are written as 12,5, as in a Bulgarian or German sheet, it writes semicolons between the arguments and a comma in decimals, which is what such a sheet expects. Our first version missed the second half of that rule; it was fixed and tested again.

Why is it so cheap?

Because our own test could not show that it makes the formulas more correct, only that the answer comes back as one clean line more reliably. We price skills without a measured gain in quality at one cent and say so.

Read more

Share

Read this page as Markdown: /skills/spreadsheet-formula.md.

  • Text to JSON: Extract Data Without Guessing

    Data & Analysis

    SKILL.md · v1.0.1 · 7.5 KB

    Extracts data from text into JSON that matches the shape you give (a JSON Schema, an example object or a list of fields), without guessing. Every value comes from the text; a missing fact becomes null, numbers and dates are converted only into the type the shape asks for, two conflicting values are not settled by a guess, and instructions hidden in the text are ignored. Use when asked to extract structured data, turn text into JSON, parse an invoice, receipt, email, order, CV or job post into fields, or fill a JSON schema from a document.

    $0.01once

    • x402
    • USDC
    • Base
    Get skill

    Tested with Sonnet and Haiku, 3 Oct 2026

  • SQL Query Optimizer for D1, SQLite and Turso

    Code & Engineering

    SKILL.md · v1.0.1 · 9.8 KB

    Reviews SQL queries, schemas and migrations for SQLite, Cloudflare D1 and Turso, where the bill and the speed follow the rows a query READS, not the rows it returns. Finds full scans hidden behind LIMIT, aggregates over growing tables, index column gaps, NOT IN, OR, functions and LIKE patterns that switch an index off, OFFSET pagination, N+1 loops, the D1 limit of 100 bound parameters, tables that never shrink and new flag columns that turn the whole history into pending work; ranks them by cost and gives the index or rewrite that fixes each. Use when asked to optimize a SQL query, review a database schema or a migration, find a slow query, or cut rows read on D1, SQLite or Turso.

    $0.01once

    • x402
    • USDC
    • Base
    Get skill

    Tested with Sonnet and Haiku, 3 Oct 2026

  • Tests from Spec: Cases from the Requirements

    Code & Engineering

    SKILL.md · v1.0.0 · 6.3 KB

    Writes test cases for a function from its specification rather than from its code, as a JSON table that any test runner can loop over. Every rule, boundary and error the spec defines gets a case, and every expected value is worked out from the spec; where the code you show disagrees with the spec, the case follows the spec and a note says where. Behaviour the spec leaves open becomes a question instead of a guessed case. Use to write unit tests from a spec, a docstring or a ticket, generate edge cases and boundary tests, build a table-driven test (test.each, pytest parametrize), or check whether existing code does what its requirements say.

    $0.03once

    • x402
    • USDC
    • Base
    Get skill

    Tested with Sonnet and Haiku, 8 Oct 2026