Error when using a reversible range

Tags: #<Tag:0x00007f452418aa40>

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.