Hi everyone, I am new to this group. I am working on automating a few processes using Openpyxl
I have used a variety of functions in formulas in the program and they work pretty well. However, the `LET` function leads to 2 scenarios:
When I use it as is ie:
```
...... # boilerplate code sheet.cell(row=1, column=1).value = "=LET(MYVAL,\"Boogawooga\",MYVAL)"It updates the formula as `=@LET(MYVAL,"Boogawooga",MYVAL)` and I get a #NAME? error on the cell(s).
When I prefix it with `_xlfn` ie:
```
...... # boilerplate code sheet.cell(row=1, column=1).value = "=_xlfn.LET(MYVAL,\"Boogawooga\",MYVAL)"I get the following error upon opening the excel doc, and the cell(s) with the formula are empty:
' We found a problem with some content in 'filename.xlsx'. Do you want us to try to recover as much as we can? If you trust the source of this workbook, click Yes'
Using:
Any help will be highly appreciated.
On 24 Jun 2021, at 21:15, Eb J wrote:
Using:
openpyxl==3.0.7
python 3.6
Excel 365(Let function works on the file directly so it's not an old
version issue)
Any help will be highly appreciated.
Unzip the XLSX file and look at the source for the relevant worksheet. Excel uses the @ for a heap of different "special" functions.
Charlie
--
Charlie Clark
Managing Director
Clark Consulting & Research
German Office
Waldlehne 23
Düsseldorf
D- 40489
Mobile: +49-178-782-6226
On 24 Jun 2021, at 21:57, Charlie Clark wrote:
Unzip the XLSX file and look at the source for the relevant worksheet. Excel uses the @ for a heap of different "special" functions.
FWIW, because I don't have Office 365 and am not currently planning to get it either. I just looked at a sample file from Goskills https://www.goskills.com/Excel/Resources/Excel-LET-function
This is in the source for F2
<f>_xlfn.LET(_xlpm.SALES,SUM(C2:D2),IF(_xlpm.SALES>5,_xlpm.SALES10,_xlpm.SALES5))</f>
It looks like, in addition to _xlfn, you might need the _xlpm prefix for references.
Charlie
--
Charlie Clark
Managing Director
Clark Consulting & Research
German Office
Waldlehne 23
Düsseldorf
D- 40489
Tel: +49-203-3925-0390
Mobile: +49-178-782-6226
On Jun 25, 2021, at 3:07 PM, Eb J <ebzj...@gmail.com> wrote:
Than you so much Charlie, you are a lifesaver!
--
You received this message because you are subscribed to the Google Groups "openpyxl-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openpyxl-user...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/openpyxl-users/f2d37ebe-faf9-48ff-9cee-a5abad4f3610n%40googlegroups.com.
You received this message because you are subscribed to a topic in the Google Groups "openpyxl-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/openpyxl-users/O746AjGV9EY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to openpyxl-user...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/openpyxl-users/EC661349-D1D3-464F-A683-BB30C807FDBF%40gmail.com.