hyperformula icon indicating copy to clipboard operation
hyperformula copied to clipboard

[Bug]: Error occurs if the formula contains a reference to a range that contains a reference to a range

Open bacek97 opened this issue 11 months ago • 2 comments

Description

Error occurs if the formula contains a reference to a range that contains a reference to a range Error: Value of the formula cell is not computed.

// expected result in all cases: 1
const HyperFormula = require('hyperformula');

const options = {
  licenseKey: 'gpl-v3',
};

let hf = HyperFormula.HyperFormula.buildFromArray(
  [
    [
      1,
      // '=A1+0', // Success
      '=A:A+0', // BUG: Error: Value of the formula cell is not computed.
      '={B:B}',
    ],
  ],
  options
);

Video or screenshots

No response

Demo

https://stackblitz.com/edit/stackblitz-starters-ovw2zlhv?file=index.js

HyperFormula version

2.7.1 , 3.0.0 (develop)

Your framework

No response

Your environment

node v22.10.0 , v18.20.3

bacek97 avatar Jan 12 '25 16:01 bacek97

Thank you for sharing your feedback, @bacek97

At https://hyperformula.handsontable.com/guide/cell-references.html#relative-references you can find the list of supported references.

Zrzut ekranu 2025-01-15 o 13 03 22

The following reference pattern is not reported. I will recheck that with our developer, and if anything changes, I will update the thread.

AMBudnik avatar Jan 15 '25 12:01 AMBudnik

@bacek97 @AMBudnik

I verified that the issue is not caused by the format of the reference. The following example works correctly:

const HyperFormula = require('hyperformula');

const options = {
  licenseKey: 'gpl-v3',
};

let hf = HyperFormula.HyperFormula.buildFromArray(
  [[1, 1, 1, '=A1+0', '=B:B+0', '={C:C}']],
  options
);

console.log(hf.getAllSheetsValues());

It's related to the way these formulas depend on one another. Anyway, I confirm it's a bug and it will be added to our backlog.

sequba avatar Jan 15 '25 12:01 sequba