Compute formula value after change #105
Labels
No Label
DBF
Dates
Defined Names
Features
Formula
HTML
Images
Infrastructure
Integration
International
ODS
Operations
Performance
PivotTables
Pro
Protection
Read Bug
SSF
SYLK
Style
Write Bug
good first issue
No Milestone
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: sheetjs/sheetjs#105
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Hello,
Not sure that it is an issue or a known limitation, but is it possible to refresh/recompute a formula value after changing a cell one ?
(for example, C1 has formula A1+B1, and I would like to get the C1 value updated after changing A1 value).
@BrunoMarchesson The goal of this library is to convert between Excel files and JS representations (the form is described in the README ). The xls library also produces the same type of structure.
Since there is no XLSX or XLSB-specific code involved, I think it makes the most sense to build a separate library for this. The key components are:
A) Formula parser: IMHO the best starting point is [MS-XLSB] 2.5.97.88. XLSB stores formulae as a series of Ptgs ("parsed things", a series of tokens that a parser would produce), so the ABNF is theoretically complete.
B) Math engine: It isn't difficult to get basic things like SUM right, but other functions are trickier. Lots of tests involved.
C) Dependency management: the trickiest part is keeping track of non-obvious dependencies: functions like OFFSET create dependencies.
I'll leave this issue open in case you or someone else is interested in tackling this problem
Many thanks for the quick answer.
I will try to write a piece of code for supporting some basic formulas and keep you informed !
Regards
@BrunoMarchesson Any progress on this? I might be able to get involved.
Is there any progress on the basic formula support? Would be much appreciated.
There are packages that do this exact thing, like https://github.com/fabiooshiro/xlsx-calc,
ws['A1']['f'] = "=SUM(100,200)"
This 1 worked for me
The formula bodies are currently round-tripped (so if you read a file, edit a value, write a new file and open the new file in Excel, you will see the new values). Formula recalculation is supported in the Pro version and we may eventually make it open source.