Closed alexbrainman-anz closed 4 months ago
Thanks for your issue. This issue has been fixed, please upgrade to the master branch by go get -u github.com/xuri/excelize/v2@master
, and this patch will be released in the next version. Note that, there some changes in the behavior of the calculation result of the DATE
formula function, when you set the cell formula with the DATE
formula using Excel, Excel will be set the cell value as a number, and set the cell with a date number format (if the cell does not have any existing formats). When you set the cell formula with the DATE
formula using the Excelize library, the SetCellFormula
function doesn't change the cell format, so you also need to create a style with number format with the NewStyle
function, you will get a style ID, and then you need to set the formula cell by the SetCellStyle
function with that style ID, otherwise, you will get numerical calculation result when calculating cell value by the CalcCellValue
function.
... This issue has been fixed, please upgrade to the master branch by go
get -u github.com/xuri/excelize/v2@master
, and this patch will be released in the next version.
I tried your fix. It works for me. Thank you very much for quick resolution.
... Note that, there some changes in the behavior of the calculation result of the
DATE
formula function, when you set the cell formula with theDATE
formula using Excel, Excel will be set the cell value as a number, and set the cell with a date number format (if the cell does not have any existing formats).
The behaviour change is fine with me. I compare dates. So comparing two numbers works for me.
Thanks again.
Alex
Description
I am using
=DATE(2020,10,21)+1
and=MIN(DATE(2020,10,21),DATE(2020,10,21),DATE(2020,10,22))
formulas in my Excel files.
I am calling
File.CalcCellValue
method on those formulas, but it returns error and no correct value.Steps to reproduce the issue:
I used this commit 9d4c2e6 .
I made these changes to the code:
I run this command:
Describe the results you received:
I see this output:
Describe the results you expected:
Output of
go version
:Excelize version or commit ID:
Environment details (OS, Microsoft Excel™ version, physical, etc.):
I use MacOS. I do not have Excel installed.
Thank you very much for your assistance.
Alex