0

So I have an excel sheet that contains a cell showing a certain numerical value (lets say 10), the value is the result of a function (lets say =a1+a2 where a1 is 6 and a2 is 4). so the cell content is =a1+a2 and is showing 10 when viewing the sheet. Using "Workbook" object from openpyxl library in python i need to grab the resault showen by the cell (10). When using this code in python:

from openpyxl import load_workbook
wb2 = load_workbook('Class5Pitaron.xlsx')
sheet=wb2['CAPM']
b1=sheet['K6']
print(b1.value)
=a1+a2

i get the actual function of the cell and not the end value.

How can i get the actual value and not the function?

Thanks.

Tried solving this using Workbook object from openpyxl with no luck.

ErrorWhile
  • 11
  • 3
  • Possible duplicate of [How to access the real value of a cell using the openpyxl module for python](https://stackoverflow.com/questions/22613272/how-to-access-the-real-value-of-a-cell-using-the-openpyxl-module-for-python) – Adirmola Apr 08 '19 at 14:54
  • The above post solved my issue, thank you very much. – ErrorWhile Apr 08 '19 at 15:13

0 Answers0