-
Notifications
You must be signed in to change notification settings - Fork 154
Add #CALC! error type for Excel compatibility #1647
Copy link
Copy link
Open
Labels
FeatureSomething we can add later on without introducing a breaking changeSomething we can add later on without introducing a breaking changeTo Be DiscussedExtra attention is neededExtra attention is needed
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).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
FeatureSomething we can add later on without introducing a breaking changeSomething we can add later on without introducing a breaking changeTo Be DiscussedExtra attention is neededExtra attention is needed