# XLSX Formula Recalc

> Recalculate XLSX formula outputs in Node.js after cell edits without opening Excel, LibreOffice, or browser automation.

- Skill: `zuoguyoupan2023/xlsx-formula-recalc` (Agent Skill)
- Install (CLI): `npx skillmds@latest add zuoguyoupan2023/xlsx-formula-recalc`
- Raw SKILL.md: https://api.skillmd.com/api/skills/zuoguyoupan2023/xlsx-formula-recalc/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Data & Analytics
- Author: zuoguyoupan2023 (https://skillmd.com/u/zuoguyoupan2023)
- Updated: 2026-09-22
- Page: https://skillmd.com/skills/zuoguyoupan2023/xlsx-formula-recalc

---


# XLSX Formula Recalculation

Use `@bilig/xlsx-formula-recalc` when an agent or Node.js service has changed
XLSX inputs and must read recalculated formula outputs without opening Excel,
LibreOffice, or a browser. The unscoped `xlsx-formula-recalc` package remains a
compatibility/search alias; new agent instructions should use the scoped package
first.

## First Check

```sh
npm exec --yes --package @bilig/xlsx-formula-recalc@latest -- bilig-evaluate --door xlsx-cache --json
```

The evaluator should print `schemaVersion: "bilig-evaluator.v1"`,
`door: "xlsx-cache"`, `verified: true`, and evidence for a stale cached
formula corrected to a `Summary!B2` value of `72000`.

For SheetJS / `xlsx` stale-formula issues, use the SheetJS-named binary from the
same package:

```sh
npm exec --yes --package @bilig/xlsx-formula-recalc@latest -- sheetjs-recalc --demo --json
```

If you have a real workbook but do not yet know which formula cells to verify,
inspect it without writing an output file:

```sh
npm exec --yes --package @bilig/xlsx-formula-recalc@latest -- xlsx-recalc workbook.xlsx --inspect --json
```

For CI or issue triage, use the cache-diagnosis alias:

```sh
npm exec --yes --package @bilig/xlsx-formula-recalc@latest -- xlsx-cache-doctor workbook.xlsx --json
```

The inspection output includes `formulaCellCount`, `staleCachedFormulaCount`,
`suggestedReads`, and a `nextStep.command` for the recalculation proof. Default
inspection checks every formula. If a workflow sets `--inspect-limit`, require
`uninspectedFormulaCellCount: 0` before treating the report as complete
coverage.

## Real Workbook

```sh
npm exec --yes --package @bilig/xlsx-formula-recalc@latest -- xlsx-recalc workbook.xlsx \
  --set Inputs!B2=48 \
  --read Summary!B7 \
  --out workbook.recalculated.xlsx \
  --json
```

For linked workbooks, pass companion files:

```sh
npm exec --yes --package @bilig/xlsx-formula-recalc@latest -- xlsx-recalc workbook.xlsx \
  --external-workbook rates.xlsx \
  --read Summary!B7 \
  --json
```

Use an exact target binding when the workbook link target differs from the local
filename:

```sh
npm exec --yes --package @bilig/xlsx-formula-recalc@latest -- xlsx-recalc workbook.xlsx \
  --external-workbook-target ./fixtures/rates-current.xlsx file:///tmp/rates.xlsx \
  --read Summary!B7 \
  --json
```

## TypeScript

```ts
import { recalculateXlsx } from '@bilig/xlsx-formula-recalc'

const result = recalculateXlsx(inputXlsxBytes, {
  edits: [{ target: 'Inputs!B2', value: 48 }],
  reads: ['Summary!B7'],
})
```

Prefer `exceljs-formula-recalc` when the caller already owns an ExcelJS
`Workbook` object and wants read results patched back into that object.

