Read excel cell values containing formulae with pandas

Viewed 4891

I am trying to read an excel with pandas but because it has formulae it will return nan values when reading it instead of the cell values.

df=pd.read_excel('Test.xlsx',sheet_name='Sheet1')
1 Answers

@Naga kiran if you want to see the value instead of the formula you can add:

wb = load_workbook('empty_book.xlsx', data_only=True)

But openpyxl never evaluates formula (https://openpyxl.readthedocs.io/en/latest/usage.html#using-formulae)

You need to open the empty_book.xlsx with Excel and save it if you want to see the formula result

Related