Error when using a reversible range

Tags: #<Tag:0x00007f8b23dbe218>

HyperFormula throw error “Incorrect array size” when I try to use formula with range from greater to lower cell.

E.g.
=sum(A1:A2) - work
=sum(A2:A1) - throw error
JS fiddle example - https://jsfiddle.net/DenialT/dL94xeuz/

I found, that it happens because height is calculates as 0 in AbsoluteCellRange.ts (line 238).
It formulas is
this.end.row - this.start.row + 1
and if I replace it to
Math.max(this.end.row, this.start.row) - Math.min(this.end.row, this.start.row) + 1
it prevent error, but not calculate formula correctly.

Hi @midaV

reversed ranges were out of the scope for the HyperFormula engine. However, I have opened up a discussion on its Github board to provide such functionality. Here is the link https://github.com/handsontable/hyperformula/discussions/832

If you would like to add anything to that topic please leave your comment at https://github.com/handsontable/hyperformula/discussions/832

Hi @aleksandra_budnik
Thanks, will watch this discussion.

Hi @midaV

I have good news. We just released HyperFormula v2.0.0. where we added support for reversed ranges. Here https://github.com/handsontable/hyperformula/issues/964 is a full list of changes.
Soon HF 2.0.0 will be also updated within Handsontable.