Repository navigation
Add TYPE and ERROR.TYPE functions (HF-488, HF-489) - #1813
marcin-kordas-hoc wants to merge 8 commits into
Conversation
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Bugbot is paused — on-demand spend limit reachedBugbot uses usage-based billing for this team and has hit its on-demand spend limit. A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue. |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
hyperformula-docs | 4701090 | Commit Preview URL Branch Preview URL |
Oct 23 2026, 08:33 AM |
Performance comparison of head (4701090) vs base (d143456) |
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Bugbot is paused — on-demand spend limit reachedBugbot uses usage-based billing for this team and has hit its on-demand spend limit. A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue. |
…e measured Excel results Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Bugbot is paused — on-demand spend limit reachedBugbot uses usage-based billing for this team and has hit its on-demand spend limit. A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue. |
…-type # Conflicts: # CHANGELOG.md
…s in the Excel column The two new rows of the list of differences had the Excel results in the Google Sheets column. The TYPE row now also says that, without array arithmetic, a computed range is reduced to the cell in the formula's row, so TYPE gives 1 or 16 depending on where the formula sits. The ERROR.TYPE description lists 9 for #SPILL!. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit c1302d0. Configure here.
…ways a number Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s instead of throwing Building the range of a sheet-spanning reference threw SheetsNotEqual out of evaluation. Such a reference makes ROW and COLUMN return #REF!, so TYPE now classifies it as an error. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #1813 +/- ##
========================================
Coverage 97.28% 97.28%
========================================
Files 207 207
Lines 16218 16264 +46
Branches 3556 3602 +46
========================================
+ Hits 15777 15823 +46
Misses 433 433
Partials 8 8
🚀 New features to boost your workflow:
|

Summary
Adds two information functions:
TYPEandERROR.TYPE(HF-488, HF-489).TYPE(value)returns 1 for a number, 2 for text, 4 for a boolean, 16 for an error and 64 for an array or a multi-cell range. A single-cell reference is read as its value, so a blank cell gives 1.ERROR.TYPE(error_val)returns the code of an error:#DIV/0!2,#VALUE!3,#REF!4,#NAME?5,#NUM!6,#N/A7,#SPILL!9. Any other value, including a blank cell or an error without a code, gives#N/A.InformationPlugin, with metadata, translations, the license capability table entries, two rows indocs/guide/list-of-differences.mdand a CHANGELOG entry.Behaviour check against Excel
74 formulas were evaluated in Excel Online (MS Graph live session) and in HyperFormula: 73 identical, 1 different, 0 not evaluable. They cover numbers, text, booleans, errors of every kind HyperFormula has, typed numbers (percentage and date cells), blank cells, formulas that return text, multi-cell and whole-column ranges for
TYPE, and nested calls. Later runs measured a blocked spill (Excel returns 9 fromERROR.TYPE, and so does HyperFormula now), 11 moreTYPEformulas overROW,COLUMNand a single-cell range (all identical), and 5TYPEformulas over computed arrays.The differences, both listed in
docs/guide/list-of-differences.md:ERROR.TYPE(#NULL!): Excel returns 1. HyperFormula has no#NULL!error and cannot parse the literal.#CYCLE!, which Excel does not have, gives#N/A.TYPEof a computed array: Excel returns 64 forROW(A1:A2)+0,A1:A2+1andIF(TRUE(), A1:A2). HyperFormula gives 1 forROW(A1:A2)+0. WithuseArrayArithmeticset totrueit gives 64 for the other two; with the defaultfalsethe range is reduced to the cell in the formula's row, soTYPEclassifies that cell's value, or gives 16 (#VALUE!) outside the range's rows.ERROR.TYPEover a multi-cell range depends on how the result spills in Excel, so it is not asserted.Translations
Each localized name was checked on Microsoft's page for the function in that language (
support.microsoft.com/<locale>/excel/functions/<function>): for all 15 languages and both functions, the name used here is in the page's title or heading and in its syntax line. On the SwedishERROR.TYPEpage the heading shows the English name, while the title and the syntax showFEL.TYP.enGBandidIDkeep the English names, which their Microsoft pages also use.Tests
Paired tests branch:
feat/hf-type-error-typein the tests repository (35 tests, including one that parses the GermanTYPand one that parses the PolishNR.BŁĘDU). All 35 fail againstdevelop. Full local run on this head: 522 suites, 6777 passed, 3 skipped.🤖 Generated with Claude Code
Note
Low Risk
Adds two self-contained information functions in InformationPlugin with documented Excel deltas; no auth, persistence, or core calculation pipeline changes.
Overview
Adds Excel-style
TYPEandERROR.TYPEinformation functions to the formula engine.TYPE(value)returns numeric type codes (1 number/empty, 2 text, 4 boolean, 16 error, 64 array/range). Errors are classified instead of bubbling. Multi-cell ranges and a special case treatROW/COLUMNover a multi-cell range as array type (64) for Excel parity.ERROR.TYPE(value)maps HyperFormula error kinds to Excel codes (2–7, 9 for#SPILL!) and returns#N/Afor non-errors or errors without a code (e.g.#CYCLE!).Supporting updates: function metadata, 15 locale names, license capability entries, CHANGELOG, and list-of-differences notes for
#NULL!,#CYCLE!, and computed-arrayTYPEbehavior vs Excel/useArrayArithmetic.Reviewed by Cursor Bugbot for commit 4701090. Bugbot is set up for automated code reviews on this repo. Configure here.