hyperformula icon indicating copy to clipboard operation
hyperformula copied to clipboard

FORMULATEXT failing when the argument is not a CellReference type

Open thilgen opened this issue 1 year ago • 1 comments

Description

This works as expected in Google Sheets and Excel

const hyperformulaInstance = HyperFormula.buildEmpty({
  licenseKey: 'internal-use-in-handsontable',
});

const containerName = 'example'
var container = document.getElementById('example')
container.hot = new Handsontable(
  container,
  {
    licenseKey: 'non-commercial-and-evaluation',
    rowHeaders: false,
    colHeaders: false,
    height: 'auto',
    fillHandle: false,
    formulas: {
      engine: hyperformulaInstance,
      sheetName: containerName
    },   
    data: [
      [1, 2, '=SUM(A1:B1)', '=FORMULATEXT(C1)'],
      [2, 3, '=SUM(A2:B2)', '=FORMULATEXT(index(C:C,2))'],
      [3, 4, '=SUM(A3:B3)', '=FORMULATEXT(index(C:C,ROW()))'],
    ]
  }
)
Platform Results
HyperFormula image
Google Sheets image
MS Excel image

Steps to reproduce

  1. JSFiddle Example

Your environment

  • Handsontable: v12.3.2 (22/03/2023 14:43:31)
  • HyperFormula: 2.3.1
  • Browser Name & OS: Mac + Chrome

thilgen avatar Mar 29 '23 03:03 thilgen

My guess is that our implementation of INDEX returns a simple value from the referenced cell (without metadata etc). We should fix it or describe this limitation in https://hyperformula.handsontable.com/guide/list-of-differences.html

sequba avatar Mar 29 '23 09:03 sequba