Skip to content
Merged
Show file tree
Hide file tree
Changes from 36 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
5c3df0c
feat: add TAKE function
Tobiadefami Aug 4, 2026
efde710
docs: align TAKE comments with array plugin style
Tobiadefami Aug 4, 2026
d76e2b4
fix: return CALC for empty TAKE results
Tobiadefami Aug 5, 2026
2174419
docs: document TAKE CALC behavior
Tobiadefami Aug 5, 2026
1f3e435
docs: link TAKE PR in changelog
Tobiadefami Aug 6, 2026
a66b330
fix: refine TAKE argument and error handling
Tobiadefami Aug 7, 2026
14da55a
fix: predict TAKE size from literal counts
Tobiadefami Aug 7, 2026
7ed7256
perf: avoid materializing unused TAKE cells
Tobiadefami Aug 7, 2026
b902d53
i18n: use Excel's official names for TAKE, VSTACK and HSTACK
sequba Aug 10, 2026
4172023
fix: avoid breaking language packs for TAKE
Tobiadefami Aug 11, 2026
d6708dc
fix: enforce TAKE arity locally
Tobiadefami Aug 11, 2026
3335d99
docs: remove unrelated translation policy
Tobiadefami Aug 11, 2026
86a6a93
fix: preserve TAKE result identity
Tobiadefami Aug 11, 2026
d7c87b8
fix: reject unbounded TAKE results
Tobiadefami Aug 11, 2026
f34f6a8
fix: size TAKE from numeric text literals
Tobiadefami Aug 12, 2026
a18429c
fix: preserve TAKE coercion errors
Tobiadefami Aug 12, 2026
4459034
fix: align TAKE sizing with Excel
Tobiadefami Aug 17, 2026
5ca25fc
Revert "fix: align TAKE sizing with Excel"
Tobiadefami Aug 17, 2026
cb5bc3c
fix: align TAKE result sizing with Excel
Tobiadefami Aug 17, 2026
9e38116
docs: document localized stack function names
Tobiadefami Aug 17, 2026
3fd5a70
fix: evaluate constant TAKE dimensions before spill allocation
Tobiadefami Aug 25, 2026
a5ecaa2
Merge branch 'develop' into feature/take-function
sequba Sep 2, 2026
5078a8c
fix: allow nested unbounded TAKE results
Tobiadefami Sep 2, 2026
f53a01b
Merge branch 'develop' into feature/take-function
Tobiadefami Sep 2, 2026
9bd7be4
fix: preserve TAKE zero-count errors
Tobiadefami Sep 2, 2026
5b1bd12
fix: bound unbounded TAKE predictions
Tobiadefami Sep 2, 2026
7c5e0b4
fix: preserve bounded TAKE predictions
Tobiadefami Sep 2, 2026
67b26a2
refactor: short-circuit zero TAKE dimensions
Tobiadefami Sep 2, 2026
453b097
fix: respect boolean overrides in TAKE size prediction
Tobiadefami Sep 3, 2026
2f5a74d
fix: distinguish unresolved TAKE dimensions
Tobiadefami Sep 3, 2026
8d9e74e
docs: correct TAKE compatibility details
Tobiadefami Sep 3, 2026
95c86fe
Merge branch 'develop' into feature/take-function
Tobiadefami Oct 2, 2026
043bd70
Merge branch 'develop' into feature/take-function
Tobiadefami Oct 21, 2026
d0e4a3c
Register TAKE in the license capability table
Tobiadefami Oct 21, 2026
d382d7d
Return #SPILL! for TAKE over a same-sheet whole column with a count f…
Tobiadefami Nov 2, 2026
6d0464d
Merge remote-tracking branch 'origin/develop' into feature/take-function
Tobiadefami Nov 2, 2026
09c2e40
Merge remote-tracking branch 'origin/develop' into feature/take-function
Tobiadefami Nov 5, 2026
00e6379
Document that TAKE over a whole row counts back from the last used co…
Tobiadefami Nov 5, 2026
a2e1980
Merge remote-tracking branch 'origin/develop' into feature/take-function
Tobiadefami Nov 11, 2026
6b4b1c0
Spill TAKE results whose cell-read count fits the reserved area
Tobiadefami Nov 11, 2026
e3f952f
Report TAKE's rows argument as required
Tobiadefami Nov 12, 2026
ab5fc64
Merge remote-tracking branch 'origin/develop' into feature/take-function
Tobiadefami Nov 12, 2026
df4c98d
Merge remote-tracking branch 'origin/develop' into feature/take-function
Tobiadefami Nov 16, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## [Unreleased]

### Added

- Added the `TAKE` dynamic-array function. [#1722](https://github.com/handsontable/hyperformula/pull/1722)

### Fixed

- Fixed the `EDATE` function returning the 28th of February instead of the 29th when the shifted date falls in February of a leap year (e.g. `=EDATE(DATE(2028, 1, 31), 1)` now returns `2028-02-29` instead of `2028-02-28`). [#1781](https://github.com/handsontable/hyperformula/pull/1781)
Expand Down
5 changes: 5 additions & 0 deletions docs/guide/list-of-differences.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@ To remove the differences, create [custom implementations](custom-functions.md)
| NORMSDIST | =NORMSDIST(0, TRUE()) | 0.5 | Wrong number | Wrong number |
| ADDRESS | =ADDRESS(1,1,4, TRUE(), "") | !A1 | ''!A1 | !A1 |
| SEQUENCE | =SEQUENCE(0) | VALUE | N/A | CALC |
| TAKE | =TAKE(A1:A3, 0) | N/A | No such function. | CALC |
Comment thread
marcin-kordas-hoc marked this conversation as resolved.
Resolved
| TAKE | =TAKE(Data!A:A, , 1) | Spills to the source sheet's current height from row 1; returns SPILL below row 1. | No such function. | Spills all 1,048,576 rows from row 1, with blank source cells as 0; returns SPILL below row 1. |
Comment thread
marcin-kordas-hoc marked this conversation as resolved.
Resolved
| TAKE | =SUM(TAKE(A:A, -2))<br>where A1:A5: 1, 2, 3, 4, 5 | 9 (counts back from the last used row) | No such function. | 0 (counts back from the last row of the sheet) |
Comment thread
marcin-kordas-hoc marked this conversation as resolved.
Resolved
| TAKE | =TAKE(A:A, B1) in C5,<br>where A1:A5: 1, 2, 3, 4, 5 and B1 = 6 | Returns SPILL: below row 1, a count read from a cell can't size a whole-column result on the source's own sheet. Row 1 works. | No such function. | Spills 1, 2, 3, 4, 5, 0 into C5:C10. |
Comment thread
marcin-kordas-hoc marked this conversation as resolved.
Resolved
| TAKE | =TAKE(A1:C3, NA()) | Fills the whole area reserved for the array (here 3x3) with N/A. | No such function. | A single N/A error. |
| INT | =INT(-8.9) | -8 | -9 | -9 |
| ISEVEN | =ISEVEN(2.5) | FALSE | TRUE | TRUE |
| ISODD | =ISODD(3.5) | FALSE | TRUE | TRUE |
Expand Down
1 change: 1 addition & 0 deletions hyperformula/src/error-message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export class ErrorMessage {
public static IncorrectDateTime = 'String does not represent correct DateTime.'
public static CharacterCodeBounds = 'Character code out of bounds.'
public static NonZero = 'Argument cannot be 0.'
public static ZeroRowOrColumnCount = 'Row or column count cannot be zero.'
public static LessThanOne = 'Argument cannot be less than 1.'
public static WeekendString = 'Incorrect weekend bitmask string.'
public static InvalidRoman = 'Invalid roman numeral.'
Expand Down
1 change: 1 addition & 0 deletions hyperformula/src/i18n/languages/csCZ.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ const dictionary: RawTranslationPackage = {
SWITCH: '',
SYD: 'ODPIS.NELIN',
T: 'T',
TAKE: 'VZÍT',
TAN: 'TG',
TANH: 'TGH',
TBILLEQ: 'TBILLEQ',
Expand Down
1 change: 1 addition & 0 deletions hyperformula/src/i18n/languages/daDK.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ const dictionary: RawTranslationPackage = {
SWITCH: '',
SYD: 'ÅRSAFSKRIVNING',
T: 'T',
TAKE: 'TAG',
TAN: 'TAN',
TANH: 'TANH',
TBILLEQ: 'STATSOBLIGATION',
Expand Down
1 change: 1 addition & 0 deletions hyperformula/src/i18n/languages/deDE.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ const dictionary: RawTranslationPackage = {
SWITCH: '',
SYD: 'DIA',
T: 'T',
TAKE: 'ÜBERNEHMEN',
TAN: 'TAN',
TANH: 'TANHYP',
TBILLEQ: 'TBILLÄQUIV',
Expand Down
1 change: 1 addition & 0 deletions hyperformula/src/i18n/languages/enGB.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ const dictionary: RawTranslationPackage = {
SWITCH: 'SWITCH',
SYD: 'SYD',
T: 'T',
TAKE: 'TAKE',
TAN: 'TAN',
TANH: 'TANH',
TBILLEQ: 'TBILLEQ',
Expand Down
1 change: 1 addition & 0 deletions hyperformula/src/i18n/languages/esES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ export const dictionary: RawTranslationPackage = {
SWITCH: '',
SYD: 'SYD',
T: 'T',
TAKE: 'TOMAR',
TAN: 'TAN',
TANH: 'TANH',
TBILLEQ: 'LETRA.DE.TEST.EQV.A.BONO',
Expand Down
1 change: 1 addition & 0 deletions hyperformula/src/i18n/languages/fiFI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ const dictionary: RawTranslationPackage = {
SWITCH: '',
SYD: 'VUOSIPOISTO',
T: 'T',
TAKE: 'OTA',
TAN: 'TAN',
TANH: 'TANH',
TBILLEQ: 'OBLIG.TUOTTOPROS',
Expand Down
1 change: 1 addition & 0 deletions hyperformula/src/i18n/languages/frFR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ const dictionary: RawTranslationPackage = {
SWITCH: '',
SYD: 'SYD',
T: 'T',
TAKE: 'PRENDRE',
TAN: 'TAN',
TANH: 'TANH',
TBILLEQ: 'TAUX.ESCOMPTE.R',
Expand Down
1 change: 1 addition & 0 deletions hyperformula/src/i18n/languages/huHU.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ const dictionary: RawTranslationPackage = {
SWITCH: '',
SYD: 'ÉSZÖ',
T: 'T',
TAKE: 'ÁTHELYEZ',
TAN: 'TAN',
TANH: 'TANH',
TBILLEQ: 'KJEGY.EGYENÉRT',
Expand Down
1 change: 1 addition & 0 deletions hyperformula/src/i18n/languages/idID.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ const dictionary: RawTranslationPackage = {
SWITCH: 'BERALIH',
SYD: 'SYD',
T: 'T',
TAKE: 'TAKE',
TAN: 'TAN',
TANH: 'TANH',
TBILLEQ: 'TBILL.SAMA',
Expand Down
1 change: 1 addition & 0 deletions hyperformula/src/i18n/languages/itIT.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ const dictionary: RawTranslationPackage = {
SWITCH: '',
SYD: 'AMMORT.ANNUO',
T: 'T',
TAKE: 'INCLUDI',
TAN: 'TAN',
TANH: 'TANH',
TBILLEQ: 'BOT.EQUIV',
Expand Down
1 change: 1 addition & 0 deletions hyperformula/src/i18n/languages/nbNO.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ const dictionary: RawTranslationPackage = {
SWITCH: '',
SYD: 'ÅRSAVS',
T: 'T',
TAKE: 'TA',
TAN: 'TAN',
TANH: 'TANH',
TBILLEQ: 'TBILLEKV',
Expand Down
1 change: 1 addition & 0 deletions hyperformula/src/i18n/languages/nlNL.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ const dictionary: RawTranslationPackage = {
SWITCH: '',
SYD: 'SYD',
T: 'T',
TAKE: 'NEMEN',
TAN: 'TAN',
TANH: 'TANH',
TBILLEQ: 'SCHATK.OBL',
Expand Down
1 change: 1 addition & 0 deletions hyperformula/src/i18n/languages/plPL.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ const dictionary: RawTranslationPackage = {
SWITCH: 'PRZEŁĄCZ',
SYD: 'SYD',
T: 'T',
TAKE: 'WYCINEK',
TAN: 'TAN',
TANH: 'TANH',
TBILLEQ: 'RENT.EKW.BS',
Expand Down
1 change: 1 addition & 0 deletions hyperformula/src/i18n/languages/ptPT.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ const dictionary: RawTranslationPackage = {
SWITCH: '',
SYD: 'SDA',
T: 'T',
TAKE: 'INCLUIR',
Comment thread
cursor[bot] marked this conversation as resolved.
Resolved
TAN: 'TAN',
TANH: 'TANH',
TBILLEQ: 'OTN',
Expand Down
1 change: 1 addition & 0 deletions hyperformula/src/i18n/languages/ruRU.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ const dictionary: RawTranslationPackage = {
SWITCH: '',
SYD: 'АСЧ',
T: 'Т',
TAKE: 'ВЗЯТЬ',
TAN: 'TAN',
TANH: 'TANH',
TBILLEQ: 'РАВНОКЧЕК',
Expand Down
1 change: 1 addition & 0 deletions hyperformula/src/i18n/languages/svSE.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ const dictionary: RawTranslationPackage = {
SWITCH: '',
SYD: 'ÅRSAVSKR',
T: 'T',
TAKE: 'TA',
TAN: 'TAN',
TANH: 'TANH',
TBILLEQ: 'SSVXEKV',
Expand Down
1 change: 1 addition & 0 deletions hyperformula/src/i18n/languages/trTR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ const dictionary: RawTranslationPackage = {
SWITCH: '',
SYD: 'YAT',
T: 'T',
TAKE: 'AL',
TAN: 'TAN',
TANH: 'TANH',
TBILLEQ: 'HTAHEŞ',
Expand Down
13 changes: 13 additions & 0 deletions hyperformula/src/interpreter/Interpreter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import {
import {CriterionBuilder} from './Criterion'
import {FunctionRegistry} from './FunctionRegistry'
import {InterpreterState} from './InterpreterState'
import {FunctionPluginDefinition} from './plugin/FunctionPlugin'
import {
cloneNumber,
EmptyValue,
Expand Down Expand Up @@ -65,6 +66,18 @@ export class Interpreter {
this.functionCallLicenseGate = new FunctionCallLicenseGate(config, functionRegistry)
}

/**
* Checks whether a function is implemented by a specific plugin in this interpreter's engine instance.
*
* @param {string} functionId - The canonical function identifier.
* @param {FunctionPluginDefinition} plugin - The plugin class to compare with the registered implementation.
* @returns {boolean} `true` when the function is implemented by the given plugin class.
* @internal
*/
public isFunctionImplementedBy(functionId: string, plugin: FunctionPluginDefinition): boolean {
return this.functionRegistry.getFunctionPlugin(functionId) === plugin
}

public evaluateAst(ast: Ast, state: InterpreterState): InterpreterValue {
let val = this.evaluateAstWithoutPostprocessing(ast, state)
if (isExtendedNumber(val)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,13 @@ export const LOOKUP_AND_REFERENCE_DOCS: Record<string, FunctionDoc> = {
documentationUrl: 'https://hyperformula.handsontable.com/docs/guide/built-in-functions.html',
examples: ['=SORT(A1:A10)', '=SORT(A1:B10, 2, -1)'],
},
TAKE: {
category: 'Lookup and reference',
shortDescription: 'Returns specified rows or columns from the beginning or end of an array.',
parameters: [{name: 'array', description: 'The array or range from which to take rows or columns.'}, {name: 'rows', description: 'The number of rows to take; a negative value takes rows from the end. An empty argument keeps all rows.'}, {name: 'columns', description: 'The number of columns to take; a negative value takes columns from the end. When omitted or empty, all columns are kept.'}],
documentationUrl: 'https://hyperformula.handsontable.com/docs/guide/built-in-functions.html',
examples: ['=TAKE(A1:C5, 2)', '=TAKE(A1:C5, -2, -1)', '=TAKE(A1:C5, , 2)'],
},
TRANSPOSE: {
category: 'Lookup and reference',
shortDescription: 'Transposes the rows and columns of an array.',
Expand Down
Loading
Loading