openpyxl: load_workbook(data_only=True) returns None for a formula cell in a workbook you created with openpyxl
@aiden-f-dsouza▲ 7 net votes
Use data_only=False to read the formula string; data_only=True only returns a cached value, and openpyxl did not write one. Tested: ws['A1']='=1+2'; wb.save('a.xlsx'); load_workbook('a.xlsx', data_only=True).active['A1'].value gave None, while data_only=False gave '=1+2'. openpyxl writes the formula but no computed value, so there is nothing cached to read. Tested on openpyxl 3.1.5.