Jul-12-2021, 06:02 AM
Hi,
I have read the documentation of the "Formula" package at https://formulas.readthedocs.io/en/stabl...ng-formula but it doesn't explain how to input the values for an Excel function that uses a range of cells.
Hope someone can help with the below queries. Thank you!
1) For Excel function with a range of values separated by :, how do I input into the parsed function?
EG
EG
I have read the documentation of the "Formula" package at https://formulas.readthedocs.io/en/stabl...ng-formula but it doesn't explain how to input the values for an Excel function that uses a range of cells.
Hope someone can help with the below queries. Thank you!
1) For Excel function with a range of values separated by :, how do I input into the parsed function?
EG
val='=SUM(A1:B3)' func = formulas.Parser().ast(val)[1].compile() print (func.inputs) output: OrderedDict([('A1:B3', <Ranges>(A1:B3))]) print (func(25,4)) output: raise TypeError('too many positional arguments') from None TypeError: too many positional arguments2) Excel Function SUMPRODUCT doesn't seem to be supported, I get [[#VALUE!]] error
EG
val='=SUMPRODUCT(A1,B3)' func = formulas.Parser().ast(val)[1].compile() print (func.inputs) output: OrderedDict([('A1', <Ranges>(A1)), ('B3', <Ranges>(B3))]) print (func(25,4)) output: [[#VALUE!]]