Repository navigation
Add TRIMRANGE function (HF-391) - #1842
Draft
Tobiadefami wants to merge 42 commits into
Draft
Tobiadefami wants to merge 42 commits into
Tobiadefami wants to merge 42 commits into
Conversation
TAKE shipped with the English name in 10 of 16 packs while 6 carried a
translation, and VSTACK/HSTACK were English in all 16. Microsoft localizes
all three in most locales, so a user could not type the name their Excel
uses.
Names taken from Microsoft's localized "Excel functions (alphabetical)"
page, one locale at a time. Each row there links to the function's own page
using the English slug in the href while the link text is the localized
name, so the lookup is exact:
<a href="functions/take-function">WYCINEK</a>
Left as English where Microsoft itself does not translate: TAKE, VSTACK and
HSTACK in Indonesian, and VSTACK/HSTACK in Swedish.
Note that a function's own localized page is not a usable source: for
several locales its syntax block still shows the English name even though
the prose and argument names are translated (the French page shows
"=TAKE(tableau, lignes,[colonnes])" while the product uses PRENDRE).
DEV_DOCS records the lookup method and adds the governing policy: ship a
localized name only when it can be confirmed against the product, and keep
the English name otherwise, since an invented name matches nothing, reads
plausibly enough to be typed first, and fails as #NAME?.
No changelog entry: TAKE, VSTACK and HSTACK are all still in [Unreleased],
so no wrong name has been released.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This reverts commit 4459034.
Add the DROP dynamic-array function to ArrayPlugin. DROP removes rows and columns from the start (positive counts) or end (negative counts) of an array. Counts truncate toward zero, and a zero, omitted, or empty count drops nothing. Dropping every row or column returns #N/A, because HyperFormula has no #CALC! error type. Spill-size prediction uses statically known counts, so dropped rows and columns are never reserved. A whole-column or whole-row source spills from its effective size and fits only when the formula starts within the number of rows or columns dropped, matching Excel. TAKE and DROP now share the static count parser, source-range lookup, effective source sizing, and the slice that reads only the kept cells. Localized names are confirmed in Excel Online for every language pack. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A whole-column or whole-row DROP result fits only when the formula starts within the number of rows or columns dropped. Size prediction applied that rule only to statically known counts, so a count from a cell reserved the source's current height wherever the formula was. On another sheet that spilled where Excel returns #SPILL!; on the source's own sheet the reservation made the column taller and the result threw "Resizing to smaller array". An unresolved count already counts as dropping nothing for the size bound; it now does for the placement rule too, so the result fits only in the first row or column. Documented in list-of-differences. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add two general rows that apply to array functions whose size is predicted before evaluation: an error result fills the whole reserved area, and a size that depends on cell values reserves the upper bound, so an occupied cell inside it gives #SPILL! where Excel spills. Add a DROP row for ISREF, which is FALSE because DROP returns values rather than a reference. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings in develop through the TAKE branch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
TRIMRANGE removes the blank rows and columns at the edges of a range or array. A cell of a range is blank only when it is empty, so a formula is kept even when its value is blank. Each trim code is an integer from 0 to 3; any other value is a #VALUE! error. A source with nothing left to keep returns #REF!. The result size is predicted before evaluation, so the untrimmed source is reserved and the result fills its top-left corner. Whole columns and rows follow TAKE's sheet-edge rule, now one helper shared by both functions; TAKE's results are unchanged. Adds the catalogue entry, the license table entry, the name in every language pack, list-of-differences rows and a changelog entry. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
hyperformula-docs | c9973b8 | Commit Preview URL Branch Preview URL |
Oct 24 2026, 10:43 PM |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #1842 +/- ##
===========================================
+ Coverage 97.28% 97.35% +0.07%
===========================================
Files 207 207
Lines 16218 16517 +299
Branches 3556 3708 +152
===========================================
+ Hits 15777 16080 +303
+ Misses 433 429 -4
Partials 8 8
🚀 New features to boost your workflow:
|
Performance comparison of head (c9973b8) vs base (d143456) |
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.
Context
This PR adds the
TRIMRANGEdynamic-array function (HF-391).TRIMRANGE(range, [trim_rows], [trim_cols])returns a range without the blank rows and columns at its edges.Important
Stacked on #1796 (
DROP), which is stacked on #1722 (TAKE). Until both merge, this diff also shows their commits. This change is the last commit,feat: add TRIMRANGE function (HF-391), plus a changelog link commit. Once #1722 and #1796 merge, this branch will be rebased ontodevelop.Behavior, checked against Microsoft Excel Online (en-US):
""return#VALUE!; numeric text andTRUE/FALSEare accepted.FALSE, errors and spaces are content, and blank cells inside the result stay blank.#REF!.Differences from Excel, listed in
list-of-differences.md:#VALUE!#VALUE!ISREFis TRUE)A1:.C10trim referencesImplementation
TRIMRANGElives inArrayPlugin, afterTAKE. Codes are read as single values and coerced in the method, so errors are reported in Excel's order.TAKE.TAKE's results are unchanged.list-of-differences.mdrows. Localized names come from Excel Online in each locale; Indonesian keeps the English name.How did you test your changes?
TAKEgave identical results on 540 probes before and after the shared helper.npm run compile,npm run docs:generate-function-docsandgit diff --checkpass. Lint shows no warnings on new lines.Types of changes
Related issues:
DROP) and Feature/take function #1722 (TAKE).Checklist:
🤖 Generated with Claude Code