I am attempting to evaluate cell Sheet1!A1 with the following code in test.py
from pycel import ExcelCompiler
excel = ExcelCompiler(filename="test.xlsx")
print("A1 is %s" % excel.evaluate('Sheet1!A1'))
excel.set_value('Sheet1!B1', 200)
print('A1 is now %s' % excel.evaluate('Sheet1!A1'))
This produces a value error I believe caused by passing a range instead of a comma-separated list of cells:
env ❯ python test.py
A1 is 25.6198347107438
A1 is now #VALUE!
What was expected to happen
I would expect this to evaluate A1 to 198.347 and produce the following console log:
env ❯ python test.py
A1 is 25.6198347107438
A1 is now 198.3471074380165
If I change the formula in cell A1 to =NPV(0.1, B1,C1) this does evaluate correctly
What actually happened
I have an excel file (call it "test.xlsx") with the following layout:
Sheet1!A1 -> =NPV(0.1,B1:C1) Sheet1!B1 -> 10 Sheet1!C1 -> 20
I am attempting to evaluate cell Sheet1!A1 with the following code in
test.py
This produces a value error I believe caused by passing a range instead of a comma-separated list of cells:
What was expected to happen
I would expect this to evaluate A1 to 198.347 and produce the following console log:
If I change the formula in cell A1 to
=NPV(0.1, B1,C1)
this does evaluate correctlyEnvironment