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.