excel-formula-parser
Standalone python3 script which enable multiline, versionning and comment for Excel Formulas.
Prerequisites
Python 3.10 and above – install
Excel 2019 and above – install
Installation
- clone repo locally
- launch python in working folder
Features
- Excel Formula versioning formulas using git
- writing a formula on multiple lines
- adding comments into Excel formula
Parsing process description
-
python-like comments management :
comment is recognized as a line which begin with “# ” (hastag followed by space -
line breaks and spaces remove
-
create one line per formula :
formula is detected as a line break followed by “=” (equal) sign
Usage example
- add your formula to excel_formula_in.txt
- run parser.py
- get result in excel_formula_out.txt
Limitations
- variable name containing space not supported
- unable to make difference between formula begin and “=” sign in formula body
Perspectives
- Excel linting needs to copy formula to Excel
- enable multiline comments
- add a sub-functions copy ability (like what a python interpreter does)