{"slug":"spreadsheet-formula","name":"Spreadsheet Formula: Excel and Google Sheets","version":"1.0.0","updated_at":"2026-10-08T06:16:59.379Z","use_when":"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.","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.","languages":["any"],"tags":["excel","google-sheets","formulas","sumifs","vlookup","spreadsheets"],"category":"data","category_url":"https://aiskills402.com/categories/data","keywords":["write an Excel formula","Google Sheets formula","price tiers or grades"],"faq":[{"q":"Does my model need this to write formulas?","a":"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."},{"q":"How were the formulas checked?","a":"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."},{"q":"Does it handle a decimal comma?","a":"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."},{"q":"Why is it so cheap?","a":"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."}],"examples":[{"lang":"en","model":"claude-sonnet-5-5","input_excerpt":"F2 should show the total Amount for the region named in E2. The same formula will be copied down to F4.\n\n|   | A | B | C | D | E | F |\n|---|---|---|---|---|---|---|\n| 1 | Region | Product | Amount |  | Region | Total |\n| 2 | South | Chair | 80 |  | North |  |\n| 3 | North | Desk | 120 |  | South |  |\n| 4 | North | Lamp | 45 |  | West |  |\n| 5 | East | Desk | 200 |  |  |  |…","output_excerpt":"=SUMIFS($C$2:$C$7,$A$2:$A$7,E2)"}],"page_url":"https://aiskills402.com/skills/spreadsheet-formula","markdown_url":"https://aiskills402.com/skills/spreadsheet-formula.md","image_url":"https://cdn.aiskills402.com/og/skills/spreadsheet-formula/e3e07f7e.png","related_url":"https://api.aiskills402.com/v1/skills/spreadsheet-formula/related","purchases_count":null,"tested":{"date":"2026-10-08","strong":{"model":"claude-sonnet-5-5 (Claude Code alias \"sonnet\")","verdict":"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."},"weak":{"model":"claude-haiku-5-5 (Claude Code alias \"haiku\")","verdict":"Also 21 of 21, with the same kinds of formula as Sonnet."},"note":"Twenty-one tasks written by us, each a description plus a sample sheet; the answer is evaluated by HyperFormula 3.4 on that sheet and every target cell is compared with the expected value. The first fourteen tasks turned out easy: in a first run both models solved them with and without the skill, so seven harder ones were added and everything was run again. The skill itself was changed twice after its own failures on these tasks: it did not say that decimals are written with a comma where semicolons separate the arguments, and its own code formatting led the models to wrap the formula in backticks. The result shown is the fourth run with the skill on the same tasks, while the side without the skill was run once, so treat the difference as small. One run per model and task in each version; earlier runs are kept in the test folder. Two gaps of the engine were fixed in our checker, not in the skill: bare TRUE and FALSE, and array arithmetic for SUMPRODUCT.","baseline":{"date":"2026-10-08","rows":[{"label":"Correct formula, one line (21 tasks)","better":"higher","strong":{"with":{"n":21,"of":21},"without":{"n":19,"of":21}},"weak":{"with":{"n":21,"of":21},"without":{"n":21,"of":21}}}],"note":"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."},"report_url":null},"price_usd":"0.01","price_micro":10000,"size_bytes":6311,"sha256":"269446be2268e3e514ef867d4f183948d15935a5c4603a3d5d75342b60a990bd","outline":["The answer","Rules","Work in this order","Short examples"],"license":{"summary":"Perpetual, non-exclusive; use and modify for yourself incl. paid work; no resale or republishing","holder":"Georgi Kalchev, aiskills402.com","url":"https://aiskills402.com/docs#license"},"buy_url":"https://api.aiskills402.com/v1/skills/spreadsheet-formula/file","redownload_url_template":"https://api.aiskills402.com/v1/purchases/{token}","mcp_tool":null,"payment":{"protocol":"x402","scheme":"exact","asset":"USDC","selling":true,"network":"base","network_caip2":"eip155:8453","pay_to":"0x8e37022edcf0f21cf3c9f93fee9d4d32519f36f4","facilitator":"cdp"},"seo_title":"Excel and Google Sheets Formula Skill","seo_description":"SKILL.md that makes your AI agent write one Excel or Google Sheets formula from a description and a sample, with real cell addresses. $0.01, yours forever.","versions":[{"version":"1.0.0","date":"2026-10-08","changelog":"# Changelog\n\n## 1.0.0 — 2026-10-08\n\nFirst 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.\n"}]}