handsontable / handsontable/hyperformula
Add #CALC! error type for Excel compatibility
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 2.8k
- Forks
- 171
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 7
Description
Severity: Low (backlog)
HyperFormula's ErrorType enum does not include CALC. Excel uses #CALC! for several conditions:
- Zero dimensions in array functions (
=SEQUENCE(0),=SEQUENCE(1,0)) - Empty array results
- Certain spill-related errors (separate from
#SPILL!)
Currently these are mapped to ErrorType.NUM (#NUM!), which is the closest semantic match but diverges from Excel.
Known affected locations
SequencePlugin.ts— zero dimension check returns#NUM!instead of#CALC!- Potentially other array functions
Scope
Adding ErrorType.CALC would require:
- New enum value in
src/Cell.ts - New error message in
src/error-message.ts - Export handling in
CellValueExporter - Updates to functions currently returning
#NUM!where#CALC!is correct - Test updates
Impact
Cosmetic divergence from Excel. Does not affect functionality — formulas still error correctly, just with a different error type. Low priority unless Excel compatibility audit (2026 roadmap) prioritizes exact error type matching.
Found during SEQUENCE implementation (PR #1645).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with SequencePlugin.ts, then read src/Cell.ts, src/error-message.ts, and CellValueExporter to trace how error types are defined, messaged, and exported. Identify other array functions that currently return #NUM! for the listed conditions, update the relevant tests, and confirm #CALC! is emitted for those cases without changing other error behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100