4 ms·
I know of some Python libraries that do this: https://github.com/bradbase/xlcalculator https://github.com/dgorissen/pycel https://github.com/vinci1it2000
by _dain_ 3y ago
I know of some Python libraries that do this:
https://github.com/bradbase/xlcalculator
https://github.com/dgorissen/pycel
https://github.com/vinci1it2000/formulas
You give it an .xlsx file and it compiles to a Python representation where you can mutate "cells" and observe calculated results in other "cells", according to the formula DAG. Not sure about other languages but I'd be surprised if Python were the only one to have libraries like this.
Funfact: it's more complicated than you think to implement these engines. There's no spec for the formulae, so you have to reverse-engineer based on observed behaviour. You run into a lot of strange edge cases in seemingly mundane arithmetic formulae, and type conversions are a constant source of surprise.