YEARFRAC is not working as in Excel in Aspose Cells for Java 23.7

In the attached file in C2 i am using the formula
=YEARFRAC(DATE(2024,12,31),DATE(2025,11,30),1)
In Excel this evaluates to 0.915068493150685

using this code

Workbook workbook = new Workbook("/Users/user1/files/yearfrac.xlsx");
workbook.calculateFormula();
System.out.println(workbook.getWorksheets().get("Sheet1").getCells().get("C2").getDoubleValue());

The output is 0.9138166894664843 which is different from excel. Please advise.

yearfrac.xlsx.zip (7.0 KB)

@dvector
Through sample code and file testing, we can reproduce the issue. It was found that YEARFRAC cannot get the correct value after calling Workbook.calculateFormula() method.
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): CELLSJAVA-45531

The issues you have found earlier (filed as CELLSJAVA-45531) have been fixed in Aspose.Cells for Java 23.8.

1 Like