We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Incorrect MIN formula result in long calculations

Hi,

We have an Excel workbook with lots of formulas and it seems Aspose.Cells v22.2.0 is not calculating one of the values correctly when compared with Microsoft Excel.

TestCase05_MIN.zip (144.2 KB)

Our test Excel workbook is attached above. I used the following C# code:

var workbook = new Workbook(@"C:\Temp\TestCase05_MIN.xlsx");
workbook.CalculateFormula();

// Change cell S1!F16 from current value "No" into "Base Scenario".
Worksheet worksheet = workbook.Worksheets["S1"];
worksheet.Cells["F16"].PutValue("Base Scenario");
workbook.CalculateFormula();

// Examine result in the Calc worksheet.
worksheet = workbook.Worksheets["Calc"];
string s1 = worksheet.Cells["N334"].ToString();
string s2 = worksheet.Cells["N335"].ToString();
string s3 = worksheet.Cells["N325"].ToString();
string s4 = worksheet.Cells["N326"].ToString();

When I run this code I find the result of s1 to s4 as:

s1 = "Aspose.Cells.Cell [ N334; ValueType : IsNumeric; Value : 0; Formula=MIN(N335,N326-N325) ]"
s2 = "Aspose.Cells.Cell [ N335; ValueType : IsNumeric; Value : 1548976.262; Formula=SUMIFS(....omitted..."
s3 = "Aspose.Cells.Cell [ N325; ValueType : IsNumeric; Value : 0; Formula=IF(VLOOKUP(... omitted..."
s4 = "Aspose.Cells.Cell [ N326; ValueType : IsNumeric; Value : 1565348.512; Formula=-MIN(N318,0) ]"

As you can see, cell N334’s formula is MIN(N335,N326-N325), where:

  • N335 = 1548976.262
  • N326 - N325 = 1565348.512 - 0 = 1565348.512

Aspose reports N334’s cell value as 0, which is incorrect according to the formula. When I apply the same change as the code in Microsoft Excel, it reports the Calc!N334 cell value as 1548976.3.

Can you please have a look into it?

Many thanks.

@llawryy,

Thank you for reporting the issue with details and required resources. We have reproduced the issue with that and recorded a ticket for it(CELLSNET-50565). We are looking into it and will update you here when we fix it.

@llawryy,

This is to inform you that your issue has been resolved. The fix will be included in our upcoming release, i.e., Aspose.Cells for .NET v22.3. You will also be informed once the next version is published.

The issues you have found earlier (filed as CELLSNET-50565) have been fixed in this update. This message was posted using Bugs notification tool by johnson.shi

Thanks! I’ve tested it and it is working with version 22.3 now. Thanks for the quick fix.

@llawryy,

Good to know that your issue is sorted out by the new version/fix. In the event of further queries or issue, feel free to write us back.