formula-operations

formula-operations is a skill for Claude Code from claude-office-skills/claude-office-plugin. It costs 28 tokens per session (917 once invoked), scanned A, original, MIT.

A guide for writing and checking spreadsheet formulas in WPS Office, a productivity suite similar to Microsoft Excel. It covers formula templates, filling formulas down a table, and common error messages.

In plain words
What is it for?
Use it to add totals, lookups, conditions, percentages, rankings, and other calculations to WPS spreadsheets, then diagnose errors such as missing references or division by zero.
Why use it?
It helps keep calculations editable in the spreadsheet instead of replacing them with fixed results. It also gives ways to find and correct broken formulas.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the claude-wps-excel plugin — 26 skills, 14 commands, 8 agents, 2 MCP servers shipped together

Good fit Use it to add totals, lookups, conditions, percentages, rankings, and other calculations to WPS spreadsheets, then diagnose errors such as missing references or division by zero.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/claude-office-skills/claude-office-plugin/formula-operations
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add claude-office-skills/claude-office-plugin --skill formula-operations
Clone the repo
git clone --depth 1 https://github.com/claude-office-skills/claude-office-plugin

Made for: Claude Code.

Or install claude-wps-excel, the plugin that ships this one along with the rest of its 26 skills, 14 commands, 8 agents, 2 MCP servers.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for formula-operations

README.md
[![agentmods](https://agentmods.dev/badge/skills/claude-office-skills/claude-office-plugin/formula-operations/github.svg)](https://agentmods.dev/skills/claude-office-skills/claude-office-plugin/formula-operations)
Your own site
<a href="https://agentmods.dev/skills/claude-office-skills/claude-office-plugin/formula-operations"><img src="https://agentmods.dev/badge/skills/claude-office-skills/claude-office-plugin/formula-operations/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for formula-operations

Your own site · 80×15
<a href="https://agentmods.dev/skills/claude-office-skills/claude-office-plugin/formula-operations"><img src="https://agentmods.dev/badge/skills/claude-office-skills/claude-office-plugin/formula-operations.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 28 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 917 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00028 $0.00917
Opus 5 $0.00014 $0.00458
Sonnet 5 $0.00006 $0.00183
Haiku 4.5 $0.00003 $0.00092

Measured 11d ago against content hash 86b5fd5487d5, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

formula-operations scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/bundled/formula-operations/SKILL.md · 78 lines

What it actually says

公式写入规范

核心原则:用 .Formula 写公式,不用 .Value2 写计算结果

// ✅ 正确:写入公式,Excel 自动计算
ws.Range("D2").Formula = "=B2*C2";
ws.Range("D20").Formula = "=SUM(D2:D19)";

// ❌ 错误:用 JS 算好再写入值(用户无法调参)
ws.Range("D2").Value2 = b2 * c2;

公式拖填(批量写入)

// 方法1: 逐行写入(最可靠)
for (var r = 2; r <= lastRow; r++) {
  ws.Range("D" + r).Formula = "=B" + r + "*C" + r;
}

// 方法2: 首行写入 + AutoFill
ws.Range("D2").Formula = "=B2*C2";
ws.Range("D2").AutoFill(ws.Range("D2:D" + lastRow));

常用公式模板

场景 公式
求和 =SUM(B2:B100)
条件求和 =SUMIF(A2:A100,"条件",B2:B100)
多条件求和 =SUMIFS(C2:C100,A2:A100,"条件1",B2:B100,">0")
计数 =COUNTA(A2:A100)
条件计数 =COUNTIF(A2:A100,"条件")
平均值 =AVERAGE(B2:B100)
查找匹配 =VLOOKUP(查找值,表区域,列号,0)
灵活查找 =INDEX(返回区域,MATCH(查找值,查找区域,0))
条件判断 =IF(条件,"是","否")
嵌套判断 =IF(A2>90,"优",IF(A2>60,"及格","不及格"))
百分比 =B2/SUM(B$2:B$100)
环比增长 =(B3-B2)/B2
排名 =RANK(B2,B$2:B$100)
文本拼接 =A2&"-"&B2

公式纠错方法

// 读取公式内容(不是值)
var formula = ws.Range("D2").Formula;

// 常见错误及修复思路
// #VALUE! → 数据类型不匹配,检查是否文本混在数字中
// #REF!   → 引用了被删除的单元格
// #NAME?  → 函数名拼写错误或不存在
// #DIV/0! → 除数为零,用 =IF(B2=0,0,A2/B2)
// #N/A    → VLOOKUP 找不到值,用 =IFERROR(VLOOKUP(...),"未找到")

WPS 特有注意事项

  • WPS 中 .FormulaR1C1 可能不稳定,优先用 .Formula(A1 格式)
  • 数组公式 {=...} 在 WPS 加载项中支持有限,优先用辅助列拆解
  • 跨工作表引用格式:='表名'!A1
  • 公式中的中文引号会导致错误,确保用英文双引号
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago First seen · 78 lines · 28 tokens per session scan A 86b5fd5487d5

Subscribe to this mod's changes

formula-operations is a skill published in the GitHub repository claude-office-skills/claude-office-plugin (9 stars, last pushed 5mo ago), licensed MIT. It adds 28 tokens to every session and 917 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.