用公式将excel单元格值写入另一个单元格

问题描述 投票:0回答:0

=AND($C11=1,$C$14=男!B37)男!L37 AND($C11=1,$C$14=男!B38)男!L38 AND($C11=1,$C$14=男!B39) 男!L39 AND($C11=1,$C$14=男!B40) 男!L40 AND($C11=1,$C$14=男!B41) 男!L41 AND($C11=1,$ C$14=男!B42)男!L42 $C11=1 $C$14

我想在这个公式中输入这个单元格的值(公式比这个参考不同的单元格大得多,这只是它的一部分)来自 python.

我试过这个:

import formulas

def has_formula():
func = formulas.Parser().ast(ws["C16"].value)[1].compile()
args = []
return func(ws["C12"].value)
print(has_formula())

But this can only add one at a time and the cell reference is much. I expect computer the formula and return result in python by entering all the cell referenced at once.
python excel pandas formula openpyxl
© www.soinside.com 2019 - 2024. All rights reserved.