handsontable / hyperformula

HyperFormula is an open-source headless spreadsheet for business web apps. It comes with over 400 formulas, CRUD operations, undo-redo, clipboard support, and sorting.
https://hyperformula.handsontable.com/
GNU General Public License v3.0
1.88k stars 107 forks source link

Excel compatibility issues #1392

Closed dabreegster closed 2 months ago

dabreegster commented 3 months ago

Page URL

https://hyperformula.handsontable.com/guide/compatibility-with-microsoft-excel.html

Improvement description

Hi, I'm using Hyperformula along with https://www.npmjs.com/package/exceljs to automate the use of some Excel models. My script sets input cells, then scrapes some output cells. I started from https://github.com/handsontable/hyperformula-demos/tree/develop/read-excel-file, but to get my particular XLSX working, I wound up with some changes: https://gist.github.com/dabreegster/253ab5f6e489bfbb55584d21fe428081. Along the way, I hit a few confusing differences between HF and Excel:

I would imagine fixes in HF would need to be gated on new config options. I'm not likely to have time to work on fixes, but I just wanted to report these and the workarounds, in case they're helpful to anyone else. Thanks so much for this great library!

AMBudnik commented 3 months ago

Thank you for bringing this up. That is a valuable feedback.

We will check it out internally and update this thread.

sequba commented 2 months ago

@dabreegster

  it('should assume first column if no last argument', () => {
    const engine = HyperFormula.buildFromArray([
      [1, 2],
      [3, 4],
      ['=INDEX(A1:B2, 2)'],
    ])

    expect(engine.getCellValue(adr('A3'))).toEqual(3)
  })
dabreegster commented 2 months ago

Thanks for confirming! I've been using LibreOffice 7.3 to work with this particular xlsx (I don't have access to Excel on Linux), so maybe the differences are actually there. It was quite a convoluted debugging process to figure out which parts of huge formulas was differing, and it's possible I didn't isolate the root causes properly.