Repository navigation
Add TOROW and TOCOL functions (HF-388, HF-387) - #1828
Draft
Tobiadefami wants to merge 38 commits into
Draft
Tobiadefami wants to merge 38 commits into
Tobiadefami wants to merge 38 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>
Add TOROW and TOCOL to ArrayPlugin as one implementation with the result's orientation as a parameter, reusing DROP's count parser and whole-column size helpers. The ignore argument skips blank cells, errors or both; with it, the spill reserves the source's size and leaves the unused cells blank. Also add the catalogue entries, the localized names, the known limitations, the list-of-differences rows and the changelog entry. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@Tobiadefami thanks for the pull request. No CLA step needed here — our records show you signed the Contributor License Agreement on 2026-07-31. That signature came from our previous signing form and has been carried over, so there is nothing for you to re-sign. |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
hyperformula-docs | 89ce2a7 | Commit Preview URL Branch Preview URL |
Oct 15 2026, 11:12 PM |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Performance comparison of head (dbfb538) vs base (e7e4aae) |
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
TOROWandTOCOLdynamic-array functions (HF-388, HF-387).TOROW(array, [ignore], [scan_by_column])returns an array as one row andTOCOL(array, [ignore], [scan_by_column])as one column, read by row unlessscan_by_columnis TRUE.Important
Stacked on #1796 (
DROP), which is stacked on #1722 (TAKE). TOROW and TOCOL reuse the count parser and the whole-column size helper that those PRs introduce, so this branch is based onfeature/hf-384-drop. Until both merge, this diff also shows their commits. The TOROW and TOCOL change is the last commit,feat: add TOROW and TOCOL functions (HF-388, HF-387), plus a changelog link commit. Once #1722 and #1796 merge, this branch will be rebased ontodevelopand only those commits will remain.Behavior, checked against Microsoft Excel Online (en-US):
ignore0 keeps every element, 1 skips blank cells, 2 skips errors (every error type), 3 skips both. It is truncated toward zero; other values return#VALUE!. An empty-text cell is text, so it is kept.ignoreaccepts numbers, numeric text,TRUE/FALSEand a blank cell;""and other text return#VALUE!.scan_by_columnaccepts numbers, booleans and the text"TRUE"/"FALSE";"", numeric text and other text return#VALUE!.ISBLANKis TRUE).#N/Awith the message "Empty array not allowed.". Excel returns#CALC!, which HyperFormula does not have.ignore,scan_by_column, then the range ofignore. An emptyarrayargument returns#VALUE!.Implementation
TOROWandTOCOLlive inArrayPlugin, afterDROP, as one implementation with the result's orientation as a parameter.ignore0 the size is exact. Withignore1-3, or anignorethat is not a literal, the result's length depends on the data, so the source's size is reserved and the cells after the result are blank, as forFILTERandUNIQUE.TAKEandDROPdo. A whole column on the formula's own sheet, or one computed by a formula, spills from the first row only; elsewhere it returns#SPILL!. This keeps the reserved space from making its own source taller each time the formula is entered.ignoreorscan_by_columnuses its first value. Excel returns one result per element.TOROW and TOCOL functionssection inknown-limitations.md, and rows inlist-of-differences.mdare included. The Google Sheets column of the new rows is still being filled in.How did you test your changes?
TOROWand 140TOCOLtests, generated from 135 cases per function measured in Microsoft Excel Online (en-US) on the same data, plus spill-placement tests for whole-column and whole-row sources.TAKEandDROPtests pass unchanged.ignorefailed 20 tests, and not skipping errors withignore3 failed 8.npm run compileandnpm run docs:generate-function-docspass, and lint reports no errors.Types of changes
Related issues:
DROP) and Feature/take function #1722 (TAKE).Checklist:
🤖 Generated with Claude Code