I used pandas to read a excel A and write formula on K column, then saved to a excel B.
for row_num in range(1, 18):
worksheet.write_formula(row_num ,10, '=MID($J%d,LEN(LEFT($J%d,SEARCH(" ",$J%d)+1)),3)' % (row_num+1, row_num+1, row_num+1))
I could see the formula that I inserted from excel B and its correct value.
But when I used pandas to read excel B and print K column, its value became "0", how to solve it? I want to see the calculated value, not formula, not 0.
I give a example:
#this is about writing formula to excel file
import pandas as pd
cname = []
for i in range(1,5):
cname.append('=MID("ABCDE",LEN(LEFT("ABCDE",SEARCH("","ABCDE")+1)),3)')
s = pd.DataFrame({'col':cname})
writer = pd.ExcelWriter('output.xlsx')
writer.save()
Another program to read above excel file: result: it should be 'BCD', not 0