Repository navigation
Add TEXTBEFORE, TEXTAFTER and TEXTSPLIT functions - #1792
Open
marcin-kordas-hoc wants to merge 7 commits into
Open
marcin-kordas-hoc wants to merge 7 commits into
marcin-kordas-hoc wants to merge 7 commits into
Conversation
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
hyperformula-docs | d8d10f5 | Commit Preview URL Branch Preview URL |
Oct 08 2026, 04:29 AM |
Performance comparison of head (d8d10f5) vs base (3a9c34b) |
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
A number literal with a sign is parsed as a unary operator, so the result size of =TEXTSPLIT(-12.5, ".") was not predicted and the formula returned #VALUE!. The two remaining differences from Excel (#N/A instead of #CALC!, literal arguments needed for sizing) are documented. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
marcin-kordas-hoc
force-pushed
the
feat/hf-text-splitting
branch
from
October 8, 2026 03:51
ee4be12 to
08ca084
Compare
…y table Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 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 d8d10f5. Configure here.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #1792 +/- ##
===========================================
+ Coverage 97.26% 97.30% +0.04%
===========================================
Files 203 203
Lines 16022 16188 +166
Branches 3555 3612 +57
===========================================
+ Hits 15583 15751 +168
+ Misses 431 429 -2
Partials 8 8
🚀 New features to boost your workflow:
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Adds three functions:
TEXTBEFORE,TEXTAFTERandTEXTSPLIT(HF-465, HF-466, HF-467).TEXTBEFORE(text, delimiter, [instance_num], [match_mode], [match_end], [if_not_found])returns the text before the nth occurrence ofdelimiter;TEXTAFTERreturns the text after it. A negativeinstance_numcounts from the end,match_mode1 ignores case,match_end1 treats the end of the text as a delimiter, andif_not_foundreplaces#N/A.TEXTSPLIT(text, col_delimiter, [row_delimiter], [ignore_empty], [match_mode], [pad_with])splits text into a two-dimensional array. It is an array function and follows the existing array-function conventions (size prediction and spilling).TextPlugin, with metadata catalogue entries, translations for all built-in languages (English names kept, as no localized names were confirmed) and a CHANGELOG entry. No shared code is changed.Behaviour check against Excel
98 formulas were evaluated in Excel Online (MS Graph live session) and in HyperFormula: 93 identical, 5 different. The 5 differences are explained and none points at a defect of these functions:
1.5to the text1,5andTRUEtoPRAWDAbefore searching, soTEXTBEFORE(1.5,".")is#N/Ain that Excel whileTEXTBEFORE(1.5,",")is1(measured). HyperFormula converts to1.5andTRUE.INDEXpast the end of an array: Excel#REF!, HyperFormula#NUM!. That is the generalINDEXbehaviour, not specific toTEXTSPLIT.TEXTSPLITresults were compared throughROWS,COLUMNSandINDEXprobes (dimensions and individual elements), not by reading the spilled range. Inline array constants as delimiters ({",",";"}) could not be sent to Excel through the Graph API, so that form is covered by tests but not measured.Known differences from Excel
Both are recorded in
docs/guide/list-of-differences.md:ignore_emptyis on and nothing is left after splitting (=TEXTSPLIT(",,", ",", , TRUE)), Excel returns#CALC!and HyperFormula#N/A, because HyperFormula has no#CALC!error.ignore_emptyandmatch_modeare literals (a number may carry a sign). With anything else, such as=TEXTSPLIT(1+1, ""), the formula is treated as one value and a longer result is#VALUE!. This is the same limitation asSEQUENCEwith non-literal dimensions (=SEQUENCE(1+1)is#VALUE!today). Inside another function, for example=INDEX(TEXTSPLIT(A1, ","), 1, 2), any argument works. Cursor Bugbot raised this; the sign case is fixed and the rest is documented rather than changed, since fixing it for all array functions is a separate piece of work.Tests
Paired tests branch:
feat/hf-text-splittingin the tests repository (3 spec files, 211 tests). Full local run: 505 suites, 6445 passed, 3 skipped. Patch coverage of the new lines inTextPlugin.tsis complete except two defensive branches.🤖 Generated with Claude Code
Note
Low Risk
New optional text functions in an isolated plugin with documented Excel deltas; no changes to core evaluation or licensing beyond registering the new names.
Overview
Adds Excel-style text functions
TEXTBEFORE,TEXTAFTER, andTEXTSPLITinTextPlugin, with shared delimiter matching (multi-delimiter, nth occurrence from either end, case sensitivity, optional end-of-text boundary, customif_not_found).TEXTSPLITreturns a spilled 2D array (row/column delimiters,ignore_empty, padding) and usestextsplitArraySizeso spill dimensions are known only when text, delimiters,ignore_empty, andmatch_modeare literals—same pattern asSEQUENCEwith non-literal sizes.Wiring updates: function metadata, license capability list, CHANGELOG, i18n entries (English names), and
list-of-differences.mdnotes (#N/Ainstead of Excel’s#CALC!when ignore-empty leaves nothing; literal-only spill sizing).Reviewed by Cursor Bugbot for commit d8d10f5. Bugbot is set up for automated code reviews on this repo. Configure here.