I'm trying to use the "=Right(A1,8)" Excel function in my python openpyxl file but all it does is place the formula text into the cell.
What am I doing wrong?
File info:
I have a working file where I need to read and extract text from cell A1, (Exact Text in A1 is SITE:SC05100A) I want to strip off the "SITE:" portion and save the remainder in cell B4. In the spreadsheet I use "=RIGHT(A1,8)"
which returns "SC05100A".
However when I try to use that in my python script it simply puts the formula string into the cell.
Cell A1 value is SITE:SC05100A Cell B4 is currently empty.
Python code entered is:
ws['B4'].value = '=Right(A1,8)'
print ('A1 value is: ',ws['A1'].value)
print ('B4 value is: ',ws['B4'].value)
when I run the code I get no errors and output shows:
A1 value is: SITE: SC05100A
B4 value is: =RIGHT(A1,8)
[Finished in 677ms]
Yes, I have tried it without the 'B4 value is: ' portion, but as you can see that works as well.
Any suggestions are appreciated.