Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set-ExcelRange -Formula issue #1559

Open
jhejgard opened this issue Jan 30, 2024 · 1 comment
Open

Set-ExcelRange -Formula issue #1559

jhejgard opened this issue Jan 30, 2024 · 1 comment

Comments

@jhejgard
Copy link

First many thanks for importExcel, it is a great Powershell Module.

In my scripting I use Excel formulas a lot and normally have no issues with it on
Set-ExcelRange like -Formula '=COUNTIFS(J11:J100000,"Ansible LIN OS")'

Next Excel formula works if I create it manually in an Excel file, but when I use importExcel module and Set-ExcelRange it fails all the time. The formula counts how many different names are in column D where column J is "Ansible LIN OS"

-Formula '=SUM(--(LEN(UNIQUE(FILTER(D11:D100000,J11:J100000="Ansible LIN OS","")))>0))'

I wonder what I am doing wrong, what is special with this Excel formula is that is has two = signs, not very often used, but I could not come across a workaround on this one.
Hope some one can put some clarity on this. Thanks.

@dfinke
Copy link
Owner

dfinke commented Jan 31, 2024

Thanks for using ImportExcel.

Please do this to get some clues. The xlsx is a zip file. Create one xl file using the PS script. Name it fail.xlsx. Then create another pass.xlsx where you manually create the formula.

You can unzip both xlsx files to separate directories (rename them, change the ext to .zip).

Each should give you a bunch of xml files. That is how Excel stores the data. You can use an edit to inspect the xml. Find the formula that works in pass then find it in fail we can compare how it gets generated and go from there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants