Error when using a reversible range

Tags: #<Tag:0x00007f24920cdab0>

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

=sum(A1:A2) - work
=sum(A2:A1) - throw error
JS fiddle example -

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

If you would like to add anything to that topic please leave your comment at

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 is a full list of changes.
Soon HF 2.0.0 will be also updated within Handsontable.