Maciek Groszyk
Maciek Groszyk

Reputation: 71

Is it possible to convert 'dynamic' excel formulas to python code?

Is it possible to convert excel formulas to python code? For example:

     "=TEXT(SORT(PROPER(UNIQUE(FILTER("
            "ws_1!A:A,ws_2!B:B=ws_3!C3"
            ')))), "")'

Or it is not possible. I was looking into Pycel, xlcalculator, formulas module. But unfortunately i cannot find more complicated example than sum(A,B).

Probably i could do it with pandas, but it won't work constantly in spreadsheet. Or can i save some python script instead formula to cell?

if you have any idea how to translate easier formulas eg. or any library that can do it, I would be grateful for the tips :

'=IFERROR(VLOOKUP(C2,ws!A2:B3,2,0), "Invalid")'

My motivation is to avoid a long excel formula in python code. And make it testable

Upvotes: 1

Views: 455

Answers (0)

Related Questions