LesterLyu / fast-formula-parser

Parse and evaluate MS Excel formula in javascript.
https://www.npmjs.com/package/fast-formula-parser
MIT License
462 stars 64 forks source link

Dependency parsing of index formulas in incorrect #58

Open mountEvarus opened 1 year ago

mountEvarus commented 1 year ago

When parsing an index formula like the following:

INDEX('Sheet1'!A1:AV90,'Sheet2'!C28,'Sheet2'!G2)

The result of new FormulaParser.DepParser().parse() is:

[{ from: { row: 1, col: 1 } }, sheet: "Sheet 1", to: { row: 90, col: 48 } ]

This would suggest there are thousands of dependencies, but really is are only 1 when the index is resolved, the row & column values given by arguments 2 & 3 are used to get the cell in question.

Maybe I am thinking about this wrong but this is how I see it, any thoughts are welcome